21 votes
Accepted

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

For historical reasons, Emacs supports key bindings for the 'super' and 'hyper' modifier keys, which you probably do not have on your keyboard. See Modifier Keys in the Emacs manual for more ...
user avatar
  • 19.4k
12 votes
Accepted

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

I somehow managed to blacklist my own project, removing .lsp-session-v1 resolved the issue. This could be located in either: ~/.emacs.d/.lsp-session-v1 ~/.config/emacs/.lsp-session-v1 Although I ...
user avatar
  • 7,267
6 votes
Accepted

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

Maybe this is a bit late, but I'm also annoyed by this problem and clangd seems to have trouble working with multiple files. You can use lsp-clients-clangd-args to configure your clangd. Add the ...
user avatar
5 votes

How to set minor mode variables in dir-locals?

As @phils suggested you should be able to run M-x add-dir-local-variable. You will be prompted for a mode, and you could type/select lsp-mode (I am guessing that is the mode name). Then, you will be ...
user avatar
5 votes
Accepted

lsp project root

Bad form just to link but possibly this helps: https://www.reddit.com/r/emacs/comments/adxcal/subprojects_do_i_need_to_armwrestle_projectile_or/edl7jhl/ It covers how to add workspace folders and also ...
user avatar
  • 758
4 votes
Accepted

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

By chance, after commenting on this, hours later I ran into exactly the same issue. The cause was that spacemacs had for a while pinned its version of dash at 2.17.0, and -compose was introduced in 2....
user avatar
4 votes
Accepted

lsp-mode: disable documentation popup

Try the following. (setq lsp-ui-doc-enable nil lsp-ui-sideline-enable nil) You can check how to set/reset the options from the LSP page.
user avatar
3 votes

Stop company-lsp from completing function arguments

There are actually two variables that drive this behavior. You tried the first one, lsp-enable-snippet and it didn't work. This means that the culprit is probably company-lsp, which engages in a ...
user avatar
  • 423
3 votes
Accepted

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

Set lsp-enable-links to nil. This will disable lsp-mode's link support.
user avatar
3 votes
Accepted

Understanding why lsp-scala is not giving completions

lsp-scala is deprecated and you should now use lsp-mode which has scala support via metals. From the lsp-scala repo: lsp-scala is now part of lsp-mode as lsp-metals. Please do not use this package. ...
user avatar
  • 811
3 votes

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

I still don't know how to use the lsp-json-schemas variable, but with this mode properly activated in emacs you can add a top-level $schema property to the object you are presumably editing in the ...
user avatar
3 votes
Accepted

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

How about: (use-package lsp-mode :straight t :init (setq lsp-keymap-prefix "C-c l") :hook (python-mode . lsp-deferred)) The doc for lsp-deferred: Signature (lsp-deferred) ...
user avatar
2 votes
Accepted

Use lsp-mode for some projects and ggtags for others

Yes, you want to use .dir-locals.el and assuming the enable/disable commands you need are functions, its pseudo-variable eval. If you have lsp-mode globally enabled, add something like this to the ....
user avatar
  • 2,348
2 votes

emacs lsp-mode python how to disable certain warnings

Use (setq lsp-pyls-plugins-pycodestyle-enabled nil)
user avatar
2 votes
Accepted

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

I had a similar issue with lsp-mode and treemacs, though I am using vanilla Emacs not Spacemacs. I am also using macOS. From this Reddit thread I discovered that the limits do not appear to be ...
user avatar
  • 146
2 votes

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

@capitrane comment had the answer for me: M-x lsp-workspace-folders-add from within the project, and it started to work.
user avatar
2 votes
Accepted

How to update lsp-java manually?

ATM there are no manual instructions, please open an issue in lsp-java repo. To fix your problem do: M-x lsp-java-update-server - do that to force lsp-java to download the install pom.xml and cancel ...
user avatar
2 votes
Accepted

Disable lsp-mode symbol highlighting?

Customize the lsp-enable-symbol-highlighting option: (setq lsp-enable-symbol-highlighting nil) or via Easy Customization Interface: M-x customize-variable <RET> lsp-enable-symbol-highlighting ...
user avatar
  • 2,185
2 votes

Emacs Javascript basic code completion

This solution is not using LSP. It only uses Ctags. You could use company-mode's default backend company-etags or 3rd party package company-ctags for code completion. The key question is how to ...
user avatar
  • 4,621
2 votes
Accepted

How to shorten signature display in echo area?

The string displayed by lsp-mode is not generated by lsp-mode but by the server. If you want to achieve that open a feature request against the server that you are using.
user avatar
2 votes

How to set up pyrightconfig in lsp-pyright?

You can include additional Python source paths with lsp-pyright-extra-paths. Here is my pyrightconfig.json for a project. { "exclude": ["**/node_modules", "**/__pycache__&...
user avatar
2 votes
Accepted

How to update installed lsp servers in lsp-mode

There is an interactive function called lsp-update-server. You can of course update the server packages manually independent of lsp.
user avatar
2 votes
Accepted

Identifying functions that trigger timers and cause redisplays when profiling Emacs execution

M-x list-timers will show you active and idle timers, how often/when they trigger, and what function they run. The command is disabled by default, but you can enable it for one-time use or permanently ...
user avatar
  • 20.4k
1 vote
Accepted

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

There is a variable you can customize that automatically enables the headerline breadcrumb mode whenever lsp-mode is active. Try something like: (use-package lsp-mode :custom (lsp-headerline-...
user avatar
  • 101
1 vote

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

The following snippet works for me, it enables breadcrumbs in all modes where lsp is active. (require 'package) (setq package-user-dir (expand-file-name "~/.emacs.d/elpa/") package-...
user avatar
1 vote

How to focus or change point on child frame

Bind a key (or keys) to run the lsp-ui-doc-focus-frame command: (use-package lsp-ui :bind (("C-h ." . lsp-ui-doc-focus-frame)))
user avatar
  • 3,828
1 vote

Remap lsp-mode prefix with use-package

You want to set that variable to a string. This ought to work: (use-package lsp-mode :init (setq lsp-keymap-prefix "s-k")) You had :ensure t in there as well, but it doesn't have ...
user avatar
  • 12.1k
1 vote

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

Don't call helm-mode at all. Helm-mode does not introduce anything for lsp-java per se but IMO improves general emacs usability. You could use helm-lsp function without having helm-mode enabled.
user avatar
1 vote

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

Nope. As best I can tell, the LSP protocol doesn't appear to have any facility for looking up definitions based on name rather than document position. In fact, an LSP client like Emacs doesn't even ...
user avatar
  • 12.1k
1 vote

How to make company-lsp case sensitive?

company-lsp is deprecated use company-capf (just delete company-lsp and lsp-mode will pick it). company-capf is case-sensitive by default.
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible