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
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
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
1 vote
0 answers
288 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
0 votes
1 answer
2k views

lsp mode problems: not enabled, and clangd include file not found

I am trying to configure lsp-mode with clangd using emacs 28.1 (compiled from source), and encounter two problems that I do not manage to solve: First, `lsp-mode` is not started automatically when I ...
user52366's user avatar
  • 131
1 vote
1 answer
187 views

add sonarlint in spacemacs

I've seen a sonarlint config for emacs using lsp in this link of github, and I've tried to install this without success. I've already installed lsp-sonarlint using MELPA and I've added this in ...
chavalife17's user avatar
0 votes
0 answers
130 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
193 views

LSP: Bad JSON object: ":", 97

I am using gccemacs, where emacs is build with --with-native-compilation configuration option. After compilation is done,when I run M-x lsp: I start to have following error: Bad JSON object: ":&...
alper's user avatar
  • 1,350
1 vote
1 answer
902 views

How can I list folder names that are added into lsp-workspace?

I am able to add my repo into lsp-workspace using: lsp-workspace-folders-add. When I open a file, if its root repo is located in the lsp-workspace, in the minibuffer I see following message: LSP :: ...
alper's user avatar
  • 1,350
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,012
1 vote
1 answer
82 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
0 votes
1 answer
664 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
  • 339
2 votes
1 answer
604 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/...
Mittenchops's user avatar
1 vote
0 answers
532 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
5 votes
2 answers
3k views

How to uninstall lsp servers

How do you uninstall lsp servers. I see the functions to update and install, but none to remove or uninstall. I am using spacemacs, but an answer for vanilla emacs still helps.
mcp's user avatar
  • 546
0 votes
1 answer
202 views

dap-mode cpptools gives error `VTerm needs module support`

I am trying to use dap-mode to debug my C++ code. My debug template looks like: (dap-register-debug-template "cpptools::Run Configuration" (list :type "cppdbg" :request ...
Lucas Myers's user avatar
1 vote
0 answers
265 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
0 votes
0 answers
187 views

How to whitelist a directory that was previously blacklisted in pylsp

I think I accidentally blacklisted a directory. More specifically myproject ├── test.py ├── folder1 ├── folder2 └── ... I had that and opened test.py then pylsp gave me the option to create/import a ...
Schach21's user avatar
4 votes
0 answers
543 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
0 votes
1 answer
392 views

How can I apply `noqa` in order to ignore warning messages when lsp-mode is enabled

I am trying to ignore flycheck warning messages, when lsp-mode for the python-mode is on. I have tried ["# noqa", "# NOQA", "# flake8: noqa", "# type: ignore"] ...
alper's user avatar
  • 1,350
1 vote
0 answers
142 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
0 votes
1 answer
305 views

Disabling lsp-mode's autocomplete only for some languages

I am on Emacs 27.2 configured with the latest commit of Spacemacs, develop branch. I have both ocaml and lsp layer enabled. Sadly, I find lsp-mode's auto-completion with the ocaml-lsp too slow to use, ...
Namudon'tdie's user avatar
0 votes
1 answer
317 views

lsp-rust-analyzer ignores edition value in Cargo.toml

When talking about Emacs configuration, the rust-analyzer manual mentions [...] this excellent guide from @rksm. Which I followed to good effect, in particular: (use-package lsp-mode :commands ...
Chen Levy's user avatar
  • 385
1 vote
0 answers
286 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
0 votes
3 answers
874 views

emacs stalling when looking up definitions with lsp-mode and gopls

I'm using lsp-mode as lsp client and gopls as lsp backend in order to lookup function and variable definitions in go projects. On a given large repository (kubernetes) that I recently wiped and cloned ...
Ricky Robinson's user avatar
0 votes
1 answer
416 views

unexpected "Visit tags table (default TAGS)" prompt when looking up definitions with lsp-mode and gopls

I'm using company-mode with lsp-mode as lsp client and gopls as lsp backend in order to lookup function and variable definitions in go projects. On some repositories, when I want to lookup a ...
Ricky Robinson's user avatar
1 vote
1 answer
668 views

Snippets aren't working emacs-lsp / company-mode

For whatever reason, snippets aren't working. I am getting the placeholders but I cannot navigate between them. This is the type of snippet completion that I am getting: for ${1:index}, ${2:value} in ...
Cade's user avatar
  • 21
0 votes
1 answer
2k views

How to ignore specific flycheck warning messages for Python in lsp-mode?

My goal is to configure lsp in order to ignore warning messages for flycheck in Python version. When lsp is not in use, flycheck reads from my ~/.pylintrc file in order to ignore warning messsages. ...
alper's user avatar
  • 1,350
2 votes
0 answers
425 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
6 votes
2 answers
759 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-...
Jouni K. Seppänen's user avatar
3 votes
3 answers
939 views

How can I disable lsp-headerline?

I'm using centaur tabs, and when lsp-headerline enables my tabs hides. I want to disable that headerline using lsp-headerline-bradcrumb-mode in a hook (use-package lsp-mode :commands (lsp lsp-...
Paolo Donato Navarro's user avatar
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
2 votes
1 answer
142 views

Is it possible to suppress `LSP :: Connected to [pyls:N].` message on minibuffer?

When I open a Python file I keep seeing LSP :: Connected to [pyls:N] message in the minibuffer. How can I suppress it? Since I know I have enabled lsp, I don't want to see that message always whenever ...
alper's user avatar
  • 1,350
2 votes
0 answers
690 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,350
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 ...
Fabian's user avatar
  • 65
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
2 votes
1 answer
987 views

How to configure lsp-cmake lsp server in vanilla emacs

I want to setup lsp-cmake lsp server in my vanilla emacs. I just installed lsp server using pip install cmake-language-server. I don't know how to configure in my emacs init.el to use the lsp server. ...
Rajkumar Natarajan's user avatar
1 vote
1 answer
759 views

my rust analyzer don't work on emacs 27

I recently installed the latest version of emacs and Rust-analyzer, and downloaded the lsp-mode package as well, but when I activate the rust-analyzer with the "lsp" command it simply ...
user31659's user avatar
7 votes
3 answers
753 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 ...
Pieter Breed's user avatar
2 votes
1 answer
320 views

How to remove LSP <header-line>?

I'm pretty much emacs noob. I've been tinkering in spacemacs for around a month now and got it set up pretty much how I like it. But since I updated it, header line that appears when I open a project ...
Rasko Vučinić's user avatar
2 votes
0 answers
452 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
0 votes
1 answer
165 views

How can I invoke Flutter "Context commands" interactively (from lsp-dart)

I was beyond stoked to discover how complete Flutter support is in Emacs these days thanks to the seemingly polished lsp-dart (featured prominently in the official "get started" docs for ...
mgalgs's user avatar
  • 474
1 vote
2 answers
1k views

How to disable on-the-fly diagnostics in eglot?

How can I disable any sort of on-the-fly diagnostics in eglot? This does not seem to be possible by customizing eglot-ignored-server-capabilites. Disabling flymake-mode using a major-mode-hook also ...
Florian's user avatar
  • 241
1 vote
1 answer
418 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
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
0 votes
1 answer
565 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 ...
Rajkumar Natarajan's user avatar
1 vote
1 answer
85 views

How to pass the current scopes function symbol as an argument to an elisp function

I am trying to create an org-capture template which works with yankpad and yasnippets to such that if I am working with some c code like this: example.c static int somefunc(int a) { if (a ==5) { ...
Reginald Marr's user avatar
10 votes
1 answer
13k views

lsp project root

I just switched to using lsp for my C++ and Python IDE needs. However, I am running into a constant issue where Python and C++ files have the wrong root, as reported by (lsp-workspace-root). The root ...
Tohiko's user avatar
  • 1,649
1 vote
1 answer
170 views

Use helm in specific modes and not for other buffers in different mode

I recently started using lsp-java and one of the packages it suggests is helm. The suggested changes to the .emacs file to do this is: (use-package helm-lsp) (use-package helm :config (helm-mode)) ...
Noah's user avatar
  • 121
1 vote
0 answers
210 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
274 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