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
16 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?
  • 1
0 votes
0 answers
83 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
25 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
16 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 ...
  • 123
0 votes
0 answers
55 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 ...
2 votes
0 answers
57 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 ...
  • 123
0 votes
0 answers
49 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
33 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
246 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 ...
  • 149
0 votes
1 answer
43 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
65 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
97 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....
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 ...
0 votes
1 answer
80 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 ...
1 vote
1 answer
52 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 ...
  • 111
1 vote
1 answer
195 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
16 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
86 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
323 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 ...
  • 101
2 votes
1 answer
119 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 ...
  • 141
0 votes
0 answers
43 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
14 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 ...
  • 1,364
0 votes
0 answers
8 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.
  • 1,364
0 votes
1 answer
434 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 '...
2 votes
1 answer
345 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?
  • 23
2 votes
1 answer
1k 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',...
  • 5,139
1 vote
1 answer
232 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?
  • 105
0 votes
0 answers
222 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-...
2 votes
0 answers
42 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....
0 votes
1 answer
495 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. ...
  • 109
0 votes
1 answer
79 views

Autocommand to run :Prettier on :w

I am working in a React (TypeScript) project. I am using LSP with Neovim and have TypeScript Server installed. Right now, after I make a change, I have to run :Prettier followed by :w. I'm getting ...
  • 205
0 votes
1 answer
226 views

Error using vim.lsp.buf.definition() in any C# classes

The setup I have works fine for tsserver but not the csharp_ls local servers = { 'tsserver', 'csharp_ls' } local on_attach = function(client, bufnr) vim.keymap.set('n', 'gd', ":vsplit | ...
0 votes
0 answers
80 views

Neovim: Detect phpstan.neon in the folder hierarchy above the current file

I have recently started using Neovim and I like it a lot. But I have some trouble using PHPstan with the appropiate phpstan.neon file. Let's say i have this folder/file structure - projects - ...
  • 101
1 vote
1 answer
305 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 ...
1 vote
0 answers
239 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, ...
  • 885
0 votes
0 answers
83 views

Vimlsp and asyncomplete not displaying completion popups

Been trying for a couple days with no luck to get an lsp with autocompletion working in my Vim setup. My .vimrc file looks like this: let g:asyncomplete_log_file="/home/user/z_log" let g:...
0 votes
1 answer
320 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 ...
1 vote
0 answers
322 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 ...
0 votes
1 answer
223 views

K does not show function signature

My full config is on GitHub. In my lsp-config.lua I have the following: buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) However, when I press K on the name of a ...
  • 205
0 votes
0 answers
911 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 ...
  • 11
1 vote
1 answer
93 views

Closing buffer when changing files with NerdTree

I am using NVIM v0.7.2 on Arch Linux. Right now I got a problem with the plugins vim-easycomplete and nerdtree. When I operate on one file and open another one, the first file stays in the buffer. On ...
  • 63
0 votes
1 answer
885 views

Incorrect autocomplete with Javascript using nvim-lspconfig

My lspconfig works fine with typescript files, but not with Javascript. Autocomplete shows .constructor and other standard props/methods instead of the expected ones defined on the type This happens ...
0 votes
1 answer
1k views

lsp client failing to attach as part of autocmd

I'm using the nvim-lspconfig plugin to set up *sh, lua, and python LSPs. If I have the setup function at the 'top level' of my init.lua, the servers attach as expected. However, I'd like the lsp ...
0 votes
1 answer
2k views

How to setup intelephense with neovim + lua?

I have 2 neovims, one with coc, and another with lua. In neovim with coc, intelephense works. I am working with wordpress, and i need intelephense. Nvim coc setup. plugins.vim Plug 'yaegassy/coc-...
  • 37
0 votes
0 answers
237 views

HTML Lsp missing format shortcut

I'm having a problem in Neovim with Lsp formatting in Html files. :checkhealth is Ok :LspInfo is Ok, html is attached I have a shortcut for formatting, buf_set_keymap("n", '<space>fo', ...
1 vote
1 answer
1k views

How can i use Enter to select item from popup menu?

I am using UltiSnippets let g:UltiSnipsExpandTrigger='<None>' let g:UltiSnipsJumpForwardTrigger = '<tab>' let g:UltiSnipsJumpBackwardTrigger = '<S-b>' let g:coc_snippet_next = '<...
  • 37
6 votes
6 answers
9k 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 ...
  • 399
2 votes
1 answer
1k 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
1 answer
421 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 ...
  • 133
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 ...
  • 157