Questions tagged [lsp-mode]

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

Filter by
Sorted by
Tagged with
14
votes
1answer
3k views

What are these prefix commands that start with s-l?

I'm using lsp-mode, and I see these weird prefix commands that start with s-l. How do I type them? `lsp-mode' Minor Mode Bindings: key binding --- ------- s-l ...
6
votes
1answer
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 ...
3
votes
1answer
2k views

lsp project root

I just switched to using lsp for my C++ and Python IDE needs. However, I am running into a constant issue where Python and C++ files have the wrong root, as reported by (lsp-workspace-root). The root ...
3
votes
1answer
200 views

How to stop lsp-mode converting C/C++ includes into buttons?

When lsp-mode is enabled all headers become clickable (draw as buttons), underlining them making them slightly harder to read. I don't need this since I can have a key bound to go to the header. Is ...
3
votes
2answers
751 views

company-lsp complains about void function lsp--client-completion-in-comments

my emacs lsp-python setup is pretty standard: (require 'lsp-mode) (add-hook 'python-mode-hook #'lsp) (require 'company-lsp) (push 'company-lsp company-backends) (add-hook 'after-init-hook 'global-...
3
votes
1answer
160 views

How can I disable the use of minibuffer in lsp-ui?

When lsp-ui-doc offers me information about the symbol at point, it does that in a hover window (good) and in the minibuffer (bad). I've found no mention of the minibuffer in the customisations of ...
3
votes
0answers
124 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&...
3
votes
0answers
390 views

How can I see all errors in a Go project with LSP mode?

When opening a Go project with LSP mode, spacemacs / flycheck only shows errors in the current package, not including tests files. For example, in the following project: |- pkg1 |- pkg2 |- cmd When I'...
2
votes
2answers
344 views

How to set minor mode variables in dir-locals?

Im writing an lsp-mode purescript client and couldn't figure out how to override the default config options using a .dir-locals file. For example, I have a defcustom : defcustom lsp-purescript-use-...
2
votes
1answer
306 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--...
2
votes
1answer
369 views

Disable lsp-mode symbol highlighting?

When using lsp server, symbol highlighting obscures the highlighting done by region selection. I can toggle this behavior per-buffer with lsp-toggle-symbol-highlight, but cannot permanently disable ...
2
votes
1answer
243 views

emacs lsp-mode python how to disable certain warnings

lsp-mode complies to PEP8 style guide I guess, but how can I disable certain warnings, e.g. about missing docstrings etc.?
2
votes
1answer
363 views

Use lsp-mode for some projects and ggtags for others

Is there a way to configure Emacs to activate lsp-mode for some projects and ggtags for other projects? Maybe using .dir-locals.el? I code C++ and the project I most often work on doesn't support lsp-...
2
votes
1answer
48 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 ...
2
votes
1answer
260 views

rust-analyzer completion broken

When I try to use auto-completion with lsp + rust-analyzer, all functions inserted like that: shared_state.clone_from(${1:source})$0 I cannot find any way to disable this "arguments". I don'...
2
votes
0answers
31 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 ...
2
votes
1answer
350 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\: ...
1
vote
1answer
503 views

Stop company-lsp from completing function arguments

I try to configure lsp-mode and company-lsp with python-language-server for python autocompletion, but when I choose completion candidate it completes with function arguments. How can I prevent this ...
1
vote
3answers
244 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
2answers
554 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 ...
1
vote
1answer
1k views

How to update lsp-java manually?

I'm trying to run a simple HelloWorld from Emacs using dap-mode commands dap-debug and dap-java-debug but prompted the error saying lsp-request: No delegateCommandHandler for vscode.java....
1
vote
1answer
123 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 ...
1
vote
1answer
558 views

Remap lsp-mode prefix with use-package

How do I remap the lsp-mode prefix key to "s-k" using the use-package package? I tried the following (use-package lsp-mode :ensure t :init (setq lsp-keymap-prefix (kbd "s-k") ...
1
vote
1answer
279 views

lsp-mode find symbol or refs *not* under point?

Sometimes I know the name of the function I'm looking for but it isn't used anywhere in the current buffer. With the various tags utilities I was always able to just search for a definition by name, ...
1
vote
1answer
69 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
1answer
185 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
1answer
948 views

How to disable semantic highlighting in lsp-mode?

Language server mode has a variable for semantic highlighting lsp-ht, I would like to disable all syntax highlighting in lsp-mode. Is this possible? (setq lsp-enable-links nil) (setq lsp-enable-...
1
vote
1answer
604 views

Configuring lsp-mode to run elm-language-server

I'm trying to run lsp-mode for elm development and according to lsp-mode elm is supported. Also according to that link, I should only have to clone the elm-language-server repository, run npm install ...
1
vote
0answers
23 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
0answers
64 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 ...
1
vote
0answers
535 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-...
1
vote
1answer
577 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
0answers
66 views

How to focus or change point on child frame

I am trying to use lsp-ui package to display some documentation for Rust. When I put the cursor on a type for example, a popup child frame is created but the focus is still on the main window. If I ...
1
vote
1answer
70 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)) ...
1
vote
0answers
105 views

Suppress a warning in lsp-mode using clangd

Here's an example of code for which I get a warning when using lsp-mode, with clangd: struct A { union { struct B { int i; } b; }; }; The warning appears with a flycheck mark on ...
1
vote
1answer
440 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 (...
1
vote
1answer
149 views

How to hide “code actions” from lsp-ui sidebar?

Hi, I want to hide "code actions" which is recommended by lsp-mode from lsp-ui sidebar. How can I do for that?
1
vote
0answers
182 views

LSP sometimes working with Metals, sometimes spamming “the request has been cancelled”

I have Spacemacs configured to use Metals as an LSP backend for Scala development, i.e. my dotspacemacs-configuration-layers includes: (scala :variables scala-backend 'scala-metals ...
1
vote
0answers
598 views

Emacs configure lsp-mode / lsp-ui

I work mainly with javascript and typescript. And I have enabled lsp-mode in Doom Emacs. But I am not very happy about the descriptions and information shown to me on hover. It is not very useful and ...
1
vote
1answer
308 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 ...
1
vote
0answers
1k views

How do I get code signature snippets with lsp-mode/lsp-ui/company-lsp?

I see on the front page of https://github.com/tigersoldier/company-lsp when you type the function name it autocompletes not just the rest of the name, but the signature as a snippet, enabling you to ...
1
vote
0answers
219 views

Treemacs with Scala Metals/LSP: “Creating Pipe: Too Many Open Files”

I'm on spacemacs develop, emacs version 27, OSX Mojave 10.14. After adding the lsp layer and the snippet from the metals documentation here: to my .spacemacs file, treemacs will refuse to expand a ...
0
votes
1answer
128 views

Understanding why lsp-scala is not giving completions

I have installed lsp-mode, lip-scala, lsp-ui, company-lsp and many other packages. When entering scala code, I often get popups to complete the method/class/variable name, which also add the ...
0
votes
1answer
73 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
1answer
39 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 ...
0
votes
1answer
66 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. ...
0
votes
0answers
17 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 ...
0
votes
0answers
46 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 ...
0
votes
0answers
10 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
58 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 ...