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
1 answer
34 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
28 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
21 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
2 votes
1 answer
115 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
26 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
17 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
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
0 votes
1 answer
28 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
182 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
98 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
0 answers
11 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
198 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
128 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
685 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
309 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
56 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
272 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
73 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
144 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
315 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
  • 339
0 votes
1 answer
662 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
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
1 vote
1 answer
428 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
231 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
1 vote
0 answers
108 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
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
0 votes
2 answers
138 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
183 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
  • 619
0 votes
1 answer
411 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
329 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
  • 619
1 vote
1 answer
1k 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
  • 619
0 votes
2 answers
55 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
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
0 votes
1 answer
712 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
609 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
39 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
298 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
67 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,340
0 votes
1 answer
281 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,340
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
39 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
1 vote
1 answer
404 views

indent-region does not respect my c-mode style

This is my C style: (defconst mira-c-style '((c-basic-offset . 4) (indent-tabs-mode . nil) (tab-width . 7) (c-comment-only-line-offset . (0 . 0)) (c-lineup-C-comments . 0) (c-...
Gauthier's user avatar
  • 499
0 votes
1 answer
371 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 ...
Vince W.'s user avatar
  • 395
0 votes
0 answers
864 views

"Error running timer file missing doing vfork" Emacs dap debug C++

I've c++ cmake project beginning-cpp20. The project structure as as below - $ tree . . ├── CMakeLists.txt ├── launch.json └── meetingcpp.cpp The contents of CMakeLists.txt is - cmake_minimum_required(...
Rajkumar Natarajan's user avatar
0 votes
1 answer
228 views

Is it possible to use LSP for font-lock or indentation?

I'm writing C++ and running into problems with font-lock-mode often getting confused by more obscure language features (e.g., operator""_ud). I also find that indentation doesn't work very ...
user3188445's user avatar
0 votes
1 answer
60 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). ...
Kolt Penny's user avatar
1 vote
1 answer
2k views

Unable to setup lsp-mode with lsp-pyright

I'm using Emacs 28.1 on macOS 11.6.6 (installed with brew) and want to setup a Python IDE with lsp-mode and lsp-pyright. My (not full) init.el looks like this (LSP and Python setups are at the bottom ...
user avatar