As of May 31, 2023, we have updated our Code of Conduct.

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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
451 views

neovim lsp configuration

I'm a begginer 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 ...
3 votes
1 answer
314 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 ...
0 votes
1 answer
79 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 ...
1 vote
1 answer
603 views

How to setup Vim LSP plugins to use clangd on a Visual C++ project (msbuild, cl.exe)?

How do you setup clangd as an lsp when using a project not built with clang? It's giving really basic lint errors like unknown type name 'uint8_t' because it's failing to process my precompiled ...
0 votes
1 answer
54 views

Shortcut to open definition of variable in a vertical split with Neovim mapping

This is a follow up question to this post where I would jump to the definition of a variable in a vertical split for ctags. I’m currently using an lsp language server like so: local bufopts = { ...
-1 votes
1 answer
22 views

How do I add support for a LSP server in ALE that is not already supported?

I want to add support for an LSP server for ALE in my local configuration. It's not supported by default. I can see how supported-by-default servers are done, e.g. https://github.com/dense-analysis/...
1 vote
1 answer
420 views

Neovim LSP Phpactor not finding classes

I have a project like this: - fruity/ - composer.json - vendor/ - appley/ - various.php - orangy/ - composer.json - vendor/ - src/ It's basically two ...
0 votes
0 answers
20 views

How to limit number of Vim-LSP suggestions from Vim-LSP itself

Even though Vim has its pum stuff, more specifically pumheight for this problem, I would expect Vim-LSP (prabirshrestha/vim-lsp) to have something similar for itself as well, after all a language ...
-1 votes
1 answer
60 views

vimtex#syntax#in_mathzone with tree-sitter and texlab

Vimtex provides the very useful family of functions vimtex#syntax#in_mathzone(), vimtex#syntax#in_comment() and vimtex#env#is_inside('...'), which come in handy for context sensitive snippets, e.g. ...
0 votes
1 answer
682 views

neovim clangd semantic highlighting

So I'm using this plugin to try and set up semantic highlighting with clangd in my ~/.config/nvim/init.nvim call plug#begin() Plug 'neovim/nvim-lsp' Plug 'neovim/nvim-lspconfig' Plug '...
1 vote
2 answers
190 views

Neovim - LSP attached to client but not working

I have this problem, that angularls is attached to my client, but the autocomplete / go to definition / format / hover is not working, for example if I tried to do vim.buf.hover using 'K' on '@...
0 votes
0 answers
100 views

Neovim configure lsp init.vim

How to attach the lsp-client properly? I installed Neovim v0.8.3 and nvim-lspconfig manually: $ mkdir ~/.config/nvim/pack/plugins/start $ git clone https://github.com/neovim/nvim-lspconfig.git ~/....
0 votes
0 answers
30 views

Strange behaviour with vim-lsp+clangd+asyncomplete-lsp

here is my .vimrc: call plug#begin() Plug 'prabirshrestha/vim-lsp' Plug 'mattn/vim-lsp-settings' Plug 'prabirshrestha/asyncomplete.vim' Plug 'prabirshrestha/asyncomplete-lsp.vim' Plug 'piec/vim-lsp-...
1 vote
0 answers
36 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['...
1 vote
0 answers
205 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 ...
0 votes
0 answers
53 views

Why does nvimtree keep changing to the wrong directory?

I have a project with the following structure. It's a monorepo based react project. It opens fine in the beginning. But as soon as I open any file e.g. apps/editor/pages/index.js. The NVIMTree ...
0 votes
1 answer
691 views

How to include/configure lua_ls on lspconfig?

I am trying to include lua_ls on my lspconfig but I am getting this error [lspconfig] Cannot access configuration for lua_ls. Ensure this server is listed in `server_configurations.md` or added as a ...
1 vote
1 answer
437 views

nvim-lspconfig omnifunc opens preview window

Having configured nvim-lspconfig exactly as officially recommended, I want to use the completion functionality via omnifunc. When pressing <C-X><C-O>, a drop down window appears right ...
0 votes
1 answer
216 views

Angularls root directory not found

I have the angular language server installed but client doesn't attach when I'm in an angular project because it doesn't have an angular.json in the root (since it is an Nx workspace), which (...
0 votes
0 answers
62 views

How to customize the output of vim.lsp.buf.document_symbol?

I'm using nvim lsp, and I got this keyboard mapping: vim.keymap.set('n', '<C-h>', vim.lsp.buf.document_symbol, bufopts) The problem is that its output is very verbose, it looks something like ...
1 vote
1 answer
656 views

LSP with pyright and poetry

I want LSP to allow me to use pyright with peotry projects. The problem is, that the venv of a poetry project is kind of arbitrary and can change. So I can not configure it in the pyright config file. ...
6 votes
6 answers
13k views

How to configure neovim to properly format python code?

I have neovim 0.8.0 installed. I have neovim/nvim-lspconfig plugin installed. I have installed pyright language server on my system (pip install pyright) I have configured neovim to use the pyright ...
0 votes
0 answers
139 views

How can I copy the contents of an error message in NeoVim

I'm using TSServer with LSPConfig to provide in-line typechecking with NeoVIM. Is there a way for me to grab the value of a given type error message? Especially to my system clipboard?
0 votes
0 answers
522 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 ...
0 votes
0 answers
95 views

Neovim tsserver LSP doesn't show the complete error (missing file info), but vscode does

I have two TypeScript files where I deliberately created the error: Duplicate identifier 'User' by declaring class User two times, one in each file. In vscode, I get the additional information that ...
0 votes
0 answers
27 views

To whom do I report error "LSP: unable to edit document because not previously opened"?

I have this repeatable error running Neovim 0.8 with dartls. It occurs if I :- open a dart file make a change, eg add a blank line :w to save it immediately :e! on the next change attempt, I get the ...
0 votes
0 answers
245 views

Neovim `vim.lsp.buf.format{async=true}` cause buffer change?

I am using autocmd BufWritePre to do code format with vim.lsp.buf.format(). It is sync and stuck for seconds. But when I use vim.lsp.buf.format{async=true}. The buffer is been changed. Is there a way ...
0 votes
0 answers
273 views

How do I organize imports with `tsserver` using Neovim LSP?

I'm using Neovim 0.9 and lsp-zero to edit Typescript files. tsserver has an organize imports feature. How do I map that back through LSP to a user-defined key? Basically, I'd like to add a new ...
0 votes
0 answers
52 views

Why do Neovim builtin colorschemes do this awful fake cursor jump?

I'm using Neovim 0.9 with LSP configured via lsp-zero, as vanilla as I can make it. On every built-in Neovim colorscheme I've tried, the cursor becomes evil when it hits a parentheses/bracket ...
0 votes
1 answer
2k views

Sumneko lua-language-server failed to load

My OS is openbsd 7.2 with neovim v0.7.2. I am using the repo at https://github.com/amy-juan-li/nvim-lua.git to configure Neovim. There is a problem with the neosolarized.rc.lua file. Can anyone see ...
2 votes
3 answers
3k views

How to add keymapping for LSP code formatting in visual mode?

In neovim I would like to set a keybinding -- via lua config -- to use LSP to format the visual selection when I type \qf. Using this setting, I can format the whole buffer from normal mode: vim.api....
1 vote
1 answer
418 views

How to add <bits/stdc++.h> header file in Clangd installed through Mason (Neovim lua)?

I want to add/expand the Clangd Language server, which I installed through Mason within Neovim, with the standard libraries that come with MinGW (I run windows 11). I'm trying to do CP, and for that I ...
1 vote
1 answer
87 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 ...
0 votes
0 answers
225 views

LSP server is not starting on vue file

I am using neovim v0.8.3 and using kickstart to configure my setup. I added volar = {} in the mason configuration section. But vue language server is not starting on vue file type. It is working if I ...
0 votes
0 answers
331 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....
2 votes
1 answer
294 views

How to select a function in neovim using LSP?

I want to select (e.g. to comment/uncomment) entire functions at a time in neovim using the built-in LSP. I do this now by avoiding empty lines in functions so that I can vap to select the entire ...
0 votes
1 answer
194 views

Prevent Neovim LSP from opening a scratch preview buffer

When auto-completing with neovim's LSP, whenever selecting a menu entry from the auto-complete list a scracth/preview buffer is created, even if empty: How can I disable these buffers specifically ...
0 votes
0 answers
27 views

clojure-lsp in neovim is not navigating to function definitions/namespaces

I'm using neovim with clojure lsp for clojure development. My neovim config are exactly same as this repo. The autosuggesting is working fine with this configuration. But when I like to navigate to ...
-1 votes
1 answer
180 views

How can I hide navigation bar in nvim

I would like to know how I can remove this navigation bar or at least fix that fat red arrow. Here is my nvim config https://github.com/victororlyk/nvim_config
0 votes
2 answers
636 views

Go to definition with LSP

I'm trying to use Jedi to do "jump-to-definition". For example, if my cursor is on MLPClassifier, I want to be able jump to the place where that class is defined in Python code from the ...
0 votes
0 answers
65 views

Neovim LSP rename error message missing details

I have a go project, when I try to rename a variable, I get a message in the status bar: gopls: 0: renaming the type "seznamProperty" to "estate"^Iwould cause this reference to be ...
0 votes
0 answers
15 views

Browse all symbols of a python project

I want to browse symbols for an entire python project (directories / git files). Usually, LSP providers write this to lsp_workspace_symbols. Unfortunately, I couldn't make jedi_language_server ...
0 votes
0 answers
11 views

Browse diagnostic for local file only (LSP)

Is there any way to browse diagnostics for current file rather than all project? I am using built-in LSP. :Telescope diagnostics displays for the whole project.
0 votes
1 answer
2k views

How to install sumneko_lua

I'm a Mac user with complete lua config. I have tried installing sumneko_lua in Neovim 0.6.1 several times but without success. Frustration led me to open this question. I have also read and tried to ...
2 votes
1 answer
427 views

How do I disable colors in LSP's floating window

The floating window of LSP in neovim uses different colors for different kinds of diagnostics: red for errors, yellow for warnings, etc. How do I disable all colors?
4 votes
1 answer
2k views

User borders around LSP floating windows

In neovim, these keymaps (from nvim-lspconfig) show diagnostics from LSP servers on a floating window: vim.keymap.set('n', '<leader>le', vim.diagnostic.open_float, opts) vim.keymap.set('n', '[d',...
1 vote
1 answer
382 views

Add a border to `:LspInfo` window in Neovim

I use a transparent colorscheme for my Neovim. Due to the transparency, the :LspInfo window is difficult to distinguish from the background. Can I add a border around the window?
1 vote
0 answers
370 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 ...
2 votes
1 answer
865 views

How to set the diagnostic level for neovim lsp

By default the lsp has set the diagnosticLevel to Hints, i wanna set this to information level. I tried looking at various places but couldn't find much. I am using LunarVim config if that gives extra ...
0 votes
0 answers
262 views

How to recognize bits/stdc++.h in c++ with clangd? I use g++ compiler

bits/stdc++.h isn't recognized by lspconfig, so I tried just including the string header, for example, but the lspconfig still says "unknown type name 'string'". Any fixes? I use nvim-...