Questions tagged [lsp-mode]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
22 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
  • 242
1 vote
1 answer
54 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
  • 242
0 votes
2 answers
23 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
  • 497
-1 votes
1 answer
43 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
24 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
43 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
72 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
  • 335
0 votes
0 answers
35 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,899
2 votes
0 answers
76 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
16 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
88 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
24 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
183 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
99 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
0 votes
1 answer
255 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
210 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
693 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
128 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
314 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
135 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
219 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
  • 77
0 votes
1 answer
76 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
273 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
0 answers
96 views

lsp-org, lsp-format-buffer

In a csharp org-babel block, is lsp-format-buffer supposed to work? #+begin_src csharp :tangle "11dde4eb-97fe-c7a0-78b7-b38c1b4a1e02.cs" System.Console.WriteLine("Hello World..."); ...
Jason Hunter's user avatar
0 votes
1 answer
18 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
2 votes
2 answers
439 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
173 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
108 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
432 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
97 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,608
2 votes
0 answers
551 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
2 votes
0 answers
71 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
233 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
72 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
  • 217
0 votes
1 answer
665 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
168 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
0 votes
0 answers
485 views

lsp-format-buffer :: No formatting changes provided

I'm trying to indent a C# file, but when I lsp-format-buffer, it just says No formatting changes provided ..in the echo area. Any way to figure out what that means?;)
Jason Hunter's user avatar
1 vote
0 answers
113 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
232 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
285 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
440 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
58 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 ...
Hercislife's user avatar
1 vote
1 answer
439 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
  • 721
1 vote
0 answers
152 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
158 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
3 votes
1 answer
612 views

How to make connection to arduino LSP server?

I came across this repo arduino-language-server. My question is how to make it connect it to my emacs? (Maybe more generally, how to connect to any other LSP-server?) Currently I've installed ...
Garid's user avatar
  • 619
2 votes
1 answer
37 views

How do I find out what package is adding red boxes to my source code?

I have this piece of ruby code: def open(...) local_path.open(...) end and the first two lines have red boxes around them and when I hover over either one it says "syntax error, ...
pedz's user avatar
  • 375
1 vote
2 answers
134 views

How do I stop lsp-mode from re-indenting my comments after a newline

I just installed lsp-mode for use with C++. It's reformatting my comments as I type. For example, if I have a doxygen comment like this: /// Blah blah blah ... blah blah the end. [cursor here] /// ...
Rob N's user avatar
  • 607
0 votes
0 answers
70 views

lsp-pyright defer init until a .py file is open

Hey guys i'm improving my startup, Emacs version 28.2. I did a benchmark on init and I noticed that the thing that takes most of the time is lsp-pyright. That initializes lsp-mode. But I don't ...
Nico Stirnemann's user avatar
0 votes
1 answer
714 views

How to find interface implementations with `gopls` and `lsp-mode`?

While running gopls and lsp-mode on a Golang project, is there a way to list all implementations of an interface's function? When invoked on a function name, xref-find-definition jumps inside the ...
anon2328's user avatar