vim-lsp-settings icon indicating copy to clipboard operation
vim-lsp-settings copied to clipboard

ruff lsp is weird, potentially add to readme?

Open yash-fn opened this issue 2 years ago • 1 comments

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!

yash-fn avatar Sep 04 '23 18:09 yash-fn

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,
\         }
\       }
\     }
\   },

lmmx avatar Dec 15 '23 14:12 lmmx