Skip to content

Commit af749bd

Browse files
committed
Merge 'upstream': various fixes
- Propsed fix for init.lua warnings - Remove duplicate cmp-path - fix: regression introduced in db78c0b - Fix: fix the cmp-nvim-lsp-signature-help link - feat: add basic function signature help - perf: load tokyonight.nvim in the intended way
2 parents 15e019c + 34e7d29 commit af749bd

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

lua/kickstart/plugins/cmp.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ return {
3434
-- into multiple repos for maintenance purposes.
3535
'hrsh7th/cmp-nvim-lsp',
3636
'hrsh7th/cmp-path',
37+
'hrsh7th/cmp-nvim-lsp-signature-help',
3738
},
3839
config = function()
3940
-- See `:help cmp`
@@ -110,6 +111,7 @@ return {
110111
{ name = 'nvim_lsp' },
111112
{ name = 'luasnip' },
112113
{ name = 'path' },
114+
{ name = 'nvim_lsp_signature_help' },
113115
},
114116
}
115117
end,

lua/kickstart/plugins/lspconfig.lua

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,26 @@ return {
109109
-- For example, in C this would take you to the header.
110110
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
111111

112+
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
113+
---@param client vim.lsp.Client
114+
---@param method vim.lsp.protocol.Method
115+
---@param bufnr? integer some lsp support methods only in specific files
116+
---@return boolean
117+
local function client_supports_method(client, method, bufnr)
118+
if vim.fn.has 'nvim-0.11' == 1 then
119+
return client:supports_method(method, bufnr)
120+
else
121+
return client.supports_method(method, { bufnr = bufnr })
122+
end
123+
end
124+
112125
-- The following two autocommands are used to highlight references of the
113126
-- word under your cursor when your cursor rests there for a little while.
114127
-- See `:help CursorHold` for information about when this is executed
115128
--
116129
-- When you move your cursor, the highlights will be cleared (the second autocommand).
117130
local client = vim.lsp.get_client_by_id(event.data.client_id)
118-
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
131+
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
119132
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
120133
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
121134
buffer = event.buf,
@@ -142,7 +155,7 @@ return {
142155
-- code, if the language server you are using supports them
143156
--
144157
-- This may be unwanted, since they displace some of your code
145-
if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
158+
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
146159
map('<leader>th', function()
147160
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
148161
end, '[T]oggle Inlay [H]ints')
@@ -245,6 +258,8 @@ return {
245258
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
246259

247260
require('mason-lspconfig').setup {
261+
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
262+
automatic_installation = false,
248263
handlers = {
249264
function(server_name)
250265
local server = servers[server_name] or {}

lua/kickstart/plugins/tokyonight.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ return {
66
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
77
'folke/tokyonight.nvim',
88
priority = 1000, -- Make sure to load this before all the other start plugins.
9-
init = function()
9+
config = function()
10+
---@diagnostic disable-next-line: missing-fields
11+
require('tokyonight').setup {
12+
styles = {
13+
comments = { italic = false }, -- Disable italics in comments
14+
},
15+
}
16+
1017
-- Load the colorscheme here.
1118
-- Like many other themes, this one has different styles, and you could load
1219
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
1320
vim.cmd.colorscheme 'tokyonight-night'
14-
15-
-- You can configure highlights by doing something like:
16-
vim.cmd.hi 'Comment gui=none'
1721
end,
1822
},
1923
}

0 commit comments

Comments
 (0)