Questions tagged [lsp]

Language Server Protocol is used between an editor or IDE (such as Vim or NeoVim) and a language server (such as clangd or many others) that provides language features like auto complete, go to definition, find all references etc.

63 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
1 answer
2k views

How do I perform a code action on a visual range in Neovim 0.9?

In Neovim 0.8, I had the following command mapped vnoremap <leader>a :lua vim.lsp.buf.range_code_action()<cr> which in visual mode, gave me options such as Wrap In Try-Catch/Extract Method ...
pinoyyid's user avatar
  • 153
4 votes
0 answers
1k views

How to disable a lsp server using a specific rule?

I'm on a vue project, and I installed both tsserver and volar, but both of them will be called up when I open a *.ts | *.js file. But for vue project I only want to use volar since both tsserver and ...
ogios's user avatar
  • 43
4 votes
1 answer
1k views

How to disable semantic highlighting for certain filetypes only?

Using Neovim's native LSP interface, I noticed that semantic highlighting provided by LSP makes things worse for certain languages, so I want to disable it based on filetype. I know about possibility ...
Thunderbeef's user avatar
2 votes
0 answers
50 views

Error setting up julia language server in Neovim

When I try to use julials I get the following prompt: Client quit with exit code 1 and signal 0 These are the lsp log [ERROR][2023-09-24 23:12:43] .../vim/lsp/rpc.lua:677 "rpc" "/...
kay's user avatar
  • 61
2 votes
0 answers
918 views

How to force bashls, shellcheck to treat zsh files as bash using lspconfig?

Most of my dotfile scripts are in zsh, with the .zsh extension and shebang - #!/usr/bin/env zsh. Formatting and linting does not work in zsh files out of the box (understandably so); however, they can ...
casraf's user avatar
  • 121
2 votes
0 answers
612 views

enable `update_in_insert` only for certain extensions

I have several LSP servers I use in neovim with nvim-lspconfig. Some are fast, and most are slow. I can make the diagnostics update while in insert mode by doing something like vim.lsp.handlers['...
Max Coplan's user avatar
2 votes
0 answers
56 views

Parse files, hidden from the user

I am working on a snippet for C/C++ that can generate switch statements with cases from the types that an enum can have. So far I have some code that can get the type location from the language server....
c60cb859's user avatar
2 votes
0 answers
449 views

Pyright LSP flagging errors in class using pandas method

Using the following code example: import pandas as pd from typing import Dict class Test: def __init__(self, df : pd.DataFrame) -> None: self.df = df def example(self, ...
baxx's user avatar
  • 1,025
2 votes
1 answer
555 views

Neovim lsp configuration

I'm a beginner in Vim/Neovim world. I understand that LSP is for autocompletion, auto import, signature info, etc... So I have installed coc.nvim. But I have some question about the concept : if I ...
Hadock's user avatar
  • 143
2 votes
0 answers
3k views

Neovim nvim-jdtls Error Client 1 quit with exit code 13 and signal 0

i tried setting up my neovim with the nvim-jdtls plugin (https://github.com/mfussenegger/nvim-jdtls) But I always get a Client 1 quit with exit code 13 and signal 0 Error Message. I followed the ...
AnxiousBane's user avatar
2 votes
1 answer
171 views

Disabling Syntax Highlighting for Rust Files in Neovim 0.9.x

Please find the refined version below: In the attached images, the top one displays the syntax highlighting performed by the rust-analyzer Language Server Protocol (LSP), while the bottom image shows ...
Hyunsoo's user avatar
  • 131
1 vote
0 answers
150 views

How to have automatic function parameter hint popup in NeoVim ( LunarVim ) with pyright LSP?

Greetings NeoVim version: NVIM v0.9.5. I have recently installed NeoVim, with LunarVim configuration on top. My LSP is Pyright. Everything about the LSP and configuration is great, but everytime I'...
KhodeNima's user avatar
  • 131
1 vote
0 answers
595 views

TypeScript LSP Not Reading tsconfig.json

I am almost certain that I have a mistake in my Neovim configuration... The Neovim ~/.config/nvim directory I'm using is: https://github.com/andrewgregorywright/nvim-config/tree/main I've created an ...
Andrew's user avatar
  • 111
1 vote
0 answers
2k views

Neovim LSP not using project root configs (tsserver / eslint)

Today I have been setting up neovim on windows 11 (not WSL). I can't get the lsp servers to work. The issue is that nvim isn't loading the projects root tsconfig.json or eslintrc.json file for any ...
Gehaktmolen's user avatar
1 vote
0 answers
1k views

How can I wrap LSP errors?

I have checked this post but the answer does not work for me. It is also quite old and archived.Basically I tried a big bunch of vim.lsp.util commands but none of them were recognized. https://www....
samuelnihoul's user avatar
1 vote
1 answer
388 views

Handle star imports in Python

I'm currently developing a lot with Python. I use projects like pwntools and sometimes I'm contributing to repositories that use star imports in their source code. I know that star imports are not ...
Lukas's user avatar
  • 111
1 vote
0 answers
773 views

neovim - unable to setup gopls integration

I have configured my neovim editor using this link (https://github.com/LunarVim/Neovim-from-scratch). I have run LspInstallInfo and installed gopls successfully here. However, when I open type of ...
Mopparthy Ravindranath's user avatar
1 vote
0 answers
2k views

Ho to force the pyright language server to use a interpreter on a mounted volume

I have a problem with the following setup: the volume of a remote machine is mounted using sshfs nvim is opened on the mounted volume to ensure all my plugins and settings work ~/anaconda3/envs/.. is ...
cal's user avatar
  • 21
1 vote
0 answers
851 views

Reformatting with neovim LSP and clangd adds double carriage return (^M) on line breaks

I am using neovim (0.6) and its built-in LSP with clangd-12 for C++. When reformatting a file that uses DOS-style line endings, it for some reason uses a double carriage return, resulting in one ^M ...
luator's user avatar
  • 141
1 vote
0 answers
1k views

LspConfig code action does not work

I have problems with LspConfig when extracting a method to a new file. When executing the following command buf_set_keymap("n","<space>ca","<cmd> lua vim.lsp.buf....
FrFernandez's user avatar
1 vote
0 answers
990 views

NeoVim latest version autocompletion opens and closes immediately

I am new to Vim and NeoVim, I setup the latest NeoVim on MAC using brew install nvim --head. I setup the latest verison for the lsp suppport. I installed the CoC plugin and the CoC-go plugin for auto-...
Pharaoh's user avatar
  • 141
1 vote
0 answers
616 views

Retrieving declaration not supported for filetype

I am currently using vim-lsp for bash. As in https://github.com/bash-lsp/bash-language-server#vim I have added in my ~/.vimrc the followings : if executable('bash-language-server') au User lsp_setup ...
exteral's user avatar
  • 111
1 vote
2 answers
714 views

How to range format with nvim 0.9.0?

I don't set a mapping to format code because it is not something I do all the time. So previously, I used to have a command to format or range format as follows: " format code command! -range ...
paulodiovani's user avatar
0 votes
0 answers
11 views

Prevent some lsp from creating commands

Ocamllsp spawns new commands like OCamlSwitchNewWin, overriding some of mine. How to prevent such ? local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = vim....
Carbone_13's user avatar
0 votes
0 answers
13 views

How can implement deno organize imports like vscode in neovim with nvim-lsp

How can i implement a command on denols that organize imports like vscode does? I use nvim-lsp example for typescript: local function organize_imports() local params = { command = "...
Igor Brasileiro's user avatar
0 votes
0 answers
15 views

Auto importing issue from installed npm packages in neovim (only in js not ts)

I mainly use Neovim for my MERN stack work and it's been a few days, I have noticed that from some of the installed npm packages of my project, I wasn't able to auto-import the functions or components....
Nitesh's user avatar
  • 1
0 votes
0 answers
14 views

Get Stuck When Opening a file with thousands of lines by LSP-enabled Vim on Windows MSYS2

I am trying to recreate the Vim environment on Windows MSYS2 with my Linux Vim settings. But I found that when the LSP (prabirshrestha/vim-lsp) is turned on, sometimes the file gets stuck when opening ...
aRedR's user avatar
  • 1
0 votes
0 answers
22 views

nvim-lspconfig cannot go to definition to jdk or external library

I'm using Kickstart.nvim config with enabled jdtls LSP server for java but I have problem with go to function definition. vim.lsp.buf.definition() command (to jump to the definition) works for all the ...
Damian S.'s user avatar
0 votes
0 answers
32 views

Pyright LSP, leading spaces appears as "&nbsp;" in hover

I am using pyright LSP with the neovim (0.10.0-dev), and am seeing any leading spaces in docstrings replaced by &nbsp;. For example, see the attached image: As far as I can tell it seems very ...
Tom's user avatar
  • 1
0 votes
0 answers
15 views

Is there a Neovim plugin that can parse a .vscode directory and set up the LSP client accordingly?

I cloned a project off GitHub recently which comes with a VSCode configuration for telling clangd where all the headers are, providing run configurations etc. Is there an existing plugin I can ...
wallefan's user avatar
  • 171
0 votes
0 answers
38 views

How do I make use of LSP Code Action extensions?

I've been using neovim and lspconfig for quite some time. Today I noticed that some LSP servers have some sort of extensions, like extract variables and add constructor to the class, which lspconfig ...
Jay's user avatar
  • 1
0 votes
0 answers
42 views

Neovim only underline LSP diagnostics that are part of a line

I only want an LSP diagnostic to have an underline if the underline covers only part of the non-whitespace text of a line. I have a column of diagnostic signs so a full line being underlined gives no ...
KangarooChief's user avatar
0 votes
0 answers
21 views

Can you trigger a specific lsp code action programmicaly?

Doing the equivalent of :lua vim.lsp.buf.code_action() And pressing a key. I tried some variants like :lua vim.lsp.buf.code_action() :sleep 5 :call feedkeys('4','t') doesn't seem to work.
eyal karni's user avatar
  • 1,106
0 votes
0 answers
30 views

How to make lua_ls provide completion for luasnip methods?

I am using luasnip in Neovim and I'm having problems getting lua_ls to provide information about the functions. local ls = require("luasnip") local s = ls.snippet Basically, I want when ...
darkfrobozz's user avatar
0 votes
0 answers
26 views

How to add specific module in ways that lspconfig can recognise it?

I have a project that is structured something like this --project_name |- bin/main.py |- some_module |- file_a.py |- file_b.py |- ... |- .vscode/launch.json import sys from some_module....
Sito's user avatar
  • 121
0 votes
0 answers
300 views

How do I make the bashls language server work with nvim-lspconfig?

bashls is not working. I have multiple working servers with nvim-lspconfig yet I can't figure out how to make the bashls server work at any capacity. I've tried this ... other lsps ... ...
Quadro Developer's user avatar
0 votes
0 answers
342 views

How to configure tsserver with nvim lspconfig?

I'm trying to configure tsserver via neovim lspconfig. Currently I am trying to enable logging to verbose mode: lspconfig.tsserver.setup { on_attach = on_attach, capabilities = capabilities, ...
faileon's user avatar
0 votes
0 answers
1k views

How to use OmniSharp C# LSP with Mason in nvim properly?

I have installed the fomlowing plugins: mason.nvim mason-lspconfig.nvim nvim-lspconfig nvim-cmp cmp-nvim-lsp (I may have forgeotten to include something, but in any way I can use LSP with this setup ...
Vladyslav Rehan's user avatar
0 votes
0 answers
62 views

Display LSP suggestions for TypeScript TSConfig files with Neovim & nvim-lspconfig using jsonls

I'm using Neovim with the nvim-lspconfig plugin and for some projects, it would be great to have the TypeScript suggestions for JSON files such as TSConfig, but even though I'm not working with them ...
Amin NAIRI's user avatar
0 votes
1 answer
373 views

How to configure pylsp installed by Mason with lsp-zero for nvim?

I want to disable a specific error/warning - E203. This is my lsp.lua where I tried to add ignore config according to this doc from lsp-zero git local lsp = require("lsp-zero") lsp.preset(&...
hdw3's user avatar
  • 101
0 votes
1 answer
578 views

Autocomplete and suggestions don't work

My autocomplete is not working. First, let me say that I'm a noob using lazyvim but I'm so enthusiastic about it and I'm trying to learn. Trying to code in any language I don't get any language ...
Newbie_user's user avatar
0 votes
0 answers
27 views

Neovim :Explore weird behaviour

I'm new to neovim. I've been using the :Explore command to go to netrw, but when this happens the color scheme becomes inverted and my lsp starts trying to process the netrw buffer. This gets fixed ...
Parker D's user avatar
0 votes
1 answer
1k views

Getting Failed to run `config` for nvim-lspconfig error when installing gopls

I'm trying to refresh all my old school vim setup to lsp based ones. As part of this effort I'm going to use lazy.nvim as the plugin manager. I was able to get everything working until the part where ...
mohi666's user avatar
  • 101
0 votes
0 answers
87 views

How to disable semantic tokens for telescope?

I had semantic tokens automatically applied by my LSP, but I was able to disable it using this code: callback = function(args) local client = vim.lsp.get_client_by_id(args.data.client_id) ...
abbood's user avatar
  • 733
0 votes
0 answers
138 views

How to disable tsserver check on JS file

I am a newbie to neovim, so please bear with me. I am using Mason to configure my LSP servers. For Javascript I use tsserver. However I am getting error/hint 'Could not find declaration file for ...
Petr Bělecký's user avatar
0 votes
0 answers
316 views

goto definition

I'd like to have a shortcut ('gD', say) to go to the definition using vim.lsp.buf.definition; however, in a new tab (if this is not open yet), or in the tab already open.
Alois Pichler's user avatar
0 votes
1 answer
910 views

Error when configuring lspconfig with mason

I'm trying to set up autocompletion, fixing, etc. for lua files in Neovim. I started by trying to follow the instructions from this video: https://www.youtube.com/watch?v=lpQMeFph1RE&t=188s ...
quant's user avatar
  • 101
0 votes
0 answers
54 views

Nvim-lspconfig sorting diagnostics floating windows

Is there a way to raise floating windows by their type in nvim-lspconfig? Like in this situation I would like to see the documentation window above the errors window. Many thanks in advance.
Thomas's user avatar
  • 1
0 votes
0 answers
228 views

How do I configure NeoVim to use angularls when working on Angular code?

I work with AngularJS an I'm really missing a good way to navigate the code with NeoVim. I would like to have the same facilities, if possible, that I have using the angularls for Angular. How do I ...
Anderson's user avatar
0 votes
0 answers
131 views

neovim + lsp-config + gopls - invoking the omnifunc removes one character before the cursor

It's a while ago, but some PackerSync or a neovim update is behaving like this. So I want to invoke completion on a code like this: Hitting CTRL+X and CTRL+O results in this: See, after the log the ....
microo8's user avatar
  • 101