Skip to main content

Questions tagged [lsp-mode]

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

Filter by
Sorted by
Tagged with
2 votes
0 answers
71 views

With lsp-mode, why do I get an unknown notification about refreshed rules from semgrep?

I constantly get this message: ⛔ Warning (lsp-mode): Unknown notification: semgrep/rulesRefreshed This is something new. Can I somehow pin the commit, so that I can got back to where it didn't show, ...
Jason Hunter's user avatar
0 votes
0 answers
13 views

LSP mode connecting to wrong server

I'm trying to read the postgres source code. My lsp server connects to the clangd lsp for some reason even though the project is using C. [-] /home/jenia/git/postgresql `-[-] clangd:40775 |-[-] ...
Jenia Ivanov's user avatar
0 votes
0 answers
8 views

With lsp-mode for C#, how can I replace var with explicit type?

In Visual Studio, there is a Quick Action to use explicit type instead of 'var'. Is this Quick Action supposed to be available using lsp-mode? I've tried lsp-execute-code-action, but it doesn't ...
Jason Hunter's user avatar
1 vote
1 answer
76 views

Prevent `lsp` + `company` from losing completion after dot + symbol

In many languages . is specially treated, so e.g. after typing a foo. a user expects a completion for methods available from foo. That works with company as well, however after foo. triggered a ...
Hi-Angel's user avatar
  • 798
0 votes
0 answers
135 views

Emacs as Java IDE - How to run code?

I am looking at setting up Emacs for Java development. As much as possible, I would like to achieve Emacs being comparable to IntelliJ IDEA in terms of features, and also ease-of-use / "things ...
user19051's user avatar
0 votes
1 answer
54 views

Configure lsp-mode and lsp-java to not open unrelated projects

When opening a Java file of a project previously attached to lsp-mode and the language server, the modeline as well as the error buffer called up with s-l g e show errors of all projects I ever ...
Harald's user avatar
  • 328
2 votes
1 answer
95 views

lsp-mode open declaration / definition in other window

I'm starting to feel a bit frustrated: this should be as simple as setting some variable or other, but I'm unable to find which one. Say I'm editing file foo.c and I find something like void foo(int n)...
TheHobbit's user avatar
0 votes
1 answer
146 views

lsp-java and its relation to the eclipse.jdt.ls language server

When using lsp-java with a 3 file project and one external jar, I am not using gradle or maven. I put the jar into a lib directory, open a Java file and everything works. Then I follow find-...
Harald's user avatar
  • 328
1 vote
1 answer
73 views

Jump/Goto next highlighted symbol in lsp-mode

Lsp-mode has a function lsp-document-highlight bound by default to s-l a h which picks the symbol at point and highlights all (semantic) occurrences. Is there a goto-next-highlight. I checked the ...
Harald's user avatar
  • 328
0 votes
2 answers
59 views

Disable lsp-mode for certain buffers matching a specific pattern

What's the preferred way to not enter lsp-mode for certain buffers such as Emacs' backup files named for instance, app.c.~304fb1fe3650a354c4da16352f6c7be8bffd88cb~. I still want such files to open in ...
Nordlöw's user avatar
  • 517
-1 votes
1 answer
82 views

Lsp-mode cannot find <linux/init.h> file with Linux kernel source project

I installed Lsp-mode with open Linux source kernel,but got this error even if I add lsp-workspace-folder-add the right file. LSP :: Connected to [clangd:8185/starting /home/lela/linux-3.0.35]. LSP :: ...
jdir.s's user avatar
  • 1
1 vote
1 answer
37 views

`recenter` issue in `xref-go-back` when using `lsp-mode`

I have the below setting in my config as recommended by many scrolling packages like ultra-scroll-mac. (setq scroll-conservatively 101) The issue is, when using this config with lsp-mode, xref-go-...
Saddle Point's user avatar
0 votes
1 answer
58 views

No output in Python inferior buffer after C-c C-c

OS: Windows 11 (64 bit) Python version: 3.12.0 (64 bit) Emacs version: 29.1 I use LSP mode in Emacs for Python programming and I have in my Emacs init.el file the following: (custom-set-variables ...
user17911's user avatar
  • 143
0 votes
1 answer
238 views

Can not configure lsp-enabled-clients via lsp-jedi

I'm trying (again![1][2]) to get lsp-jedi working on one of my systems (Gentoo Linux, same configuration works ok under Arch Linux). I have pip install --user jedi-language-server so that it is ...
slackline's user avatar
  • 345
0 votes
0 answers
74 views

Both ts-ls and eslint used for typescript in lsp-mode. Possible to use eslint with `lsp-format-buffer`?

I have both ts-ls and eslint backends enabled for typescript buffers and they both seem to work well for linting, prompting, etc. However, I would like lsp-format-buffer to use eslint, not ts-ls. How ...
xuhdev's user avatar
  • 1,921
2 votes
1 answer
199 views

How can I limit the amount of files watched by lsp-mode?

With lsp-mode, I'm getting Watching all the files in /foo would require adding watches to 3792 directories, so watching the repo may slow Emacs down. Do you want to watch all files in /foo? (y or n) n ...
Jason Hunter's user avatar
1 vote
0 answers
24 views

treemacs error window keeps growing in size

I recently started using lsp-treemacs and I mostly like it. It would be nice if it auto-jumped to the file for the current buffer, but I can work around that. However, the biggest complaint that I ...
Troy Daniels's user avatar
1 vote
0 answers
188 views

C++17 with LSP and Flycheck

lsp-mode is working correctly. flyecheck is working correctly, with the exception of regonizing some c++17 features. #include <map> std::map<int,int> magic; magic.try_emplace(1,1) // ...
Tiago Matos's user avatar
0 votes
0 answers
41 views

Why am I getting 100% cpu on "osemgrep lsp --experimental"?

I'm on NixOS and I frequently have to kill this process osemgrep lsp --experimental I don't even have that executable in my path; I have semgrep, though. I also can't find any reference to it in my ...
Jason Hunter's user avatar
0 votes
1 answer
371 views

Set up emacs LSP to also work with standalone files and scripts

I'm pretty new to emacs, and I wanted to setup an LSP with code completion for java and other languages there. I started out with java and made a simple configuration (use-package lsp-mode :hook (...
Maksat Rsymbetov's user avatar
0 votes
1 answer
165 views

View documentation of Java inside of emacs

I want to view Java documentation like https://docs.oracle.com/en/java/ inside emacs. I have tried lsp-java with lsp-ui but my setup wasn't enough.
Francesco Cadei's user avatar
2 votes
1 answer
506 views

How to list a source file's "structure" (e.g. list all the methods) with eglot/lsp?

There is a similar question here: https://superuser.com/questions/629090/emacs-displaying-list-of-subroutines-functions-classes-in-a-source-file But it was from 2013, way before LSP and eglot became ...
Lai Yu-Hsuan's user avatar
0 votes
1 answer
379 views

lsp function doesn't work

I installed lsp-mode and using pyright as its server. However, most of the lsp function wouldn't work. For example, If I do M-x lsp-find-definition, it'll return error message "Symbol's value as ...
ymu_quant's user avatar
0 votes
1 answer
985 views

lsp-mode can't register custom lsp client using with-eval-after-load

I am trying to use a custom lsp server. I place the following snippet in my init file: (with-eval-after-load 'lsp-mode (add-to-list 'lsp-language-id-configuration '(solidity-mode . "...
degen872's user avatar
0 votes
1 answer
156 views

PHP and LSP mode - code formatting?

I have setup web-mode and lsp mode for PHP programming in my config file. It is very minimal and flymake works perfectly. I am struggling to find a way to get code formatting to work. I was told that ...
Vinn's user avatar
  • 293
0 votes
1 answer
485 views

How to fix lsp-mode for Elisp?

I have this set in my init file: ;; build dependency tree for function (use-package lsp-mode :ensure t :hook ((clojure-mode . lsp) (clojurescript-mode . lsp) (prog-mode . ...
Pedro Delfino's user avatar
0 votes
0 answers
223 views

With lsp-ui, how can I have display warnings placed in the Echo Area

With lsp-ui, how can I force the warnings to be displayed in the Echo Area? I don't really like them as they are displayed now, on the right side of the code. I can turn them off (setq lsp-ui-sideline-...
Jason Hunter's user avatar
1 vote
0 answers
307 views

How to run JUnit tests with lsp-mode and dap-mode, without build tools like maven

I have a Guix profile in which I installed for a beginner's java class a java environment as minimal as possible: openjdk 17, java-junit (which is JUnit 4), emacs-lsp-java, and emacs-dap-mode. I ...
elyuku's user avatar
  • 102
0 votes
1 answer
98 views

Configure lsp-mode to start the python server when in snakemake major mode

I would like to know if it's possible to configure LSP mode to start the Python server when I work on a snakemake file (snakemake-mode), as I use heavily use Python in this mode also.
R-addict's user avatar
0 votes
0 answers
361 views

Show all the error inline in Emacs lsp-mode

I am an Emacs newbie transitioning from Neovim. In Neovim's built-in LSP client, I am able to see all the errors inline. Please notice how every error is displayed on the problematic line immediately ...
Refael Sheinker's user avatar
0 votes
1 answer
21 views

lsp-mode DataTips

In Visual Studio, DataTips is displayed on hovering over a variable, like info about type. Is this something which is included in LSP and can be viewed in lsp-mode? I don't use a mouse, so it would ...
Jason Hunter's user avatar
3 votes
2 answers
648 views

lsp-mode, Jump to Next Warning

In a C# lsp-mode buffer, when something is highlighted, is there a "jump to next warning or error" function? I don't see anything like lsp-next* or lsp-jump*. Any pointers?
Jason Hunter's user avatar
0 votes
1 answer
243 views

lsp-format-buffer, for C#, Indentation 2

What indentation setting does lsp-format-buffer look at?;) I've tried setting all kinds of variables, but it always indents c# to 4, instead of 2, which I want. Any pointers?;) EDIT1: I'm on onmisharp-...
Jason Hunter's user avatar
0 votes
1 answer
216 views

lsp-mode, Show Potential Fixes

In lsp-mode, is the "Show Potential Fixes equivalent to the one in Visual Studio? I have the following line in C# public static CloudStorageAccount ...
Jason Hunter's user avatar
0 votes
1 answer
627 views

Where does `lsp-mode` keep session state?

When opening source code files for the first time, lsp-mode asks whether to "import" the project or not. It looks like it saves the project information somewhere - where can I find that file ...
anon2328's user avatar
1 vote
2 answers
130 views

How can I find the face of the items in the headeline in lsp-mode?

Re-edited the answer for clarity Typically I would put my cursor over the text, and call M-x describe-face, but I can't do that with the headerline. In the above screenshot, I want to change the ...
suvayu's user avatar
  • 1,638
3 votes
0 answers
710 views

eglot + rust-analyzer: Failed to discover workspace

I've been having a really great experience w/ eglot for C++ development. I'm finding it a lot easier to use than lsp-mode (at least for C++). However, I'm running into an issue w/ both eglot (and lsp-...
Matt Messersmith's user avatar
3 votes
0 answers
97 views

lsp-mode's magic to prevent C-x 1 from working?

When I start emacs all functionality of frames works fine. I can split frame by two via "C-x 3", switch to it "C-x o", and then close other (left) frame via "C-x 1". But ...
user1244932's user avatar
0 votes
0 answers
273 views

lsp-mode shows LSP[Disconnected]

I am using Ubuntu linux. Here is a minimal version of my .emacs file: ;;---------------------------------------- ;; use-package ;;{{{ Set up package and use-package ;;---------------------------------...
Chris's user avatar
  • 1
0 votes
0 answers
74 views

Is there any way of making company show local classes inside a Java project?

I have a configuration for Java code on emacs that's the following: (use-package flycheck :ensure t :config (global-flycheck-mode)) (use-package company :ensure t :hook (after-init . global-...
raylight's user avatar
  • 237
0 votes
1 answer
815 views

Javascript LSP mode in Emacs (using typescript-language-server) uses inconsistent indentation between files

On the first file I created, I had tabs set to 4 spaces and wasn't using the LSP yet. Then I enabled the LSP, and on all subsequently created files tabs are 2 spaces, yet on the original file, it ...
Alexis Purslane's user avatar
0 votes
1 answer
221 views

jdtls failing to start for lsp-java after clearing .m2/repository

I have lsp-java set up to use jdtls. It had been working fairly well. For unrelated reasons, I deleted my ~/.m2/repository and then reran mvn install to repopulate the parts of it that I need. Now ...
Troy Daniels's user avatar
1 vote
0 answers
146 views

Emacs LSP server inside docker container hanging on startup

I'm trying to use emacs lsp and pyright server with docker. I'm trying to use custom containers as explained here. I've managed to setup this super simple test project. The lsp server starts, however ...
Freder's user avatar
  • 11
0 votes
1 answer
283 views

How to setup maven for lsp-java

I need to import gurobi.jar to my project to correctly view the flycheck's errors. I have read Maven in 5 Minutes and How to add local jar files to a Maven project? but I am still not able to ...
Francesco Cadei's user avatar
0 votes
0 answers
379 views

How to install and setup lsp servers for vanilla emacs

I wanted to install lsp-servers in emacs to allow my transition from VS-Code easier, however, when I tried to install lsp-mode from MELPA, I got the following issue: https://melpa.org/packages/...
Saurav Chittal's user avatar
2 votes
0 answers
495 views

tell lsp-mode not to look for pyright

I'm trying to add type checking and code completion for python. I'm using Emacs 28.2. I installed pyright using brew (brew install pyright) and when I open a python file, I see: Unable to find server ...
David J.'s user avatar
  • 163
0 votes
1 answer
71 views

Java-LSP freezes from Flymake error

I am very new to Java and have only been using an lsp for the past month or two. I have done some projects in Go, Python and Rust with lsp-mode and haven't had any problems. Now that I have been ...
greenbug's user avatar
1 vote
1 answer
547 views

How to autocomplete dynamically created objects in python code?

Is anybody able to get suggestions after typing x. using code below? E.g. name import json from types import SimpleNamespace data = '{"name": "John Smith", "hometown": {&...
jjk's user avatar
  • 744
1 vote
0 answers
169 views

Flymake: how can I modify/ignore syntax and styling rules?

This question was asked before here, but the solution doesn't work. It could be because I am not restarting flymake correctly. The question is: how to have flymake ignore certain errors and warnings? ...
Schach21's user avatar
0 votes
0 answers
174 views

lsp-mode, Hello World in C#

I get some weird errors for just the most simple Hello World in C#, with lsp-mode using System; namespace test { public class Driver { public static void Main() { ...
Jason Hunter's user avatar