Skip to content

Commit 57c0b6c

Browse files
committed
new notation for setting up LSPs
1 parent d1aade1 commit 57c0b6c

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lua/kickstart/plugins/lsp.lua

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ return {
210210
-- By default, Neovim doesn't support everything that is in the LSP specification.
211211
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
212212
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
213-
local capabilities = require('blink.cmp').get_lsp_capabilities()
213+
-- local capabilities = require('blink.cmp').get_lsp_capabilities()
214214
-- LSP servers and clients are able to communicate to each other what features they support.
215215
-- By default, Neovim doesn't support everything that is in the LSP specification.
216216
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
217217
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
218-
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
219-
-- capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
218+
local capabilities = vim.lsp.protocol.make_client_capabilities()
219+
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
220220

221221
-- Ensure the servers and tools above are installed
222222
-- To check the current status of installed tools and/or manually install
@@ -245,11 +245,16 @@ return {
245245
require('utils.mason').install(missing_lsps)
246246

247247
-- configure nvim lsp via lspconfig package for our list of lsps
248-
local lspconfig = require 'lspconfig'
248+
-- local lspconfig = require 'lspconfig'
249249
for server, config in pairs(lsps) do
250+
-- tbl_deep_extend with force -> on conflict use value from right
250251
config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, config.capabilities or {})
251-
-- config.on_attach = on_attach -- we don't need this because of the events
252-
lspconfig[server].setup(config)
252+
253+
-- the require(lspconfig)[server].setup({...}) notation is deprecated in nvim-lspconfig
254+
-- Thus we use the new notation for setting up LSPs
255+
-- Part below is equivalent to require('lspconfig')[server].setup(config)
256+
vim.lsp.config(server, config)
257+
vim.lsp.enable(server)
253258
end
254259
end,
255260
},

lua/utils/languages.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
1010
local Languages = {
1111
['python'] = {
12+
pyrefly = {},
1213
pyright = {
1314
settings = {
1415
python = {

0 commit comments

Comments
 (0)