Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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.

53 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
2k views

How do I make lsp-mode ignore a node_modules folder + others?

I want to know how to make lsp-mode ignore a node_modules folder (along with say, folder asdf and temp). This is what I have: (setq lsp-file-watch-ignored (rx (or "node_modules" "asdf&...
eoyath's user avatar
  • 61
4 votes
0 answers
574 views

How to use dap-mode with TypeScript?

https://github.com/emacs-lsp/dap-mode provides DAP debugging for various languages (along the same lines as LSP does for completion, formatting, etc). How can I use that to debug programs written in ...
Croad Langshan's user avatar
3 votes
0 answers
1k views

Company: backend company-capf error

I'm using emacs-lsp with company-capf. While editing an elisp file, it works fine. However, once I run eval-buffer, I get the following error when trying to use completion: Company: backend company-...
twlscnds's user avatar
  • 131
2 votes
0 answers
436 views

Emacs and ASP.Net Razor Pages

I am trying to get .razor and .cshtml pages working in Emacs. My config is Doom Emacs with (csharp +lsp +dotnet). No issues with the C# code, that all works fine other than absurd refactoring ...
jgnovak-dev's user avatar
2 votes
0 answers
715 views

`lsp` does not start on python-mode-hook

I am using lsp under Python.lsp does not start when a Python file is opened, I have to do M-x lsp for each file I open. Also when I switch from find-file to another file I have to do M-x lsp all over ...
alper's user avatar
  • 1,380
2 votes
0 answers
465 views

Enable LSP in spacemacs only for certain languages?

The spacemacs LSP layer documentation says: Enabling this layer will set the used backend for all supported languages to LSP unless you explicitly set a specific backend for the language. I find ...
Croad Langshan's user avatar
2 votes
0 answers
2k views

Debugging with dap-mode for python and taking user input

I am trying to make dap-mode for python working on spacemacs. For the most part I was able to get it working, but I am having issues taking in input on the CLI def main(): a = input(">") The ...
LLL's user avatar
  • 21
1 vote
0 answers
187 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
1 vote
0 answers
137 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
0 answers
119 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
1 vote
0 answers
309 views

pylsp times out over TRAMP

I'm (unfortunately and against my will) using Windows 10 running Emacs 28.1 attempting to connect to a remote Ubuntu machine via TRAMP (currently this happens to be WSL but there are other Linux ...
Connor Fuhrman's user avatar
1 vote
0 answers
25 views

Scala metals: "Expression type:" appears under the modeline instead of type information

I've installed metals according to the instructions here https://scalameta.org/metals/docs/editors/emacs/ and it mostly works (go-to-definition, etc) but there are unfortunate times when instead of ...
irregular's user avatar
  • 1,022
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 ...
Chop TRAN's user avatar
  • 111
1 vote
0 answers
560 views

Using typescript-language-server through tramp can't find servers for typescript-mode

I am trying to work remotely on a typescript project, with lsp-mode and tramp, through SSH. I followed the documentation on lsp-mode web page to set up a remote client. Here is my config: (use-package ...
meguli's user avatar
  • 377
1 vote
0 answers
279 views

Scrolling through rust-lsp suggestions is very slow. How to go about debugging this?

I'm trying to set up Emacs with rust-lsp ( following this guide). The suggestions from the rust-analyzer are being picked up as you can see in the screenshot. But when I attempt to scroll through them ...
rtviii's user avatar
  • 113
1 vote
0 answers
143 views

Why does lsp-haskell format some projects and not others?

This is the message I get when I use lsp to format the current project: lsp-request: No plugin enabled for STextDocumentFormatting, available: [] And then on another project: LSP :: Applying 22 edits ...
dmvianna's user avatar
  • 392
1 vote
0 answers
291 views

How to configure emacs for use with yarn 3?

The yarn package manager suggests a snippet of elisp to use: Create a .dir-locals.el with the following content to enable Flycheck and LSP support and make sure LSP is loaded after local variables ...
gburnett's user avatar
  • 165
1 vote
0 answers
164 views

How to install mspyls without internet?

I would like to install mspyls language server on my work machine that does not have access to an internet. I am able to transfer files over to the work machine via thumb drive. Is there a way for me ...
Tian's user avatar
  • 288
1 vote
1 answer
426 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: ...
Rajkumar Natarajan's user avatar
1 vote
0 answers
218 views

How to suppress LSP message from flickering the minibuffer height?

I am facing an annoying problem which makes working very unpleasant: I am using Go LSP (backed by gopls) on Emacs 26.3 (9.0) on Mac. While working on Go code often a message of the form LSP :: ...
Volker's user avatar
  • 111
1 vote
0 answers
276 views

LSP sometimes working with Metals, sometimes spamming "the request has been cancelled"

I have Spacemacs configured to use Metals as an LSP backend for Scala development, i.e. my dotspacemacs-configuration-layers includes: (scala :variables scala-backend 'scala-metals ...
Keith Pinson's user avatar
1 vote
1 answer
784 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 ...
Karthik's user avatar
  • 31
0 votes
0 answers
19 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
16 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
5 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
39 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
62 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
52 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
0 votes
1 answer
60 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
57 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,911
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
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
87 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
346 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
88 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
0 votes
1 answer
424 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
0 answers
351 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
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
871 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
0 answers
45 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
314 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,380
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
0 votes
1 answer
406 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
  • 415
0 votes
0 answers
967 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
61 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
0 votes
0 answers
131 views

Lsp-mode getting weird error trying to M-x lsp

(See updates at end of question) I installed lsp-mode for php and I also installed intelephense (so the command intelephense is available in the terminal) I can open a PHP file and do M-x lsp-mode and ...
cheryllium's user avatar
0 votes
1 answer
693 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 ...
bgoodr's user avatar
  • 341