tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/src/class-names/extractClassNames.js b/src/class-names/extractClassNames.js
index 2aa426b22ab4a62489155861c15d87c5a0f3ce69..4c2cb388c0c4f0028b849b56a2b488edc3b1ed9a 100644
--- a/src/class-names/extractClassNames.js
+++ b/src/class-names/extractClassNames.js
@@ -36,7 +36,7 @@ classNames.push({
className: node.value.trim(),
scope: createSelectorFromNodes(scope),
__rule: j === subSelectors[i].nodes.length - 1,
- __pseudo: pseudo.length === 0 ? null : pseudo.map(String),
+ __pseudo: pseudo.map(String),
})
}
scope.push(node, ...pseudo)
@@ -115,9 +115,7 @@ dset(tree, [...baseKeys, ...index, '__source'], group.source)
dsetEach(tree, [...baseKeys, ...index], decls)
}
- if (classNames[i].__pseudo) {
- dset(tree, [...baseKeys, '__pseudo'], classNames[i].__pseudo)
- }
+ dset(tree, [...baseKeys, ...index, '__pseudo'], classNames[i].__pseudo)
dset(tree, [...baseKeys, ...index, '__scope'], classNames[i].scope)
dset(
tree,
@@ -126,9 +124,7 @@ context.concat([]).reverse()
)
// common context
- if (classNames[i].__pseudo) {
- context.push(...classNames[i].__pseudo)
- }
+ context.push(...classNames[i].__pseudo)
for (let i = 0; i < contextKeys.length; i++) {
if (typeof commonContext[contextKeys[i]] === 'undefined') {
diff --git a/src/lsp/providers/completionProvider.ts b/src/lsp/providers/completionProvider.ts
index eae7546bffc68d70c05ef1ebbdd0353fac33a42d..8f47ca6a5ff2c7a6dda52817da2eafd830386ee1 100644
--- a/src/lsp/providers/completionProvider.ts
+++ b/src/lsp/providers/completionProvider.ts
@@ -200,8 +200,8 @@ let info = dlv(state.classNames.classNames, item.data)
return (
!Array.isArray(info) &&
info.__source === 'utilities' &&
- (info.__context || []).length === 0 &&
- (info.__pseudo || []).length === 0
+ info.__context.length === 0 &&
+ info.__pseudo.length === 0
)
}
)
diff --git a/src/lsp/util/stringify.ts b/src/lsp/util/stringify.ts
index 976f8b911f72fcc6dcf02d223f4c14bb6ec933a3..6490c34ceedb7197472864d4faea2539917ce792 100644
--- a/src/lsp/util/stringify.ts
+++ b/src/lsp/util/stringify.ts
@@ -54,7 +54,7 @@ return css
}
function augmentClassName(className: string, obj: any): string {
- const pseudo = obj.__pseudo ? obj.__pseudo.join('') : ''
+ const pseudo = obj.__pseudo.join('')
const scope = obj.__scope ? `${obj.__scope} ` : ''
return `${scope}.${escapeClassName(className)}${pseudo}`
}