Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [lsp]

This tag is to be used for questions related to the Emacs implementations of the client-side of the Language Server Protocol. These implementations aim to provide an IDE-like experience, by providing optional integration with many popular Emacs packages.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

While editing C++ code, using lsp, how do I display function prototypes?

I am using emacs with clangd lsp setup. In the status bar, function prototypes are displayed as I enter code, which is very convenient. However, sometimes there are different versions of a function ...
0 votes
1 answer
40 views

How can I emulate the eclipse jdt open type action in emacs lsp-java?

In eclipse jdt, there's the open-type command, which opens a window and you start typing the name of a type. While typing, the list of candidates are shown in that window is filtered dynamically and ...
0 votes
1 answer
408 views

python linting not working with eglot

System: Mac OS 12.5 Emacs 28.1 from homebrew Python 3.9.13 using a virtual env python-lsp-server For some reason my linting, with error highlighting is not working with Python using eglot. In the ...
0 votes
1 answer
17 views

Does lsp-find-references have some semantic understanding?

Does lsp-find-references have some semantic understanding? If I lsp-find-references on a C# method called Initialize(), it finds 500+ references in my large code base. Surely, they are not all the ...
0 votes
0 answers
11 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 |-[-] ...
0 votes
1 answer
91 views

How can I open lsp-find-references using split-window-vertically?

I have new windows be opened in a split-window-horizontally way, but I want this specific lsp-find-references to be opened with split-window-vertically. Is there any way to set this preference for ...
0 votes
1 answer
575 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
0 answers
6 views

Configuring lsp-java jdt.ls to write its files outside the project

Is there any configuration in lsp-java to setup jdt.ls to not create .project, .settings, bin etc files at the root of the repo being built? I'd like to have those setup instead in the workspace ...
1 vote
1 answer
427 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
1 answer
788 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
1 answer
68 views

How to run a test in LSP with a key binding?

In lsp-ui-mode, test appears as a clickable UI element. Is there a keybinding to run a test without using the mouse?
0 votes
1 answer
58 views

Toggling off all settings in python and julia to get bare setup

since recently I am using LSP for python, tex and julia on macos with spacemacs develop. To some extend this is great, but it is something awefully slow using a gui... and it seems that it is not only ...
0 votes
2 answers
56 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 ...
1 vote
1 answer
84 views

Emacs hide some of the documents in Typescript

I'm using Doom emacs. I developing an App in Typescript. I just encounter a strange behavior of Emacs that compact the description of lsp-buffer like in the image below. Does anyone know how to ...
2 votes
2 answers
144 views

LaTeX equation numbers with Emacs

Equation labels in the .tex document are \label{eq:3}, e.g., which is (7) on the output pdf-document (say); \eqref{eq:3} references this equation. Typing <C-x-o> at point (| in the following ...
0 votes
0 answers
42 views

Eglot toggle flymake diagnostics with keyboard shortcut

I've successfully got eglot working, and I love using it for things like xref in my rust projects. As I'm writing code, I don't like having diagnostics pop up as I'm typing, but sometimes I'd like to ...
0 votes
2 answers
167 views

lsp mode with mysql

Can lsp mode be used with a mysql server. I've setup lsp for some languages but cannot succeed with mysql. So far to connect I use emacsql package with a sql-connection-alist defined. This is what I ...
0 votes
1 answer
157 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.
0 votes
1 answer
698 views

How to disable lsp-clangd server if there is no dominating compile_commands.json

I've got lsp mode, projectile mode, and flymake modes, working pleasantly for C++ running using a clangd language server. However, I have many, many directories that (at least for now) do not have ...
0 votes
1 answer
65 views

How to add an external library to java lsp

I am working on a simple java program, it uses a jason.jar and junit.*.jar (for testing). I usually run the tests through the command line; i never run my programs through and Editor/IDE, I always use ...
0 votes
1 answer
68 views

Remote LSP unable to find texlab server

I need to setup lsp to work on LaTeX file in a remote machine. I installed texlab both in local and in remote machine and add the path to the remote texlab in my emacs (spacemacs) init file as follow: ...
0 votes
1 answer
892 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 ...
0 votes
1 answer
37 views

company-mode: static sources overwrites LSP

I had a short experience with emacs a few years ago (spacemacs), and now I want to get back to it seriously. Within literally 3 days, I built my own config that turned regular emacs into a full-...
0 votes
1 answer
63 views

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

I'm trying to use Golang with LSP in Emacs 27.2 (Fedora 35) but whenever I run M-x lsp-mode it shows as disconnected and when I try to run M-x lsp it shows the Lisp error: (void-function -compose). ...
1 vote
1 answer
2k views

how to configure Eglot over TRAMP?

On my laptop, I'm using eglot (sometimes lsp-mode) with pyright language server. But Now I'm trying to write some python code on Raspberry Pi (using ssh/TRAMP, in local network, from my laptop). I ...
0 votes
1 answer
436 views

lsp-mode + rust_analyzer: How to add workspace directory automatically without requiring .git directories next to the Cargo.toml file?

I've set up lsp mode with rust using https://robert.kra.hn/posts/rust-emacs-setup/ mostly successfully. I can create a new hello-world directory inside /tmp just fine. Opening up main.rs inside that ...
0 votes
1 answer
316 views

Unable to import project with lsp/lsp-mode, persistent completing-read popup message

I recently had to redo my development setup, I'm using Clojure and clojure-lsp as lsp server, and every time I open a project file I get the message `"x" file is not part of any project"...
0 votes
0 answers
18 views

Is there a way to italicize cpp's methods and fields?

When I use vscode, I find that CPP's in-class fields are italicized and local variables are normalized, which allows me to easily distinguish between them For example, I can clearly tell that thread ...
0 votes
0 answers
61 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 ...
0 votes
1 answer
33 views

How to get rid of `> run | debug` clickable text?

I want to get rid of the arrow and the run/debug clickable option (I'm fine with my shortcuts, I never use the mouse and it just gets in the way) but I've no idea what it's called and googling various ...
0 votes
1 answer
342 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 (...
0 votes
1 answer
770 views

Type / Annotation hints with lsp. Working example?

Can somebody who has made type hints work give the init.el example that shows how? And provide description of how it works for you inside Emacs? I gather that some people have successfully moved from ...
2 votes
1 answer
660 views

How to run a test at point using lsp?

I'm using https://github.com/python-lsp/python-lsp-server https://github.com/emacs-lsp/lsp-mode https://emacs-lsp.github.io/lsp-mode/ https://microsoft.github.io/language-server-protocol/implementors/...
2 votes
1 answer
470 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 ...
0 votes
1 answer
940 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 . "...
0 votes
0 answers
16 views

Weird behaviour on emacs with running django server in terminal

something weird is going on in my 'emacs-IDE'. I am editing some javascript files in a django project using spacemacs. Some tools I use are treemacs and lsp-mode. In order to test my code I call up a ...
0 votes
1 answer
158 views

Can someone help me with lsp C++20 features recognition?

Lsp clangd does not recognise c++20 features in my Emacs. I use flycheck and it highlights something as import <iostream> std::format is not supported either and so on. Can someone tell me how ...
0 votes
1 answer
275 views

How does emacs/eglot decide which syntax element to highlight and how could I change it?

For example, I'm writing a Lua file. I noticed that the table keys are not highlighted: I'd like to make the table keys in a different color than values, like what Emacs does for YAML: But I don't ...
0 votes
1 answer
453 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 . ...
7 votes
3 answers
800 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 ...
0 votes
1 answer
70 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 ...
0 votes
0 answers
351 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 ...
0 votes
0 answers
89 views

How to get LSP like formatting in Org Mode?

Here is a scenario I use constantly in Rust development: LSP is always on. I call the LSP feature "format current buffer" (or whatever it's called). The LSP returns the buffer formatted (...
1 vote
0 answers
191 views

emacs workspace/executeCommand with `vscode.java.resolveMainClass` failed

I'm trying to debug java in emacs.I'm running the command M-x dap-java-debug in emacs and I'm getting below error. emacs workspace/executeCommand with vscode.java.resolveMainClass failed. (error &...
6 votes
2 answers
803 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-...
0 votes
1 answer
796 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 ...
1 vote
2 answers
1k views

How to enable inlay hint in Eglot + Clangd

Using Emacs 30, eglot is built in emacs and now it supports inlay hints capability of LSPs. Now I want to use clangd with eglot with inlay hints enabled, but it seems that it does not work out of the ...
1 vote
0 answers
140 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 ...
1 vote
1 answer
525 views

Can I use a local language server for remote files?

Is it possible to have eglot use a language server running on my local machine to work on files on the remote machine? I'm trying to edit TypeScript files on a remote server. I can visit the file just ...
0 votes
1 answer
278 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 ...