From f6b87017588b148937d3989f13a3c90b4650034e Mon Sep 17 00:00:00 2001 From: Rogin Farrer Date: Sun, 3 Mar 2024 22:04:32 -0800 Subject: fix(css_variable_lsp): improve default settings (#3046) * fix: CSS Variables LSP default settings * fix docs --------- Co-authored-by: Rogin Farrer --- .../server_configurations/css_variables.lua | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/css_variables.lua b/lua/lspconfig/server_configurations/css_variables.lua index f8abd20e..1c667ff1 100644 --- a/lua/lspconfig/server_configurations/css_variables.lua +++ b/lua/lspconfig/server_configurations/css_variables.lua @@ -5,6 +5,27 @@ return { cmd = { 'css-variables-language-server', '--stdio' }, filetypes = { 'css', 'scss', 'less' }, root_dir = util.root_pattern('package.json', '.git'), + -- Same as inlined defaults that don't seem to work without hardcoding them in the lua config + -- https://github.com/vunguyentuan/vscode-css-variables/blob/763a564df763f17aceb5f3d6070e0b444a2f47ff/packages/css-variables-language-server/src/CSSVariableManager.ts#L31-L50 + settings = { + cssVariables = { + lookupFiles = { '**/*.less', '**/*.scss', '**/*.sass', '**/*.css' }, + blacklistFolders = { + '**/.cache', + '**/.DS_Store', + '**/.git', + '**/.hg', + '**/.next', + '**/.svn', + '**/bower_components', + '**/CVS', + '**/dist', + '**/node_modules', + '**/tests', + '**/tmp', + }, + }, + }, }, docs = { description = [[ @@ -22,6 +43,25 @@ npm i -g css-variables-language-server ]], default_config = { root_dir = [[root_pattern("package.json", ".git") or bufdir]], + settings = [[ +cssVariables = { + lookupFiles = { '**/*.less', '**/*.scss', '**/*.sass', '**/*.css' }, + blacklistFolders = { + '**/.cache', + '**/.DS_Store', + '**/.git', + '**/.hg', + '**/.next', + '**/.svn', + '**/bower_components', + '**/CVS', + '**/dist', + '**/node_modules', + '**/tests', + '**/tmp', + }, +}, + ]], }, }, } -- cgit v1.2.3-70-g09d2