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
0 votes
0 answers
8 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 ...
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 ...
0 votes
1 answer
19 views

Omnifunc doesn't trigger after a few uses

I use omnifunc with the neovim built in LSP functionality and this is my configuration. local lspconfig = require("lspconfig") vim.opt.completeopt = { "longest", "menuone"...
0 votes
2 answers
52 views

Creation of a short document description for programming languages in a pop-up window like vscode?

How can we have a short summary about documents of programming languages (Python and Javascript is important for me) or frameworks in Neovim? I want to see a short description of APIs and keywords in ...
2 votes
1 answer
407 views

How to search workspace symbols across multiple languages by using LSP in Neovim?

I want to search the workspace symbols across multiple languages without opening any buffer. Like what VSCode can do: I tried the following: Neovim built-in vim.lsp.buf.workspace_symbol() Telescope. ...
0 votes
1 answer
169 views

How to show and use Quick actions/Context action in Neovim?

JetBrains IDEs and VSCode have this feature where they show some actions that you can do to handle a warning like in the pictures below. PyCharm's Context action: VSCode's Quick fix In Neovim, it ...
2 votes
1 answer
543 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 ...
0 votes
0 answers
10 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.
0 votes
0 answers
21 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 ...
1 vote
2 answers
632 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
59 views

How to enable Qt completion with clangd in Neovim?

I use nvim-cmp. I have installed the clangd with Mason, and configured it with `lsp-config.nvim as: local capabilities = require('cmp_nvim_lsp').default_capabilities() lspconfig.clangd.setup { ...
0 votes
1 answer
191 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(&...
1 vote
2 answers
60 views

Run pyright in single file mode and some questions

I have pyright set up as an lsp in neovim and my configuration is like this: lspconfig.pyright.setup({ on_attach = on_attach, capabilities = capabilities, root_dir = function(fname) local ...
0 votes
0 answers
18 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....
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 ...
0 votes
1 answer
189 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 ...
5 votes
2 answers
817 views

How can I copy the contents of an LSP / linter 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?
-1 votes
1 answer
127 views

How do you toggle inlay hints?

Previously, vim.lsp.inlay_hint.enable() used to toggle inlay hints. However, this functionality has been removed and now vim.lsp.inlay_hint.enable() just enables inlay hints. How can I toggle inlay ...
0 votes
0 answers
90 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 ... ...
0 votes
1 answer
880 views

Simplest setup for nvim and rust and system rust-analyzer

All the tutorials that I found to use nvim with rust-analyzer either suggest using Packer (which is unmaintained since August), vim plugin managers (I really want to avoid anything vimscript, it's ...
0 votes
0 answers
125 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, ...
0 votes
0 answers
412 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 ...
1 vote
0 answers
61 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'...
0 votes
1 answer
569 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 ...
1 vote
1 answer
654 views

jump to definition goes to import statement rather than actual file defintion

Here is my nvim setup: local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) local lspconfig = require('lspconfig') local servers = { '...
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 ...
0 votes
0 answers
24 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 ...
1 vote
2 answers
991 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 (...
2 votes
1 answer
923 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
1 answer
518 views

How to setup up LSP for C/C++ in Vim? [closed]

I would like: auto complete, navigation, refactoring using LSP in Vim not in Neovim. I would like some guide and example to setup .vimrc Can I find one?
2 votes
1 answer
55 views

Navigate to the URL provided by a COC LSP exention's diagnostic output

The diagnostic popup for some of the COC LSP extensions include a URL to get more information about a particular error. For example, coc-sh shows this (invoked through a mapping that calls <Plug&...
0 votes
1 answer
552 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 vote
2 answers
1k 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 ...
0 votes
0 answers
21 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 ...
0 votes
1 answer
235 views

Use LspConfig root_dir in Neogit cwd

I'm trying to setup Neogit to open in my workspace directory instead of cwd. The problem is that I use multi root workspaces, so I usually set my cwd to be workspace1/... My initial try was to use ...
2 votes
1 answer
135 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 ...
0 votes
1 answer
2k 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
2 answers
1k views

Where can I config my LSP server in AstroNvim?

I have browsed AstroNvim config extensively and even ran a grep seach for my LSP server's name but could not find mention of it. Yet I need to change the setup of this server :(. How can I do it? The ...
7 votes
2 answers
3k views

How do I close a hover'ed window with LSP information, Escape does not work?

Whenever I open a hover window with my LSP plugin, :lua vim.lsp.buf.hover() I get a floating window hovered over text, but then I can not close it? I've tried ESC and the like. How do you close these ...
1 vote
2 answers
183 views

ALE Code Action for python

I have a working linter with the ALE plugin. Plugin 'dense-analysis/ale' let g:ale_virtualtext_cursor = 0 let g:ale_python_flake8_options = '--extend-ignore=E501' nnoremap <leader>ar :ALERename&...
1 vote
1 answer
1k 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. ...
2 votes
1 answer
1k 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 ...
9 votes
1 answer
224 views

How does NeoVim's native LSP client compare with plug-ins that implement that protocol?

NeoVim v0.5 will include a native LSP (Language Server Protocol) implementation. See Greg Hurrell (wincent)'s Screencast #87: Neovim's built-in LSP client covering it. How does it compare with ...
1 vote
1 answer
264 views

Docker-Compose LSP will not attach to buffer nor automatically start

With the current default configuration of the "docker_compose_language_service" LSP, it will not start, nor attach after being started to the current buffer. When taking a look at the ...
0 votes
1 answer
905 views

JsDoc typechecks for JS files in Neovim

Is it possible in Neovim to use JsDoc for typechecking of javascript files? Right now I use default LSP configurations for eslint and tsserver provided by lspconfig: -- init.lua require('lspconfig')....
1 vote
1 answer
463 views

How do I configure plugins in AstroNvim?

I'm using AstroNvim. I've cloned the template based repo to ~/.config/nvim/lua/user. How do I configure clangd, for example, to use LLVM code style instead of Google's or to use 4 spaces tab ...
0 votes
1 answer
3k 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 ...
0 votes
0 answers
62 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) ...
0 votes
1 answer
340 views

How to disable lsp server syntax highlighting?

I found out that my lsp servers is somehow adding this ugly highlighting to my code (this happened after I updated my Homebrew for some reason), here are before and after pics: Here is my lsp server ...
0 votes
0 answers
103 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 ...