python lsp servers small reorganization
This commit is contained in:
parent
f3a51a73bd
commit
fb7538c2f9
5 changed files with 58 additions and 75 deletions
|
@ -39,8 +39,9 @@ ENV MASON_PKGS=" \
|
||||||
marksman \
|
marksman \
|
||||||
phpcs \
|
phpcs \
|
||||||
phpstan \
|
phpstan \
|
||||||
pyright \
|
|
||||||
python-lsp-server \
|
python-lsp-server \
|
||||||
|
jedi-language-server \
|
||||||
|
ruff \
|
||||||
sqlls \
|
sqlls \
|
||||||
typescript-language-server \
|
typescript-language-server \
|
||||||
yaml-language-server \
|
yaml-language-server \
|
||||||
|
|
|
@ -448,10 +448,6 @@ Rename
|
||||||
|----|----|
|
|----|----|
|
||||||
|\<leader\>vt| switch display of virtual text|
|
|\<leader\>vt| switch display of virtual text|
|
||||||
|\<leader\>xx| Open diagnostics window|
|
|\<leader\>xx| Open diagnostics window|
|
||||||
|\<leader\>xw |workspace diagnostics|
|
|
||||||
|\<leader\>xd |document diagnostics|
|
|
||||||
|\<leader\>xl| loclist|
|
|
||||||
|\<leader\>xq |quickfix|
|
|
||||||
|gR | lsp references |
|
|gR | lsp references |
|
||||||
|
|
||||||
#### Sessions
|
#### Sessions
|
||||||
|
|
|
@ -65,7 +65,9 @@ require("lazy").setup({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'folke/trouble.nvim',
|
'folke/trouble.nvim',
|
||||||
opts = require('plugins.trouble').config,
|
opts = {},
|
||||||
|
cmd = "Trouble",
|
||||||
|
--opts = require('plugins.trouble').config,
|
||||||
keys = require("plugins.trouble").keys
|
keys = require("plugins.trouble").keys
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -47,13 +47,13 @@ return {
|
||||||
, settings = {
|
, settings = {
|
||||||
pylsp = {
|
pylsp = {
|
||||||
plugins = {
|
plugins = {
|
||||||
rope_autoimport = { enabled = false, memory = false },
|
rope_autoimport = { enabled = true, memory = true },
|
||||||
rope_completion = { enabled = true, eager = false },
|
rope_completion = { enabled = false, eager = false },
|
||||||
rope = {
|
rope = {
|
||||||
ropeFolder = nil
|
ropeFolder = nil
|
||||||
},
|
},
|
||||||
jedi_completion = {
|
jedi_completion = {
|
||||||
enabled = true,
|
enabled = false,
|
||||||
include_params = true,
|
include_params = true,
|
||||||
include_class_objects = true,
|
include_class_objects = true,
|
||||||
include_function_objects = true,
|
include_function_objects = true,
|
||||||
|
@ -61,13 +61,16 @@ return {
|
||||||
eager = true,
|
eager = true,
|
||||||
|
|
||||||
},
|
},
|
||||||
black = {
|
jedi_definition = {
|
||||||
enabled = true
|
enabled = false,
|
||||||
},
|
},
|
||||||
jedi_hover = { enabled = true },
|
mccabe = {
|
||||||
jedi_references = { enabled = true },
|
enabled = false
|
||||||
jedi_signature_help = { enabled = true },
|
},
|
||||||
jedi_symbols = { enabled = true },
|
jedi_hover = { enabled = false },
|
||||||
|
jedi_references = { enabled = false },
|
||||||
|
jedi_signature_help = { enabled = false },
|
||||||
|
jedi_symbols = { enabled = false },
|
||||||
ruff = { enabled = false },
|
ruff = { enabled = false },
|
||||||
flake8 = {
|
flake8 = {
|
||||||
enabled = false -- ruff_lsp
|
enabled = false -- ruff_lsp
|
||||||
|
@ -88,10 +91,10 @@ return {
|
||||||
autopep8 = {
|
autopep8 = {
|
||||||
enabled = false
|
enabled = false
|
||||||
},
|
},
|
||||||
pyflakes = { enabled = true }, -- ruff_lsp
|
pyflakes = { enabled = false }, -- ruff_lsp
|
||||||
pycodestyle = { enabled = false }, -- ruff_lsp
|
pycodestyle = { enabled = false }, -- ruff_lsp
|
||||||
pydocstyle = {
|
pydocstyle = {
|
||||||
enabled = true,
|
enabled = false,
|
||||||
ignore = {
|
ignore = {
|
||||||
'D100', -- disable missing module docstring info
|
'D100', -- disable missing module docstring info
|
||||||
'D101', -- disable missing public class doc
|
'D101', -- disable missing public class doc
|
||||||
|
@ -106,14 +109,18 @@ return {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
--require 'lspconfig'.ruff_lsp.setup {
|
require 'lspconfig'.ruff.setup {
|
||||||
--on_attach = on_attach,
|
|
||||||
--capabilities = capabilities,
|
|
||||||
--}
|
|
||||||
require 'lspconfig'.pyright.setup {
|
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
|
require 'lspconfig'.jedi_language_server.setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
--require 'lspconfig'.pyright.setup {
|
||||||
|
--on_attach = on_attach,
|
||||||
|
--capabilities = capabilities,
|
||||||
|
--}
|
||||||
require 'lspconfig'.sourcekit.setup {
|
require 'lspconfig'.sourcekit.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
|
|
@ -1,57 +1,34 @@
|
||||||
return {
|
return {
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>xx", "<cmd>TroubleToggle<cr>" },
|
{
|
||||||
{ "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>" },
|
"<leader>xx",
|
||||||
{ "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>" },
|
"<cmd>Trouble diagnostics toggle<cr>",
|
||||||
{ "<leader>xl", "<cmd>TroubleToggle loclist<cr>" },
|
desc = "Diagnostics (Trouble)",
|
||||||
{ "<leader>xq", "<cmd>TroubleToggle quickfix<cr>" },
|
},
|
||||||
{ "gR", "<cmd>TroubleToggle lsp_references<cr>" }
|
{
|
||||||
|
"<leader>xX",
|
||||||
|
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
|
||||||
|
desc = "Buffer Diagnostics (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cs",
|
||||||
|
"<cmd>Trouble symbols toggle focus=false<cr>",
|
||||||
|
desc = "Symbols (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>cl",
|
||||||
|
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
|
||||||
|
desc = "LSP Definitions / references / ... (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>xL",
|
||||||
|
"<cmd>Trouble loclist toggle<cr>",
|
||||||
|
desc = "Location List (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>xQ",
|
||||||
|
"<cmd>Trouble qflist toggle<cr>",
|
||||||
|
desc = "Quickfix List (Trouble)",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
config = {
|
|
||||||
position = "bottom", -- position of the list can be: bottom, top, left, right
|
|
||||||
height = 10, -- height of the trouble list when position is top or bottom
|
|
||||||
width = 50, -- width of the list when position is left or right
|
|
||||||
icons = true, -- use devicons for filenames
|
|
||||||
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
|
|
||||||
fold_open = "", -- icon used for open folds
|
|
||||||
fold_closed = "", -- icon used for closed folds
|
|
||||||
group = true, -- group results by file
|
|
||||||
padding = true, -- add an extra new line on top of the list
|
|
||||||
action_keys = { -- key mappings for actions in the trouble list
|
|
||||||
-- map to {} to remove a mapping, for example:
|
|
||||||
-- close = {},
|
|
||||||
close = "q", -- close the list
|
|
||||||
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
|
|
||||||
refresh = "r", -- manually refresh
|
|
||||||
jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds
|
|
||||||
open_split = { "<c-x>" }, -- open buffer in new split
|
|
||||||
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
|
|
||||||
open_tab = { "<c-t>" }, -- open buffer in new tab
|
|
||||||
jump_close = { "o" }, -- jump to the diagnostic and close the list
|
|
||||||
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
|
|
||||||
toggle_preview = "P", -- toggle auto_preview
|
|
||||||
hover = "K", -- opens a small popup with the full multiline message
|
|
||||||
preview = "p", -- preview the diagnostic location
|
|
||||||
close_folds = { "zM", "zm" }, -- close all folds
|
|
||||||
open_folds = { "zR", "zr" }, -- open all folds
|
|
||||||
toggle_fold = { "zA", "za" }, -- toggle fold of current file
|
|
||||||
previous = "k", -- previous item
|
|
||||||
next = "j" -- next item
|
|
||||||
},
|
|
||||||
indent_lines = true, -- add an indent guide below the fold icons
|
|
||||||
auto_open = false, -- automatically open the list when you have diagnostics
|
|
||||||
auto_close = false, -- automatically close the list when you have no diagnostics
|
|
||||||
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
|
|
||||||
auto_fold = false, -- automatically fold a file trouble list at creation
|
|
||||||
auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
|
|
||||||
signs = {
|
|
||||||
-- icons / text used for a diagnostic
|
|
||||||
error = "",
|
|
||||||
warning = "",
|
|
||||||
hint = "",
|
|
||||||
information = "",
|
|
||||||
other = ""
|
|
||||||
},
|
|
||||||
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue