aboutsummaryrefslogtreecommitdiff
path: root/lua/kickstart/plugins/lspconfig.lua
diff options
context:
space:
mode:
authorDamjan 9000 <damjan.9000@gmail.com>2024-07-22 20:25:55 +0200
committerDamjan 9000 <damjan.9000@gmail.com>2024-07-22 20:25:55 +0200
commite1d6094136efb6f0c1f5a9f303fb8cbbe32b5976 (patch)
tree76ca861005d8c361e86696cd7cc0870fb5cd2178 /lua/kickstart/plugins/lspconfig.lua
parenta6442e80813b40238066676b7ac97951c1bd1822 (diff)
parent56b9114bf29cdc0c0f5de78b5deae1fe0ab65db1 (diff)
Merge 'upstream' Neovim 0.10 updates and more
Merged commits from upstream: Update comment about the toggle inlay hints keymap lint: fix lsp warning in `vim.lsp.inlay_hint.is_enabled` Update lazydev config to fix "Undefined field `fs_stat`" LSP error Neovim 0.10 updates Fix comment about mini.ai example Make conform.nvim be lazy-loadable again Update README.md | %userprofile%\appdata\local -> %localappdata% Make debug lazy loadable Remove redundant require Fix neo-tree keymap description fix: add required parsers from nvim-treesitter
Diffstat (limited to 'lua/kickstart/plugins/lspconfig.lua')
-rw-r--r--lua/kickstart/plugins/lspconfig.lua26
1 files changed, 16 insertions, 10 deletions
diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua
index 5f9220b..e5944e5 100644
--- a/lua/kickstart/plugins/lspconfig.lua
+++ b/lua/kickstart/plugins/lspconfig.lua
@@ -11,9 +11,19 @@ return {
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },
- -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
+ -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
- { 'folke/neodev.nvim', opts = {} },
+ {
+ 'folke/lazydev.nvim',
+ ft = 'lua',
+ opts = {
+ library = {
+ -- Load luvit types when the `vim.uv` word is found
+ { path = 'luvit-meta/library', words = { 'vim%.uv' } },
+ },
+ },
+ },
+ { 'Bilal2453/luvit-meta', lazy = true },
},
config = function()
-- Brief aside: **What is LSP?**
@@ -90,10 +100,6 @@ return {
-- or a suggestion from your LSP for this to activate.
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
- -- Opens a popup that displays documentation about the word under your cursor
- -- See `:help K` for why this keymap.
- map('K', vim.lsp.buf.hover, 'Hover Documentation')
-
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header.
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
@@ -104,7 +110,7 @@ return {
--
-- When you move your cursor, the highlights will be cleared (the second autocommand).
local client = vim.lsp.get_client_by_id(event.data.client_id)
- if client and client.server_capabilities.documentHighlightProvider then
+ if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
buffer = event.buf,
@@ -127,13 +133,13 @@ return {
})
end
- -- The following autocommand is used to enable inlay hints in your
+ -- The following code creates a keymap to toggle inlay hints in your
-- code, if the language server you are using supports them
--
-- This may be unwanted, since they displace some of your code
- if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
+ if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
map('<leader>th', function()
- vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
+ vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
end, '[T]oggle Inlay [H]ints')
end
end,