vim-lsp-settings
vim-lsp-settings copied to clipboard
ruff lsp is weird, potentially add to readme?
ruff-lsp global and workspace config is weird. instead of using: for workspace config:
"ruff-lsp": {
"workspace_config": {
...
}
}
it chooses to use:
"ruff-lsp": {
"initialization_options": {
"globalSettings": {
...
},
"settings": {
...
}
}
}
i.e. workspace_config becomes initialization_options.settings or initialization_options.globalSettings
Just mentioning this here for future confused users.
Thanks!
Thank you for sharing this was confusing me too! Can you share how to configure a setting this way?
I'm trying this and getting no change (the pyright config is helpfully demonstrated in the setup script)
let g:lsp_settings_filetype_python = ['ruff-lsp', 'pyright-langserver']
" Configure the Pyright and Python LSP servers
let g:lsp_settings = {
\ 'ruff-lsp': {
\ 'disabled': v:false,
\ 'initialization_options': {
\ "globalSettings": {
\ 'python': {
\ 'format': {
\ 'args': ['--unsafe-fixes']
\ }
\ }
\ }
\ }
\ },
\ 'pyright-langserver': {
\ 'disabled': v:false,
\ 'workspace_config': {
\ 'python': {
\ 'analysis': {
\ 'useLibraryCodeForTypes': v:true,
\ }
\ }
\ }
\ },