add basedpyright and allow inlay hints by default
This commit is contained in:
parent
a7ebd6fde7
commit
33554a5315
|
@ -17,6 +17,9 @@ return {
|
||||||
{ 'folke/neodev.nvim', opts = {} },
|
{ 'folke/neodev.nvim', opts = {} },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
|
-- some default parameters
|
||||||
|
vim.lsp.inlay_hint.enable(true, nil)
|
||||||
|
|
||||||
-- Brief aside: **What is LSP?**
|
-- Brief aside: **What is LSP?**
|
||||||
--
|
--
|
||||||
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
||||||
|
@ -51,11 +54,6 @@ return {
|
||||||
vim.keymap.set('n', key, func, { buffer = buffer, desc = 'LSP: ' .. desc })
|
vim.keymap.set('n', key, func, { buffer = buffer, desc = 'LSP: ' .. desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
print('Called on attach', _)
|
|
||||||
for k, v in pairs(_) do
|
|
||||||
print(k, v)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Jump to the definition of the word under your cursor.
|
-- Jump to the definition of the word under your cursor.
|
||||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||||
-- To jump back, press <C-t>.
|
-- To jump back, press <C-t>.
|
||||||
|
@ -151,6 +149,8 @@ return {
|
||||||
-- For example, in C this would take you to the header.
|
-- For example, in C this would take you to the header.
|
||||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
|
|
||||||
|
print('LSP attach event for ', event.data, event.data.client_id)
|
||||||
|
|
||||||
-- The following two autocommands are used to highlight references of the
|
-- The following two autocommands are used to highlight references of the
|
||||||
-- word under your cursor when your cursor rests there for a little while.
|
-- word under your cursor when your cursor rests there for a little while.
|
||||||
-- See `:help CursorHold` for information about when this is executed
|
-- See `:help CursorHold` for information about when this is executed
|
||||||
|
@ -211,18 +211,28 @@ return {
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
-- clangd = {},
|
||||||
-- gopls = {},
|
-- gopls = {},
|
||||||
pyright = {
|
-- pyright = {
|
||||||
|
-- settings = {
|
||||||
|
-- python = {
|
||||||
|
-- analysis = {
|
||||||
|
-- autoSearchPaths = true,
|
||||||
|
-- diagnosticMode = 'workspace',
|
||||||
|
-- useLibraryCodeForTypes = true,
|
||||||
|
-- autoImportCompletions = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- disableLanguageServices = false,
|
||||||
|
-- },
|
||||||
|
basedpyright = {
|
||||||
settings = {
|
settings = {
|
||||||
python = {
|
basedpyright = {
|
||||||
analysis = {
|
analysis = {
|
||||||
autoSearchPaths = true,
|
autoSearchPaths = true,
|
||||||
diagnosticMode = 'workspace',
|
typeCheckingMode = 'standard',
|
||||||
useLibraryCodeForTypes = true,
|
|
||||||
autoImportCompletions = true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
disableLanguageServices = false,
|
|
||||||
},
|
},
|
||||||
-- pylsp = {
|
-- pylsp = {
|
||||||
-- settings = {
|
-- settings = {
|
||||||
|
@ -282,6 +292,7 @@ return {
|
||||||
require('utils.mason').install {
|
require('utils.mason').install {
|
||||||
-- "python-lsp-server",
|
-- "python-lsp-server",
|
||||||
'pyright',
|
'pyright',
|
||||||
|
'basedpyright',
|
||||||
'bash-language-server',
|
'bash-language-server',
|
||||||
-- "rnix-lsp",
|
-- "rnix-lsp",
|
||||||
'lua-language-server',
|
'lua-language-server',
|
||||||
|
@ -292,7 +303,6 @@ return {
|
||||||
local lsp = require 'lspconfig'
|
local lsp = require 'lspconfig'
|
||||||
|
|
||||||
for server, config in pairs(servers) do
|
for server, config in pairs(servers) do
|
||||||
print(server)
|
|
||||||
config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, config.capabilities or {})
|
config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, config.capabilities or {})
|
||||||
config.on_attach = on_attach
|
config.on_attach = on_attach
|
||||||
lsp[server].setup(config)
|
lsp[server].setup(config)
|
||||||
|
|
Loading…
Reference in New Issue