Questions tagged [lsp-mode]

lsp-mode serves as an Emacs client for the Language Server Protocol.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 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
1 answer
37 views

lsp function doesn't work

I installed lsp-mode and using pyright as its server. However, most of the lsp function wouldn't work. For example, If I do M-x lsp-find-definition, it'll return error message "Symbol's value as ...
ymu_quant's user avatar
0 votes
1 answer
75 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
37 views

PHP and LSP mode - code formatting?

I have setup web-mode and lsp mode for PHP programming in my config file. It is very minimal and flymake works perfectly. I am struggling to find a way to get code formatting to work. I was told that ...
Vinn's user avatar
  • 283
0 votes
1 answer
50 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
0 answers
42 views

With lsp-ui, how can I have display warnings placed in the Echo Area

With lsp-ui, how can I force the warnings to be displayed in the Echo Area? I don't really like them as they are displayed now, on the right side of the code. I can turn them off (setq lsp-ui-sideline-...
Jason Hunter's user avatar
0 votes
0 answers
58 views

How to run JUnit tests with lsp-mode and dap-mode, without build tools like maven

I have a Guix profile in which I installed for a beginner's java class a java environment as minimal as possible: openjdk 17, java-junit (which is JUnit 4), emacs-lsp-java, and emacs-dap-mode. I ...
elyuku's user avatar
  • 67
0 votes
1 answer
35 views

Configure lsp-mode to start the python server when in snakemake major mode

I would like to know if it's possible to configure LSP mode to start the Python server when I work on a snakemake file (snakemake-mode), as I use heavily use Python in this mode also.
R-addict's user avatar
0 votes
0 answers
105 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
52 views

lsp-org, lsp-format-buffer

In a csharp org-babel block, is lsp-format-buffer supposed to work? #+begin_src csharp :tangle "11dde4eb-97fe-c7a0-78b7-b38c1b4a1e02.cs" System.Console.WriteLine("Hello World..."); ...
Jason Hunter's user avatar
0 votes
1 answer
14 views

lsp-mode DataTips

In Visual Studio, DataTips is displayed on hovering over a variable, like info about type. Is this something which is included in LSP and can be viewed in lsp-mode? I don't use a mouse, so it would ...
Jason Hunter's user avatar
0 votes
2 answers
135 views

lsp-mode, Jump to Next Warning

In a C# lsp-mode buffer, when something is highlighted, is there a "jump to next warning or error" function? I don't see anything like lsp-next* or lsp-jump*. Any pointers?
Jason Hunter's user avatar
0 votes
1 answer
56 views

lsp-format-buffer, for C#, Indentation 2

What indentation setting does lsp-format-buffer look at?;) I've tried setting all kinds of variables, but it always indents c# to 4, instead of 2, which I want. Any pointers?;)
Jason Hunter's user avatar
0 votes
1 answer
45 views

lsp-mode, Show Potential Fixes

In lsp-mode, is the "Show Potential Fixes equivalent to the one in Visual Studio? I have the following line in C# public static CloudStorageAccount ...
Jason Hunter's user avatar
0 votes
1 answer
111 views

Where does `lsp-mode` keep session state?

When opening source code files for the first time, lsp-mode asks whether to "import" the project or not. It looks like it saves the project information somewhere - where can I find that file ...
anon2328's user avatar
1 vote
2 answers
54 views

How can I find the face of the items in the headeline in lsp-mode?

Re-edited the answer for clarity Typically I would put my cursor over the text, and call M-x describe-face, but I can't do that with the headerline. In the above screenshot, I want to change the ...
suvayu's user avatar
  • 1,568
1 vote
0 answers
300 views

eglot + rust-analyzer: Failed to discover workspace

I've been having a really great experience w/ eglot for C++ development. I'm finding it a lot easier to use than lsp-mode (at least for C++). However, I'm running into an issue w/ both eglot (and lsp-...
Matt Messersmith's user avatar
1 vote
0 answers
48 views

lsp-mode's magic to prevent C-x 1 from working?

When I start emacs all functionality of frames works fine. I can split frame by two via "C-x 3", switch to it "C-x o", and then close other (left) frame via "C-x 1". But ...
user1244932's user avatar
0 votes
0 answers
126 views

lsp-mode shows LSP[Disconnected]

I am using Ubuntu linux. Here is a minimal version of my .emacs file: ;;---------------------------------------- ;; use-package ;;{{{ Set up package and use-package ;;---------------------------------...
Chris's user avatar
  • 1
0 votes
0 answers
65 views

Is there any way of making company show local classes inside a Java project?

I have a configuration for Java code on emacs that's the following: (use-package flycheck :ensure t :config (global-flycheck-mode)) (use-package company :ensure t :hook (after-init . global-...
raylight's user avatar
  • 217
0 votes
1 answer
380 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
0 votes
1 answer
79 views

jdtls failing to start for lsp-java after clearing .m2/repository

I have lsp-java set up to use jdtls. It had been working fairly well. For unrelated reasons, I deleted my ~/.m2/repository and then reran mvn install to repopulate the parts of it that I need. Now ...
Troy Daniels's user avatar
0 votes
0 answers
249 views

lsp-format-buffer :: No formatting changes provided

I'm trying to indent a C# file, but when I lsp-format-buffer, it just says No formatting changes provided ..in the echo area. Any way to figure out what that means?;)
Jason Hunter's user avatar
1 vote
0 answers
72 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
0 votes
1 answer
179 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
173 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
2 votes
0 answers
331 views

tell lsp-mode not to look for pyright

I'm trying to add type checking and code completion for python. I'm using Emacs 28.2. I installed pyright using brew (brew install pyright) and when I open a python file, I see: Unable to find server ...
David J.'s user avatar
  • 153
0 votes
0 answers
67 views

Completion in lsp-mode: incremental restriction and fuzzy search, how to?

I am trying to use lsp-mode in emacs. My problem applies to both C++ and Python code. I have confirmed I am using company-mode for completion. When I type a '.' I trigger completion in company-mode ...
Spacemoose's user avatar
0 votes
1 answer
46 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
1 vote
1 answer
290 views

How to autocomplete dynamically created objects in python code?

Is anybody able to get suggestions after typing x. using code below? E.g. name import json from types import SimpleNamespace data = '{"name": "John Smith", "hometown": {&...
jjk's user avatar
  • 749
0 votes
0 answers
98 views

How can I selectively disable addon LSPs on a project, without blocklisting the project itself?

I work on several open source and commercial ruby projects, all of which have different sets of development tools installed. Some of them have solargraph available, some do not. Of those, some have ...
Chris R's user avatar
  • 200
0 votes
0 answers
44 views

Why does lsp-mode stop at "starting" when trying to connect to arduino-language-server?

I tried to create an arduino-lsp language server client for emacs. I followed the instructions from Adding support for languages and got some promising first output in the Messages buffer: LSP :: ...
Markus Grunwald's user avatar
1 vote
0 answers
106 views

Flymake: how can I modify/ignore syntax and styling rules?

This question was asked before here, but the solution doesn't work. It could be because I am not restarting flymake correctly. The question is: how to have flymake ignore certain errors and warnings? ...
Schach21's user avatar
0 votes
0 answers
129 views

lsp-mode, Hello World in C#

I get some weird errors for just the most simple Hello World in C#, with lsp-mode using System; namespace test { public class Driver { public static void Main() { ...
Jason Hunter's user avatar
0 votes
0 answers
17 views

any js-mode fails to sync changes properly with lsp-mode

running emacs 28, lsp-mode with ts-ls, doing js,jsx,ts,tsx in certain jsx files (can't figure out the pattern), the editor and the language server get out of sync very quick/easily and flycheck starts ...
gdanov's user avatar
  • 101
3 votes
1 answer
414 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
  • 565
0 votes
0 answers
33 views

Copy LSP Debug Messages

I'm trying to get lsp-mode with omnisharp to work, but I run into lots of issues, like it giving me messages in a pop up buffer that I can't switch to, for example to copy the text, so that I can ...
Jason Hunter's user avatar
2 votes
1 answer
33 views

How do I find out what package is adding red boxes to my source code?

I have this piece of ruby code: def open(...) local_path.open(...) end and the first two lines have red boxes around them and when I hover over either one it says "syntax error, ...
pedz's user avatar
  • 365
0 votes
0 answers
46 views

How to enable font lock (syntax highlighting) in a popup?

I would like to recreate a workflow I have with vim and neovim using coc.nvim. When I am programming using LSP, and I have some diagnostic at point, a popup appears with the text in it highlighted ...
PsyFish's user avatar
  • 101
0 votes
0 answers
48 views

How do I select lsp-mode function completion candidates?

I have company, lsp-mode, consult, yasnippet installed. I'm not sure which one triggers the following completion. How do I scroll over and select them?
Mingheng Wang's user avatar
1 vote
2 answers
86 views

How do I stop lsp-mode from re-indenting my comments after a newline

I just installed lsp-mode for use with C++. It's reformatting my comments as I type. For example, if I have a doxygen comment like this: /// Blah blah blah ... blah blah the end. [cursor here] /// ...
Rob N's user avatar
  • 547
0 votes
0 answers
55 views

lsp-pyright defer init until a .py file is open

Hey guys i'm improving my startup, Emacs version 28.2. I did a benchmark on init and I noticed that the thing that takes most of the time is lsp-pyright. That initializes lsp-mode. But I don't ...
Nico Stirnemann's user avatar
0 votes
0 answers
17 views

Company completion overwriting existing text

I am using company with lsp-java, but I think this is a company problem. I have some code like void quz(int bar, int longNamedVariable) { foo(bar, longNamedVariable); } I packaged all the ...
Troy Daniels's user avatar
0 votes
1 answer
479 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
141 views

Installing `lsp-mode` and `dap-mode` from melpa

When I install lsp-mode from Melpa, I get version 20221003.1714. When I install dap-mode from Melpa, I get version 20220921.941, which requires lsp-mode-6.0. As a result, (require 'dap-mode) fails: ...
Troy Daniels's user avatar
0 votes
0 answers
33 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
342 views

Utterly failing to get lsp-mode to work via lsp-docker for Ruby using Solargraph

I'm working on a Rails project and using Docker containers with a web and a db container. The Rails files are on the laptop and mounted into the web container. The web container has the Ruby ...
pedz's user avatar
  • 365
1 vote
0 answers
57 views

LSP clangd + company-mode writes ${n: Variable} strings

I am not sure what exactly to google, on this issue. I have emacs 28.1 installed, with LSP-clangd and company-mode installed. Suppose a function have signature int func(int i, int j), then emacs ...
ipcamit's user avatar
  • 123
0 votes
1 answer
247 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
1 answer
209 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,238