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 \
|
||||
phpcs \
|
||||
phpstan \
|
||||
pyright \
|
||||
python-lsp-server \
|
||||
jedi-language-server \
|
||||
ruff \
|
||||
sqlls \
|
||||
typescript-language-server \
|
||||
yaml-language-server \
|
||||
|
|
|
@ -448,10 +448,6 @@ Rename
|
|||
|----|----|
|
||||
|\<leader\>vt| switch display of virtual text|
|
||||
|\<leader\>xx| Open diagnostics window|
|
||||
|\<leader\>xw |workspace diagnostics|
|
||||
|\<leader\>xd |document diagnostics|
|
||||
|\<leader\>xl| loclist|
|
||||
|\<leader\>xq |quickfix|
|
||||
|gR | lsp references |
|
||||
|
||||
#### Sessions
|
||||
|
|
|
@ -65,7 +65,9 @@ require("lazy").setup({
|
|||
},
|
||||
{
|
||||
'folke/trouble.nvim',
|
||||
opts = require('plugins.trouble').config,
|
||||
opts = {},
|
||||
cmd = "Trouble",
|
||||
--opts = require('plugins.trouble').config,
|
||||
keys = require("plugins.trouble").keys
|
||||
},
|
||||
|
||||
|
|
|
@ -47,13 +47,13 @@ return {
|
|||
, settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
rope_autoimport = { enabled = false, memory = false },
|
||||
rope_completion = { enabled = true, eager = false },
|
||||
rope_autoimport = { enabled = true, memory = true },
|
||||
rope_completion = { enabled = false, eager = false },
|
||||
rope = {
|
||||
ropeFolder = nil
|
||||
},
|
||||
jedi_completion = {
|
||||
enabled = true,
|
||||
enabled = false,
|
||||
include_params = true,
|
||||
include_class_objects = true,
|
||||
include_function_objects = true,
|
||||
|
@ -61,13 +61,16 @@ return {
|
|||
eager = true,
|
||||
|
||||
},
|
||||
black = {
|
||||
enabled = true
|
||||
jedi_definition = {
|
||||
enabled = false,
|
||||
},
|
||||
jedi_hover = { enabled = true },
|
||||
jedi_references = { enabled = true },
|
||||
jedi_signature_help = { enabled = true },
|
||||
jedi_symbols = { enabled = true },
|
||||
mccabe = {
|
||||
enabled = false
|
||||
},
|
||||
jedi_hover = { enabled = false },
|
||||
jedi_references = { enabled = false },
|
||||
jedi_signature_help = { enabled = false },
|
||||
jedi_symbols = { enabled = false },
|
||||
ruff = { enabled = false },
|
||||
flake8 = {
|
||||
enabled = false -- ruff_lsp
|
||||
|
@ -88,10 +91,10 @@ return {
|
|||
autopep8 = {
|
||||
enabled = false
|
||||
},
|
||||
pyflakes = { enabled = true }, -- ruff_lsp
|
||||
pyflakes = { enabled = false }, -- ruff_lsp
|
||||
pycodestyle = { enabled = false }, -- ruff_lsp
|
||||
pydocstyle = {
|
||||
enabled = true,
|
||||
enabled = false,
|
||||
ignore = {
|
||||
'D100', -- disable missing module docstring info
|
||||
'D101', -- disable missing public class doc
|
||||
|
@ -106,14 +109,18 @@ return {
|
|||
}
|
||||
}
|
||||
}
|
||||
--require 'lspconfig'.ruff_lsp.setup {
|
||||
--on_attach = on_attach,
|
||||
--capabilities = capabilities,
|
||||
--}
|
||||
require 'lspconfig'.pyright.setup {
|
||||
require 'lspconfig'.ruff.setup {
|
||||
on_attach = on_attach,
|
||||
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 {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
|
|
|
@ -1,57 +1,34 @@
|
|||
return {
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>TroubleToggle<cr>" },
|
||||
{ "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>" },
|
||||
{ "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>" },
|
||||
{ "<leader>xl", "<cmd>TroubleToggle loclist<cr>" },
|
||||
{ "<leader>xq", "<cmd>TroubleToggle quickfix<cr>" },
|
||||
{ "gR", "<cmd>TroubleToggle lsp_references<cr>" }
|
||||
{
|
||||
"<leader>xx",
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
desc = "Diagnostics (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
|
||||
{
|
||||
"<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)",
|
||||
},
|
||||
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