Questions tagged [lsp-mode]

lsp-mode serves as an Emacs client for the Language Server Protocol.

Filter by
Sorted by
Tagged with
1
vote
1answer
77 views

Use helm in specific modes and not for other buffers in different mode

I recently started using lsp-java and one of the packages it suggests is helm. The suggested changes to the .emacs file to do this is: (use-package helm-lsp) (use-package helm :config (helm-mode)) ...
0
votes
1answer
275 views

How to set up pyrightconfig in lsp-pyright?

I am using lsp-pyright[1] module in doom Emacs for Python major mode. Local imports from my project are not recognized by lsp server. I have created a pyrightconfig.json file in root directory of my ...
0
votes
2answers
511 views

How to correctly configure Flow backend for LSP mode?

I'm using spacemacs @develop (branch). I can't use lsp and lsp-ui. In vscode everything works (using flow lsp mode). With company-flow I can also make it working. When opening a .js file with // @...
1
vote
1answer
126 views

Use golangci-lint with lsp-mode

How can I set up golangci-lint as the linter with my config? I've tried using flycheck-golangci-lint but it doesn't seem to be working. I'm testing my config by opening a .go file with an ineffectual ...
6
votes
2answers
2k views

How to debug / troubleshoot LSP “not in project or it is blacklisted.” in lsp-mode?

Recently LSP has stopped working for me. I'm getting this message for all files in my project. LSP :: example_filename.c not in project or it is blacklisted. How can I investigate this, if it's ...
0
votes
0answers
14 views

Auto-saving after lsp refactor

When I use lsp-rename function, the edited files are not saved automatically and I have to manually save them. Is this an expected behavior and, is it possible to change this? (I use emacs 27.2, with ...
3
votes
1answer
40 views

How to start lsp-mode connections lazily after desktop is restored?

I have configured lsp-mode as follows: (use-package lsp-mode :straight t :init (setq lsp-keymap-prefix "C-c l") :hook ((python-mode . lsp)) :commands lsp) I am also using desktop-...
2
votes
1answer
400 views

How to improve eldoc + lsp-mode output with C/C++ comments?

When using eldoc with lsp-mode, there are some irritations with the default output. Various characters are backslash escaped, so: /* This: isn't so -> "good", you see. */ Displays as: This\: ...
0
votes
1answer
44 views

lsp-mode tramp auto-completions

Ive set up remote lsp-mode with tramp and pylsp server. While the server does start when I open a remote py file, many server features such as auto completions, code format, references dont work. Here ...
0
votes
1answer
13 views

terraform tfls server always asks if restart when edit a .tf file in spacemacs

When I use terraform layer with spacemacs, after operate a .tf file, at the status bar it always notices the message below: Server tfls:3869 exited with status exit(check corresponding stderr buffer ...
1
vote
1answer
38 views

Required help with making LSP (Scala Metals) working

My current emacs version is 27.2, OS is Ubuntu 20.04,Java version is 11.0.11. I was following the official guide of installing metals on emacs, did a little change from the course at the start (I ...
0
votes
0answers
44 views

Autocomplete for Go in emacs with LSP + gopls

Following up on https://stackoverflow.com/questions/50668619/autocomplete-in-golang-in-emacs, which is now over 3 years old, but technology has evolved. I did a lot of reading on what's the latest ...
2
votes
0answers
26 views

lsp-mode How to suppress function defitions for specific functions in python

I am using lsp under Python. I have followed: https://emacs-lsp.github.io/lsp-mode/page/installation/ for its installation. (require 'lsp-mode) (add-hook 'python-mode-hook 'lsp) (add-hook 'python-mode-...
0
votes
1answer
172 views

How to make company-lsp case sensitive?

Currently if I try to complete a work, the case of the prefix is ignored with company-lsp. From looking into the code, company-lsp is hard-coded to use ignore-case. As at the time of writing company-...
0
votes
1answer
179 views

C++ lsp-mode: inconsistent behavior between remote and local projects

I've run into a bit of an odd problem trying to use lsp-mode. My problem setup is as follows: I'm working on a C++ project on my computer, and I'd like to be able to use lsp-mode with it. The catch is ...
1
vote
0answers
49 views

enable flycheck/syntax checker for Java in Spacemacs

I'm a java developer and I'm beginner using spacemacs, I've configured .spacemacs file to java configuration. Many functionalities works well, for example, a class recognition when I'm coding, but in ...
1
vote
1answer
46 views

Company completion backend company-capf error error

I am using lsp-mode and company on top of Pyhton files. When I complete a function I am getting follwing error: Company: backend company-capf error "[yas] ‘yas-expand-snippet’ needs properly ...
0
votes
1answer
268 views

How to debug lsp-mode “lsp-request: method not found”?

I've setup lsp-mode and clangd, and put the compile-commands.json in the projects root. I can tell compile-commands.json because my cflags are included in the Updating file output of *clangd::stderr* ...
0
votes
1answer
2k views

Running lsp-mode with Python using the pyls from the virtualenv of my project

I wish to run LSP using the pyls from the virtualenv of my project. I don't have pyls installed globally (only in the local virtualenv). I found this snippet online: (lsp-define-stdio-client lsp-...
2
votes
2answers
79 views

How can I disable lsp-headerline?

I'm using centaur tabs, and when lsp-headerline enables my tabs hides. I want to disable that headerline using lsp-headerline-bradcrumb-mode in a hook (use-package lsp-mode :commands (lsp lsp-...
0
votes
2answers
112 views

How to suppress warning about positional arguments in define-minor-mode

I am on Emacs 28.0.5 and keep getting warnings about: Warning: Use keywords rather than deprecated positional arguments to `define-minor-mode' Unfortunately it is for packages I don't control like ...
1
vote
1answer
497 views

How can I set the indentation offset for `indent-region`

I am using spacemacs + lsp layer (ccls) for c/c++ editing Having my c-basic-offset set to 4: if I select a region and press = (maybe invoking indent-region?), the region is indented by 2 spaces (...
0
votes
0answers
55 views

How can I set up Emacs to use Flycheck and pylint django?

I use lsp-mode and flycheck. My .pylintrc config: [MASTER] load-plugins=pylint_django What other settings do I need?
0
votes
1answer
217 views

File mode specification error: (void-variable lsp-csharp--action-client-find-references)

I'm using doom emacs. my ~/.doom.d/config.el is - (use-package! lsp-mode :hook (haskell-mode . lsp) :commands lsp) (use-package! lsp-ui :commands lsp-ui-mode) (use-package! lsp-haskell :after ...
0
votes
1answer
147 views

the following functions might not be defined at runtime: lsp-format-buffer, lsp-organize-imports function ‘dap-go-setup’ is not known to be defined

I 've below emacs init file config setup I'm getting below error in the emacs startup. I don't know what might be the root cause of the issue the following functions might not be defined at runtime: ...
1
vote
1answer
343 views

Getting Emacs lsp-mode to work with this matlab-langserver

I am trying to get this Matlab language server to work with lsp-mode. Following the instructions in lsp-mode's github page, I inserted the following in my init.el: (use-package lsp-mode :ensure t ...
0
votes
0answers
23 views

List classes, methods, and funcs with helm

I want a list of functions, classes, and methods, without imports or variables, that matches the ordering in the current file. Since I use helm-swoop, I would like to be able to do this with helm. I ...
1
vote
0answers
39 views

I want xref-find-definitions that uses the second backend when the first backend doesn't find anything

I program in Haskell using lsp-mode with lsp-haskell. I need to have a working "jump to definition". xref-find-definitions using lsp--xref-backend sometimes fails to find the definition. ...
1
vote
1answer
166 views

lsp-mode: disable documentation popup

I installed rustic-mode with LSP server. They work. But now it shows docs and description of every symbol I put my cursor on. It distracts and irritates me a lot. How can I make it show the symbol ...
0
votes
0answers
16 views

go module with subdirectory of git project is showing compilation errors in emacs using lsp-mode

I've my emacs setup for golang development. My golang config is github If I have go mod in the same directory as git root directory then it is working fine in emacs. example project here But If I've ...
0
votes
0answers
111 views

“Failed to get project GHC version:CradleError” cabal haskell project is not working fine with haskell-language-server-wrapper

I've installed haskell platform in my linux system using ghcup. I've setup language server configuration for haskell which is github like this. Then I've created a cabal project mkdir cabal_project ...
2
votes
1answer
67 views

How can I associate a schema with a json file using lsp-mode/lsp-json

If you read the documentation for lsp-mode-lsp-json here, this is the section that deals with setting schemas: Available configurations lsp-json-schemas Default: nil Associate schemas to JSON files ...
3
votes
1answer
513 views

How do I solve `Lisp error: (void-function -compose)` when using lsp-dart?

When I load a Dart file with GNU Emacs 27.1-1 for OS X I get the following little error novel. Debugger entered--Lisp error: (void-function -compose) (-compose #'lsp--client-path->uri-fn #'lsp--...
0
votes
0answers
44 views

How to get variable type definition in lsp for using in Lisp code?

I want a helper command for refactoring code in Go language. I have not found ready for use function for this task in go-mode and lsp. It should declare variable from the word under the point and ...
3
votes
0answers
220 views

How do I make lsp-mode ignore a node_modules folder + others?

I want to know how to make lsp-mode ignore a node_modules folder (along with say, folder asdf and temp). This is what I have: (setq lsp-file-watch-ignored (rx (or "node_modules" "asdf&...
0
votes
1answer
118 views

How to configure lsp-cmake lsp server in vanilla emacs

I want to setup lsp-cmake lsp server in my vanilla emacs. I just installed lsp server using pip install cmake-language-server. I don't know how to configure in my emacs init.el to use the lsp server. ...
2
votes
0answers
35 views

Hide ifdef(or gray out) through compile_command.json

I've just finished to set up LSP with ccls and company packages. It works but I have one more possible wish that such LSP packages could do. Now I'm using hide-ifdef package to gray out the inactve ...
1
vote
1answer
243 views

How to stop lsp-mode including headers automatically for C/C++ code?

Every now and then lsp-mode is adding a header to the C source code I'm working on. How can this functionality be disabled?
1
vote
0answers
98 views

Enable LSP in spacemacs only for certain languages?

The spacemacs LSP layer documentation says: Enabling this layer will set the used backend for all supported languages to LSP unless you explicitly set a specific backend for the language. I find ...
0
votes
0answers
81 views

How do I turn off whitespace-mode within flycheck-mode and lsp-mode (in doom emacs)?

I've enabled whitespace-mode and I'm correctly able to see my spaces, tabs, and newlines. But the spaces also show up when I receive messages from emacs (ie when I get error messages and code action ...
0
votes
0answers
15 views

Server metals:4410 status:starting exited with status exit. Do you want to restart it? (y or n)

I'm trying to setup my emacs editor as scala IDE. I'm following the instruction from the page https://scalameta.org/metals/docs/editors/emacs.html to do the set up. when I'm importing sbt project into ...
1
vote
3answers
312 views

Emacs Javascript basic code completion

I try to set proper completions/suggestions for Javascript. There is no problem with ES6+ and Typescript types and defined variables but most of the time I work with vanilla JS in browser context, so ...
1
vote
1answer
85 views

Skip over remaining errors in current file to next error in next file

tl;dr I am using :cn in Evil's Ex command line and would like to use :cnf as well, but it is not there, and I don't know what function to bind it to. Details As a former Vim user who is slowly ...
1
vote
2answers
660 views

How can I enable lsp-headerline-breadcrumb-mode in lsp-mode?

I would like to enable lsp-headerline-breadcrumb-mode in every buffer where lsp-mode is active. I'd know how to do it for every mode, for example (use-package go-mode :ensure t :config (add-hook ...
0
votes
0answers
73 views

“Error running timer: (wrong-type-argument listp ” when debugging in emacs using dap-mode lsp-java

I've a gradle project imported into emacs using treemacs. When I try to debug the project I get error - LSP :: Please open an issue in lsp-mode for implementing `vscode.java.resolveMainClass'. (error ...
2
votes
0answers
639 views

Company: backend company-capf error

I'm using emacs-lsp with company-capf. While editing an elisp file, it works fine. However, once I run eval-buffer, I get the following error when trying to use completion: Company: backend company-...
0
votes
0answers
101 views

file mode specification error (wrong-type-argument lsp--client nil)

I'm using lsp-java package as java IDE and syntax completion. Below is my configuration (require 'lsp-java) (add-hook 'java-mode-hook #'lsp) (condition-case nil (require 'use-...
0
votes
0answers
25 views

Help required wrt. lsp-mode with gopls on Windows natively without WSL

I am currently running Emacs 27.1 on Windows 10. I am using lsp-mode with gopls with Go installed natively (without WSL). I am running into issues setting it up. Specifically, I am running into: https:...
1
vote
1answer
761 views

lsp mode does not recognize standard library

Today I did two things: I upgraded some emacs packages (don't know which ones) I installed in addition to emacs 27.1, emacs 28 with native compilation I built the "gccemacs" in a separate ...
1
vote
1answer
135 views

How to shorten signature display in echo area?

Currently, the signature of the current function the pointer is on is shown as follows: as you can see, the signature is so large that it overflows the echo area. I was wondering if there could be a ...