@stylable/language-service
Advanced tools
Comparing version 4.10.3 to 4.10.4
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -657,3 +661,3 @@ if (k2 === undefined) k2 = k; | ||
for (const [symbolName, symbol] of Object.entries(resolvedImport.getAllSymbols())) { | ||
if (symbol._kind === 'import') { | ||
if (symbol._kind === 'cssVar' && !!symbol.alias) { | ||
if (symbol.name.startsWith('--')) { | ||
@@ -669,3 +673,3 @@ const importedVar = stylable.createResolver({}).deepResolve(symbol); | ||
} | ||
else { | ||
else if (symbol._kind !== `import`) { | ||
addCompletion(symbolName, meta, symbol); | ||
@@ -889,3 +893,3 @@ } | ||
const comps = []; | ||
meta.vars.forEach((v) => { | ||
Object.values(meta.getAllStVars()).forEach((v) => { | ||
if (v.name.startsWith(inner)) { | ||
@@ -900,3 +904,3 @@ const value = (0, core_1.evalDeclarationValue)(stylable.resolver, v.text, meta, v.node); | ||
const resolvedPath = stylable.resolvePath((0, path_1.dirname)(meta.source), imp.request); | ||
stylable.fileProcessor.process(resolvedPath).vars.forEach((v) => importVars.push({ | ||
Object.values(stylable.fileProcessor.process(resolvedPath).getAllStVars()).forEach((v) => importVars.push({ | ||
name: v.name, | ||
@@ -903,0 +907,0 @@ value: v.text, |
@@ -34,3 +34,3 @@ "use strict"; | ||
const impMeta = processor.process(stylable.resolvePath((0, path_1.dirname)(meta.source), sym.import.request)); | ||
const relevantVar = impMeta.vars.find((v) => v.name === sym.name); | ||
const relevantVar = Object.values(impMeta.getAllStVars()).find((v) => v.name === sym.name); | ||
if (relevantVar) { | ||
@@ -37,0 +37,0 @@ const doc = vscode_languageserver_textdocument_1.TextDocument.create('', 'css', 0, '.gaga {border: ' + |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
{ | ||
"name": "@stylable/language-service", | ||
"version": "4.10.3", | ||
"version": "4.10.4", | ||
"description": "Stylable Language Services - syntax highlighting, completions, hinting and more for the Stylable CSS preprocessor.", | ||
@@ -16,10 +16,10 @@ "main": "dist/index.js", | ||
"@file-services/typescript": "^5.7.1", | ||
"@stylable/code-formatter": "^4.10.3", | ||
"@stylable/core": "^4.10.3", | ||
"@stylable/code-formatter": "^4.10.4", | ||
"@stylable/core": "^4.10.4", | ||
"css-selector-tokenizer": "^0.8.0", | ||
"postcss": "^8.4.5", | ||
"postcss": "^8.4.7", | ||
"postcss-value-parser": "^4.2.0", | ||
"vscode-css-languageservice": "^5.1.9", | ||
"vscode-css-languageservice": "^5.1.13", | ||
"vscode-languageserver": "^7.0.0", | ||
"vscode-languageserver-textdocument": "^1.0.3", | ||
"vscode-languageserver-textdocument": "^1.0.4", | ||
"vscode-uri": "^3.0.3" | ||
@@ -26,0 +26,0 @@ }, |
@@ -1111,3 +1111,3 @@ import path, { dirname } from 'path'; | ||
for (const [symbolName, symbol] of Object.entries(resolvedImport.getAllSymbols())) { | ||
if (symbol._kind === 'import') { | ||
if (symbol._kind === 'cssVar' && !!symbol.alias) { | ||
if (symbol.name.startsWith('--')) { | ||
@@ -1124,3 +1124,3 @@ const importedVar = stylable.createResolver({}).deepResolve(symbol); | ||
} | ||
} else { | ||
} else if (symbol._kind !== `import`) { | ||
addCompletion(symbolName, meta, symbol); | ||
@@ -1478,3 +1478,3 @@ } | ||
const comps: Completion[] = []; | ||
meta.vars.forEach((v) => { | ||
Object.values(meta.getAllStVars()).forEach((v) => { | ||
if (v.name.startsWith(inner)) { | ||
@@ -1503,3 +1503,5 @@ const value = evalDeclarationValue(stylable.resolver, v.text, meta, v.node); | ||
const resolvedPath = stylable.resolvePath(dirname(meta.source), imp.request); | ||
stylable.fileProcessor.process(resolvedPath).vars.forEach((v) => | ||
Object.values( | ||
stylable.fileProcessor.process(resolvedPath).getAllStVars() | ||
).forEach((v) => | ||
importVars.push({ | ||
@@ -1506,0 +1508,0 @@ name: v.name, |
@@ -53,3 +53,3 @@ import type { IFileSystem } from '@file-services/types'; | ||
); | ||
const relevantVar = impMeta.vars.find((v) => v.name === sym.name); | ||
const relevantVar = Object.values(impMeta.getAllStVars()).find((v) => v.name === sym.name); | ||
if (relevantVar) { | ||
@@ -56,0 +56,0 @@ const doc = TextDocument.create( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
549484
8899
+ Addedabbrev@3.0.0(transitive)
+ Addedglob@11.0.1(transitive)
+ Addedjackspeak@4.0.2(transitive)
+ Addedjs-beautify@1.15.2(transitive)
+ Addedlru-cache@11.0.2(transitive)
+ Addedminimatch@10.0.1(transitive)
+ Addednopt@8.1.0(transitive)
+ Addedpath-scurry@2.0.0(transitive)
- Removed@pkgjs/parseargs@0.11.0(transitive)
- Removedabbrev@2.0.0(transitive)
- Removedglob@10.4.5(transitive)
- Removedjackspeak@3.4.3(transitive)
- Removedjs-beautify@1.15.1(transitive)
- Removedlru-cache@10.4.3(transitive)
- Removedminimatch@9.0.5(transitive)
- Removednopt@7.2.1(transitive)
- Removedpath-scurry@1.11.1(transitive)
Updated@stylable/core@^4.10.4
Updatedpostcss@^8.4.7