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 ...
user52366's user avatar
  • 141
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 ...
Jason Hunter's user avatar
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 |-[-] ...
Jenia Ivanov's user avatar
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 ...
benleis's user avatar
  • 21
0 votes
0 answers
41 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 ...
Wilduck's user avatar
  • 303
0 votes
1 answer
67 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?
andreoss's user avatar
0 votes
1 answer
36 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-...
A.J.'s user avatar
  • 1
0 votes
1 answer
66 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: ...
Riccardo's user avatar
  • 133
0 votes
2 answers
54 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
  • 507
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 ...
Alois Pichler's user avatar
0 votes
1 answer
64 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 ...
Hackerman's user avatar
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 ...
Thysrael's user avatar
0 votes
0 answers
58 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
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 ...
John Graham's user avatar
0 votes
1 answer
336 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
156 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
467 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
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 ...
mor3dr3ad's user avatar
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 ...
Lai Yu-Hsuan's user avatar
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 ...
weuoimi's user avatar
0 votes
1 answer
934 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
449 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
1 answer
89 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 ...
Jason Hunter's user avatar
0 votes
0 answers
350 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
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 (...
Refael Sheinker's user avatar
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 &...
Rajkumar Natarajan's user avatar
0 votes
1 answer
432 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 ...
bgoodr's user avatar
  • 341
0 votes
1 answer
790 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
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 ...
Nixmd's user avatar
  • 141
1 vote
0 answers
139 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
1 vote
1 answer
523 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 ...
Evan Davis's user avatar
0 votes
1 answer
277 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
353 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
1 vote
0 answers
120 views

How to add a secondary flycheck checker to lsp-ui

Because the lsp package sets the default checker to lsp (chaining not supported) I am using this WA to chain another checker to lsp: (defvar-local my/flycheck-local-cache nil) (defun my/flycheck-...
Mihai's user avatar
  • 143
0 votes
1 answer
68 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
0 votes
2 answers
164 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 ...
Michel Lecomte's user avatar
0 votes
1 answer
207 views

How to disable LSP-bridge's path-completion on certain directories?

Goal: Disable LSP-Bridge's path-completion on /bin/ directory. But let it be work on other directories. (I really like it) Why: When I edit some small shell scripts, path-completion feature hangs ...
Garid's user avatar
  • 641
0 votes
1 answer
477 views

Company-dabbrev does not work on eglot

I use emacs 28/29 on windows. this is my config. (use-package company :ensure t :pin gnu :init (global-company-mode) :config (setq company-backends '(company-dabbrev) company-idle-delay ...
Bergfried's user avatar
0 votes
1 answer
365 views

How to set eglot for wasm and go-lang?

I'm just trying to learn Go Language, and WASM with Go-language. My emacs setup (eglot + gopls) works completely fine when I'm working on just go scripts. However, When I trying to learn wasm+go, ...
Garid's user avatar
  • 641
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 ...
Garid's user avatar
  • 641
0 votes
2 answers
59 views

Store output of xref-find-apropos in a variable within elisp code

Is it possible to extract the results returned by xref-find-apropos to a variable within elisp code? In particular, I want to get all files names where the found symbol occurs. So what I want is ...
Evgenii.Balai's user avatar
3 votes
1 answer
688 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
  • 641
0 votes
1 answer
883 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
0 votes
1 answer
762 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 ...
pauljohn32's user avatar
0 votes
0 answers
46 views

lsp failing while requiring uninstalled packages

I have (I think) installed lsp and lsp-java. My java mode hook starts with (message "Running my-java-mode-hook") (auto-revert-mode) ;; Set up lsp (require 'lsp-mode) (require '...
Troy Daniels's user avatar
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"...
stigma's user avatar
  • 113
0 votes
0 answers
76 views

How can I blacklist a folder but not its subfolders in lsp?

I am using lsp-mode and want to blacklist specific folders, such as ~, but not their subfolders. The way I do it, from following answer https://emacs.stackexchange.com/a/73411/18414: (setq lsp-...
alper's user avatar
  • 1,390
0 votes
1 answer
309 views

How can I add home folder (`~`) into lsp-workspace-blacklist

I want to add user's home folder (~) into the lsp-workspace-blacklist in the init file. Is it possible to achieve this in the init file? I have tried (lsp-project-blacklist (quote ("~"))) ...
alper's user avatar
  • 1,390
1 vote
1 answer
1k views

Problem debugging on dap-mode

I am new to emacs and I was following this tutorial to configure lsp-mode: https://emacs-lsp.github.io/lsp-mode/tutorials/CPP-guide/ But dap-debug does not work. Everytime I try to debug, it doesn't ...
XStein17's user avatar
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 ...
zedoo's user avatar
  • 103