Commit graph

97 commits

Author SHA1 Message Date
Sanchayan Maity 0002d02e6c
nvim: lsp: Drop unnecessary if check 2023-03-05 00:13:28 +05:30
Sanchayan Maity 0c9e0eb164
nvim: lsp: Disable semantic token highlighting
It produces somewhat bad syntax highlighting in some cases. For example,
in typescript, the variable and it's type annotation get the same colour.
2023-01-05 09:38:26 +05:30
Sanchayan Maity f68aed5238
nvim: lsp: Add mapping for clearing code lens 2023-01-03 20:04:27 +05:30
Sanchayan Maity ac65aa26cb nvim: lsp: Use local leader for running code lens
We use <Leader>l for linting. This should have been done as part of
commit b294f19.
2022-12-12 10:11:20 +05:30
Sanchayan Maity 4d970ce70c nvim: lsp: Fix error in LspDetach
Some language servers like HLS take longer to attach and if we exit
soon before LSP attach had a chance to finish (may be?), server
capabilities field does not seem to be valid in client object and
we get the below error. Check if it valid first.

Error detected while processing LspDetach Autocommands for "*":
Error executing lua callback: /home/core/.config/nvim/lua/lsp.lua:215: attempt to index field 'server_capabilities' (a nil value)
stack traceback:
        /home/core/.config/nvim/lua/lsp.lua:215: in function </home/core/.config/nvim/lua/lsp.lua:209>
        [C]: in function 'nvim_exec_autocmds'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1140: in function </usr/local/share/nvim/runtime/lua/vim/lsp.lua:1139>
Error executing lua callback: /home/core/.config/nvim/lua/lsp.lua:215: attempt to index field 'server_capabilities' (a nil value)
stack traceback:
        /home/core/.config/nvim/lua/lsp.lua:215: in function </home/core/.config/nvim/lua/lsp.lua:209>
        [C]: in function 'nvim_exec_autocmds'
        /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1140: in function </usr/local/share/nvim/runtime/lua/vim/lsp.lua:1139>
2022-11-29 20:26:28 +05:30
Sanchayan Maity 6d7a9fe9b3 nvim: lsp: Use vim.notify to report error 2022-10-02 17:04:25 +05:30
Sanchayan Maity 05c27960f7 nvim: lsp: Disable logging
Disable logging completely. The set_log_level call needs to be at the
top level else some log message related to startup still gets logged
if the call is done in on_attach.
2022-09-18 12:34:41 +05:30
Sanchayan Maity 4b18ecad6d nvim: Use ex commands as methods instead of string on vim.cmd 2022-09-17 10:56:51 +05:30
Sanchayan Maity b398542a94 nvim: lsp: Minor clean up of autocmd callbacks 2022-09-13 18:16:08 +05:30
Sanchayan Maity 108403ca3d nvim: lsp: Drop custom range formatting function
With commit 11167ab, vim.lsp.buf.format now has a range argument
which defaults to current selection in visual mode.
2022-09-13 18:16:08 +05:30
Sanchayan Maity 9a26ef9c10 nvim: Drop nvim-lspconfig
Use the new vim.lsp.start API and LspAttach/Detach auto commands.
Drop nvim-lspconfig in the process.

LSP server specific configuration has been taken from nvim-lspconfig.
2022-08-31 12:21:28 +05:30
Sanchayan Maity 8e8f6110e5 nvim: lsp: Fix argument ordering to on_attach for inlay hint 2022-08-29 17:35:47 +05:30
Sanchayan Maity 490fe4e853 nvim: plugins: Drop rust-tools & use lsp-inlayhints
We do not use any of the other features provided by rust-tools and
only ever needed the inlay hints. Now that there is a plugin for
that which also allows us to use inlay hints for other languages
use that.

There are two options
https://github.com/lvimuser/lsp-inlayhints.nvim
https://github.com/simrat39/inlay-hints.nvim

The second one is from the rust-tools author himself but we could
not get that to work.
2022-08-19 16:59:19 +05:30
Sanchayan Maity 1cf5377ae5 nvim: lsp: Remove obsolete flag for clangd 2022-08-06 11:41:09 +05:30
Sanchayan Maity 01dfb0429c nvim: lsp: range_code_action is deprecated
See PR
https://github.com/neovim/neovim/pull/19551
2022-08-03 14:24:58 +05:30
Sanchayan Maity 918df63073 nvim: Fix group argument to nvim_create_autocmd 2022-05-06 12:04:35 +05:30
Sanchayan Maity 363ba685aa nvim: lsp/ftplugin/rust: Remove crate graph 2022-05-06 11:25:09 +05:30
Sanchayan Maity ef00957fae nvim: lsp: Refactor configuration setting for clients 2022-05-05 21:00:25 +05:30
Sanchayan Maity 223ffe7505 nvim: lsp: Enable additionalTextEdits for completion item 2022-05-05 20:59:32 +05:30
Sanchayan Maity 211cd39138 nvim: plugins/lsp: Drop nvim-lsp-ts-utils
The plugin is in maintenance mode and typescript.nvim does not support
inlay hints. We already use eslint language server and extra commands
provided by lsp-ts-utils/typescript.nvim is something we have never
used. Just drop it.
2022-05-02 10:34:44 +05:30
Sanchayan Maity 59b1696ffa nvim: lsp: Refactor setting up of autocmd for code lens & document highlight 2022-05-02 09:33:38 +05:30
Sanchayan Maity fdc17306b7 nvim: lsp: Refactor setting up of key mappings 2022-05-02 09:33:38 +05:30
Sanchayan Maity 59c9556325 nvim: lsp: Sync with upstream
vim.lsp.buf.formatting function is deprecated and now replaces all the
below three functions with vim.lsp.buf.format.

- vim.lsp.buf.formatting
- vim.lsp.buf.formatting_sync
- vim.lsp.buf.formatting_seq_sync

client.resolved_capabilities is no longer used. One must now access
client.server_capabilities which matches the same structure as the
protocol.

https://microsoft.github.io/language-server-protocol/specification

See neovim commit c618b31.
2022-05-01 19:50:07 +05:30
Sanchayan Maity 28049ed540 nvim: lsp: Use the new auto command API 2022-03-06 14:46:27 +05:30
Sanchayan Maity 22ef882154 nvim: lsp: Enable ESLint 2022-01-21 11:28:45 +05:30
Sanchayan Maity 6744dc6004 nvim: lsp: Do not enable document highlight on CursorHoldI 2022-01-04 15:15:47 +05:30
Sanchayan Maity 96977caa81 nvim: lsp: Fix typos & symbols in LSP protocol completion item kind 2021-12-29 18:54:57 +05:30
Sanchayan Maity 6a62f22855 nvim: lsp: Lower the debounce interval 2021-12-21 09:26:36 +05:30
Sanchayan Maity 7e943ae1c5 nvim: lsp: Update Python Jedi language server configuration 2021-12-21 09:26:36 +05:30
Sanchayan Maity b7762f552d nvim: lsp: Enable text for LSP protocol completion item kind 2021-12-16 18:52:53 +05:30
Sanchayan Maity 8e0fdbdaae nvim: Drop nvim-cmp
Auto-completion has mostly been annoying than of any actual use. Just
fancy annoying crap. Just use in built omni completion.
2021-12-14 15:44:33 +05:30
Sanchayan Maity 0fbd8d256e nvim: lsp: Enable code action only when supported 2021-12-10 19:50:19 +05:30
Sanchayan Maity 1891eef80a nvim: lsp: Enable nvim-lightbulb only if code lens is available 2021-12-10 19:50:19 +05:30
Sanchayan Maity 591077efb4 nvim: Update Python related configuration 2021-12-10 14:09:12 +05:30
Sanchayan Maity b41584d996 nvim: lsp: Enable document highlight only when supported 2021-12-10 14:09:12 +05:30
Sanchayan Maity 818a34a7ff nvim: lsp: Enable flake8 & pylint for pylsp
See documentation
https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md
2021-12-06 10:28:30 +05:30
Sanchayan Maity 3be8a76fe7 nvim: lsp: Drop support for lua
We had added lua-language-server thinking it would be helpful for
Wireplumber development, but, due to the nature of lua and server
itself, the experience is utter crap in comparison to using LSP in
other languages.
2021-11-28 17:53:49 +05:30
Sanchayan Maity 49cf726ce0 nvim: plugins/lsp: Drop null-ls
See the below issue
https://github.com/jose-elias-alvarez/nvim-lsp-ts-utils/issues/87

We went with null-ls because we wanted formatting with prettier. Also
null-ls was recommended by nvim-lsp-ts-utils.

The advantage of null-ls is it provides formatting and diagnostics
together in one package.

However, we will get prettier by another means and for linting switch to
nvim-lint.
2021-11-28 17:53:42 +05:30
Sanchayan Maity 6ead0d94a7 nvim: lsp: Fix missing capabilities for tsserver
We missed setting this when enabling inlay hints.
2021-11-20 17:00:14 +05:30
Sanchayan Maity 8733194431 nvim: lsp: Update the key mapping for code lens
We missed the fact that this conflicts with our gl mapping of HopLine
which we added recently.
2021-11-18 17:15:30 +05:30
Sanchayan Maity cc75f12e3f nvim: lsp: Enable inlay hints for TypeScript/JavaScript 2021-11-17 11:13:14 +05:30
Sanchayan Maity e07afd2c65 nvim: lsp: Never insert #include directives as part of code completion for clangd 2021-11-08 12:31:17 +05:30
Sanchayan Maity af7461452c nvim: lsp: Enable LSP document highlight 2021-10-20 13:01:21 +05:30
Sanchayan Maity a83b07959d nvim: lsp: Drop lsp_signature
The signature help sometimes stays open even after moving away from
the function. Sometimes it conflicts with the auto completion pop-up
making it difficult to see one of the two windows.
2021-10-11 13:28:07 +05:30
Sanchayan Maity 25059ef623 nvim: lsp: Enable some additional key mappings for code actions 2021-10-10 11:57:15 +05:30
Sanchayan Maity b04ecb9541 nvim: lsp: Remove redundant capabilities settings
The required capabilities to be set are already correctly set by
nvim-cmp, no need to set them again. We had added that to enable rust
snippet expansion earlier.

Also see older revisions of this document.
https://github.com/neovim/nvim-lspconfig/wiki/Snippets
2021-10-03 12:46:40 +05:30
Sanchayan Maity cf78dcae4d nvim: lsp: Fix diagnostic errors 2021-10-02 18:49:02 +05:30
Sanchayan Maity 8aa4fc2f76 nvim: lsp: Enable shellcheck as diagnostics source for null-ls 2021-10-02 18:29:57 +05:30
Sanchayan Maity 068dfcd4b9 nvim: lsp/keymappings: Move the diagnostic key mappings outside of LSP
vim.diagnostic framework is now available and can be used outside of
LSP. This means the same functions can now work for plugins providing
diagnostics via this framework like nvim-lint and null-ls.
2021-10-02 18:29:57 +05:30
Sanchayan Maity 0a21f7d979 nvim: lsp: Explicitly set the log level 2021-09-30 13:55:49 +05:30