diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index 8304bad..d9c2e88 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -97,29 +97,6 @@ local ts_utils_setup = function(client, bufnr, opts) end end --- Pyright isn't usable for GLib/PyGObject based libraries. Both --- python-lsp-server and jedi-language-server which are based on Jedi and work --- for GStreamer/GLib etc. are extremely slow for Python files with 1000+ --- lines. So we only enable completion, rename/hover and document highlight --- support. Jumping to definition takes seconds in large files, so we just --- rely on in-built support or perhaps that comes from treesitter. -local on_attach_python = function(client, bufnr) - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - vim.lsp.set_log_level('warn') - - if client.config.flags then - client.config.flags.allow_incremental_sync = true - client.config.flags.debounce_text_changes = 500 - end - - local opts = { noremap=true, silent=true } - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gR', 'lua vim.lsp.buf.rename()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'k', 'lua vim.lsp.buf.hover()' , opts) - - vim.api.nvim_command [[autocmd CursorHold lua vim.lsp.buf.document_highlight()]] - vim.api.nvim_command [[autocmd CursorMoved,InsertEnter lua vim.lsp.buf.clear_references()]] -end - local on_attach = function(client, bufnr) vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') vim.lsp.set_log_level('warn') @@ -246,8 +223,21 @@ nvim_lsp.hls.setup { nvim_lsp.jedi_language_server.setup { on_init = on_init, - on_attach = on_attach_python, - capabilities = capabilities + on_attach = on_attach, + capabilities = capabilities, + init_options = { + completion = { + resolveEagerly = true, + }, + jediSettings = { + caseInsensitiveCompletion = false, + }, + workspace = { + symbols = { + maxSymbols = 50 + }, + }, + }, } require('rust-tools').setup(rust_tool_opts)