@stylable/language-service
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -659,3 +659,4 @@ "use strict"; | ||
// selectoid is a CSS native pseudo-sclass | ||
core_1.nativePseudoClasses.indexOf(lastSelectoid.replace(':', '')) !== -1 || | ||
core_1.nativePseudoClasses.indexOf(lastSelectoid.replace(':', '')) !== | ||
-1 || | ||
allStates.hasOwnProperty(lastSelectoid.replace(':', ''))) && | ||
@@ -666,9 +667,5 @@ chunkyStates.every(cs => cs !== k)) { | ||
// if (stateDef) { | ||
const stateType = stateDef && typeof stateDef === 'object' | ||
? stateDef.type | ||
: null; | ||
const stateType = stateDef && typeof stateDef === 'object' ? stateDef.type : null; | ||
acc[k] = { | ||
path: meta.source === cur.meta.source | ||
? 'Local file' | ||
: relPath, | ||
path: meta.source === cur.meta.source ? 'Local file' : relPath, | ||
hasParam: !!stateDef, | ||
@@ -675,0 +672,0 @@ type: stateType |
@@ -1319,4 +1319,3 @@ "use strict"; | ||
meta.mappedSymbols[word].alias) { | ||
imp = stylable.resolver.resolveImport(meta.mappedSymbols[word] | ||
.alias); | ||
imp = stylable.resolver.resolveImport(meta.mappedSymbols[word].alias); | ||
} | ||
@@ -1323,0 +1322,0 @@ else if (meta.mappedSymbols[word]._kind === 'class') { |
{ | ||
"name": "@stylable/language-service", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Stylable Language Services - syntax highlighting, completions, hinting and more for the Stylable CSS preprocessor.", | ||
@@ -15,9 +15,9 @@ "main": "./cjs/index.js", | ||
"dependencies": { | ||
"@file-services/node": "^2.1.0", | ||
"@file-services/typescript": "^2.1.0", | ||
"@stylable/core": "^3.0.0", | ||
"@file-services/node": "^2.1.1", | ||
"@file-services/typescript": "^2.1.2", | ||
"@stylable/core": "^3.1.0", | ||
"css-selector-tokenizer": "^0.7.1", | ||
"postcss": "^7.0.24", | ||
"postcss": "^7.0.25", | ||
"postcss-value-parser": "^4.0.2", | ||
"typescript": "~3.7.3", | ||
"typescript": "~3.7.4", | ||
"vscode-css-languageservice": "^4.0.2", | ||
@@ -41,3 +41,3 @@ "vscode-languageserver": "^5.2.1", | ||
"license": "BSD-3-Clause", | ||
"gitHead": "ed32a3f8cb53d509705f886c14be1edb4de12b4c" | ||
"gitHead": "8a4adb3f4741359c5c9ae4f0b9a1195a78251338" | ||
} |
@@ -1098,50 +1098,41 @@ import path from 'path'; | ||
const newStates = lastNode.resolved.reduce( | ||
(acc, cur) => { | ||
let relPath = path.relative(path.dirname(meta.source), cur.meta.source); | ||
if (!relPath.startsWith('.')) { | ||
relPath = './' + relPath; | ||
} | ||
const symbol = cur.symbol; | ||
if (symbol._kind === 'class') { | ||
const symbolStates = symbol[valueMapping.states]; | ||
const newStates = lastNode.resolved.reduce((acc, cur) => { | ||
let relPath = path.relative(path.dirname(meta.source), cur.meta.source); | ||
if (!relPath.startsWith('.')) { | ||
relPath = './' + relPath; | ||
} | ||
const symbol = cur.symbol; | ||
if (symbol._kind === 'class') { | ||
const symbolStates = symbol[valueMapping.states]; | ||
if (symbolStates) { | ||
Object.keys(symbolStates).forEach(k => { | ||
if ( | ||
!acc[k] && | ||
// selectoid is a substring of current state | ||
(k.slice(0, -1).startsWith(lastSelectoid.replace(':', '')) || | ||
// selectoid is a CSS native pseudo-sclass | ||
nativePseudoClasses.indexOf( | ||
lastSelectoid.replace(':', '') | ||
) !== -1 || | ||
allStates.hasOwnProperty(lastSelectoid.replace(':', ''))) && | ||
chunkyStates.every(cs => cs !== k) | ||
) { | ||
const symbolStates = symbol[valueMapping.states]; | ||
const stateDef = symbolStates && symbolStates[k]; | ||
if (symbolStates) { | ||
Object.keys(symbolStates).forEach(k => { | ||
if ( | ||
!acc[k] && | ||
// selectoid is a substring of current state | ||
(k.slice(0, -1).startsWith(lastSelectoid.replace(':', '')) || | ||
// selectoid is a CSS native pseudo-sclass | ||
nativePseudoClasses.indexOf(lastSelectoid.replace(':', '')) !== | ||
-1 || | ||
allStates.hasOwnProperty(lastSelectoid.replace(':', ''))) && | ||
chunkyStates.every(cs => cs !== k) | ||
) { | ||
const symbolStates = symbol[valueMapping.states]; | ||
const stateDef = symbolStates && symbolStates[k]; | ||
// if (stateDef) { | ||
const stateType = | ||
stateDef && typeof stateDef === 'object' | ||
? stateDef.type | ||
: null; | ||
acc[k] = { | ||
path: | ||
meta.source === cur.meta.source | ||
? 'Local file' | ||
: relPath, | ||
hasParam: !!stateDef, | ||
type: stateType | ||
}; | ||
// } | ||
} | ||
}); | ||
} | ||
// if (stateDef) { | ||
const stateType = | ||
stateDef && typeof stateDef === 'object' ? stateDef.type : null; | ||
acc[k] = { | ||
path: meta.source === cur.meta.source ? 'Local file' : relPath, | ||
hasParam: !!stateDef, | ||
type: stateType | ||
}; | ||
// } | ||
} | ||
}); | ||
} | ||
return acc; | ||
}, | ||
{} as { [k: string]: { path: string; hasParam: boolean; type: string | null } } | ||
); | ||
} | ||
return acc; | ||
}, {} as { [k: string]: { path: string; hasParam: boolean; type: string | null } }); | ||
@@ -1148,0 +1139,0 @@ const states = Object.keys(newStates).map(k => { |
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
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
503254
8277
Updated@file-services/node@^2.1.1
Updated@stylable/core@^3.1.0
Updatedpostcss@^7.0.25
Updatedtypescript@~3.7.4