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 ...
KangarooChief's user avatar
0 votes
1 answer
20 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"...
YJH16120's user avatar
  • 135
0 votes
2 answers
55 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 ...
mohamadi_arch's user avatar
0 votes
0 answers
12 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,096
0 votes
0 answers
23 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
1 vote
1 answer
64 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 { ...
Vladyslav Rehan's user avatar
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....
Sito's user avatar
  • 121
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 ...
f4T1H21's user avatar
  • 13
-1 votes
1 answer
145 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 ...
Evan Carroll's user avatar
  • 1,244
0 votes
0 answers
100 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
130 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
1 vote
0 answers
67 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
0 votes
0 answers
436 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
25 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
603 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?
Jumogehn's user avatar
  • 165
0 votes
1 answer
205 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
203 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
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&...
Pak's user avatar
  • 1,114
0 votes
1 answer
955 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 ...
Olivetree's user avatar
  • 103
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 ...
Parker D's user avatar
0 votes
1 answer
604 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
1 vote
1 answer
276 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 ...
benlodz's user avatar
  • 13
1 vote
1 answer
487 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 ...
AnonNothing's user avatar
0 votes
0 answers
64 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
  • 713
0 votes
0 answers
106 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
1 answer
352 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 ...
abbood's user avatar
  • 713
0 votes
0 answers
205 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
656 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
1 vote
0 answers
428 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
0 votes
0 answers
46 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
2 votes
0 answers
44 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
1 answer
630 views

How can I go to the definition (gD) in a new tab?

I am using Typescript and I have this config for going to the definition when hovering over a function name: vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) -- does not work vim.keymap.set(...
bigpotato's user avatar
  • 123
0 votes
0 answers
196 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
2 votes
1 answer
2k views

Where to find debug logs for an LSP started with vim.lsp.start()?

Long time vim user, I am getting started with using LSPs in nvim. I want to use the clangd LSP to get all those powerful LSP goodies. I am seeing a bunch of spurious errors whenever I edit a file, so ...
Ari Sweedler's user avatar
1 vote
1 answer
685 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 = { '...
abbood's user avatar
  • 713
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
2 votes
1 answer
2k views

How do I add a custom LSP to `nvim-lspconfig`?

I am new to Neovim and wanted some help. I have been looking around but I could not find documentation on how to add an LSP that isn't preconfigured inside nvim-lspconfig. I have been trying to get ...
Andrew's user avatar
  • 21
1 vote
1 answer
201 views

Is there an autocmd event that triggers when a command becomes available?

I'm using nvim-lsp and pyright. That latter provides a command PyrightSetPythonPath to reset the path to the python interpreter. Since I can see no other way to perform the same task, I'd like to call ...
Futarimiti's user avatar
0 votes
0 answers
122 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
2 votes
1 answer
422 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. ...
Birudo Un's user avatar
0 votes
0 answers
110 views

How can I configure NeoVim to use different language servers for different directories of the same project?

This is my folder structure: project back (backend files written for deno) front (frontend files where I use esbuild) contract (interface files used both in back and in front) deno.jsonc (for deno) ...
Szymon Wygnański's user avatar
0 votes
1 answer
172 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 ...
Minh Mốc's user avatar
1 vote
1 answer
961 views

How to load the global "vim" object so lua-language-server stops complaining

Here is how I start the server: -- LSP vim.lsp.start({ name = 'lua-language-server', cmd = { 'lua-language-server' }, root_dir = vim.fs.dirname(vim.fs.find({'.git', '.vim', 'nvim'}, { upward = ...
Ari Sweedler's user avatar
1 vote
1 answer
107 views

How to pin context in the top of the buffer window?

I was watching this video and at around 35 minutes the person shows a feature to display the current context in the top few lines. I tried searching for a plugin or a setting in coc or default nvim to ...
FalcoGer's user avatar
  • 149
1 vote
1 answer
2k views

Get ruff / ruff_lsp to work with neovim

I tried kickstart.nvimi to get to work with the ruff-lsp. It did not work, therefore I built a minimal example with only the default configuration from the documentation. Here is the problem: When I ...
Dronakuul's user avatar
0 votes
1 answer
240 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 ...
Gustaw's user avatar
  • 1
1 vote
2 answers
2k 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 ...
samuelnihoul's user avatar
2 votes
1 answer
141 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 votes
1 answer
548 views

java_language_server installation fails with bash exit code 127 [closed]

I have java 17 installed and working and I have successfully installed other LSP servers without any issue. I have checked and apparently exit code 127 means command not found but that did not help me....
samuelnihoul's user avatar
1 vote
2 answers
185 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&...
Surya's user avatar
  • 21