Comments (7)
Im also getting this error using the head of neovim with the boiler plate setup below. Somewhere the require'lspconfig'.<server>
is getting set to null after a load. LspInstall twice on any server e.g. vim and you'll see it.
local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
-- Mappings.
local opts = { noremap=true, silent=true }
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', 'gy', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', ',s', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', ',wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', ',wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', ',wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
buf_set_keymap('n', ',rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', '<Leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
buf_set_keymap('n', '<Leader>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', '<Leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then
buf_set_keymap("n", ",f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
end
if client.resolved_capabilities.document_range_formatting then
buf_set_keymap("v", ",f", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
end
-- Set autocommands conditional on server_capabilities
if client.resolved_capabilities.document_highlight then
vim.api.nvim_exec([[
hi! LspReferenceRead ctermbg=237 guibg=#373b41
hi! LspReferenceText ctermbg=237 guibg=#373b41
hi! LspReferenceWrite ctermbg=237 guibg=#373b41
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]], false)
end
-- buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
require "lsp_signature".on_attach({
bind = true,
hint_enable = false,
handler_opts = { border = "single" },
decorator = {"", ""},
})
end
local function setup_servers()
require'lspinstall'.setup()
local servers = require'lspinstall'.installed_servers()
for _, server in pairs(servers) do
print("requiring languange server: " .. server)
require'lspconfig'[server].setup { on_attach = on_attach }
end
end
setup_servers()
-- Automatically reload after :LspInstall <server> so we don't have to restart neovim
require'lspinstall'.post_install_hook = function ()
setup_servers() -- reload installed servers
vim.cmd("bufdo e") -- this triggers the FileType autocmd that starts the server
end
from nvim-lspinstall.
Indeed. I have no time right now, but will fix this soon. Thanks for reporting.
from nvim-lspinstall.
$HOME/.config/nvim/init.lua:527
line 527 in this file seems to be related to gitsigns. Why do you think this is lspinstall related?
from nvim-lspinstall.
$HOME/.config/nvim/init.lua:527
line 527 in this file seems to be related to gitsigns. Why do you think this is lspinstall related?
Oh sorry - locally I've made some modifications which are not yet committed and pushed to github ...
Line 527 is referring to the setup_servers()
function which is line 503 on github -> https://github.com/wimstefan/dotfiles/blob/master/config/nvim/init.lua#L503
Thus the config I've pasted above is here -> https://github.com/wimstefan/dotfiles/blob/master/config/nvim/init.lua#L445-L509
Sorry for the confusion! Do you want me to correct the initial title & post?
from nvim-lspinstall.
Cheers - kinda unusable at the moment.
from nvim-lspinstall.
Thank you for the fix! ππ
from nvim-lspinstall.
from nvim-lspinstall.
Related Issues (20)
- No html/CSS diagnostics HOT 1
- code_action does not work for Java without nvim-jdtls HOT 3
- haskell does not work (`cmd_cwd` changes and hls can't find hie.yaml)
- JSON language server will not run under Node 12.x because... HOT 1
- Add prisma lsp HOT 2
- Support for yarn HOT 1
- Supporting yarn HOT 12
- install lua failed on arch linux HOT 1
- Can't install Python LSP using LspInstall, in WSL2 HOT 2
- LspInstall - cannot find npm command HOT 2
- Custom install path HOT 2
- Error message when saving C header files. HOT 3
- Add LspInstall for lemminx (XML,XSD,SVG) HOT 3
- Install a list of language servers at startup HOT 3
- Options for java
- "cmd not defined" after installing Java HOT 1
- nvim-lspinstall config for html makes svelte files show duplicate entries for completion
- Angularls doesn't works at all
- MacOS - CSS - Client quit with exit code 1 and signal 0
- Does ESLint Language Server will be added to LSPInstall?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-lspinstall.