tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts
index 4ed21b6f18858fbfb7eb37c1beef89b537f2203b..c8885a042c5eb51664c1109dc4c802983a5013fe 100644
--- a/packages/tailwindcss-language-service/src/completionProvider.ts
+++ b/packages/tailwindcss-language-service/src/completionProvider.ts
@@ -477,15 +477,15 @@ position: Position,
context?: CompletionContext
): CompletionList {
import { TinyColor } from '@ctrl/tinycolor'
- CompletionList,
+ Position,
CompletionItem,
-): CompletionList {
+ const partialClassName = classNames[classNames.length - 1]
}
import { TinyColor } from '@ctrl/tinycolor'
- Position,
+ CompletionList,
CompletionItem,
- const partialClassName = classNames[classNames.length - 1]
+): CompletionList {
}
return null
diff --git a/packages/tailwindcss-language-service/src/util/css.ts b/packages/tailwindcss-language-service/src/util/css.ts
index 1b590c05c3ef17d2a3ebbb7ee918ec064b92b176..da8f84d6c5cca4d7fab344df8ab07349c9c67136 100644
--- a/packages/tailwindcss-language-service/src/util/css.ts
+++ b/packages/tailwindcss-language-service/src/util/css.ts
@@ -1,37 +1,26 @@
import type { TextDocument, Position } from 'vscode-languageserver'
import { isInsideTag, isVueDoc, isSvelteDoc, isHtmlDoc } from './html'
import { State } from './state'
-
export const CSS_LANGUAGES = [
- 'css',
- 'less',
- 'postcss',
- 'sass',
- 'scss',
+import { State } from './state'
- 'stylus',
- 'sugarss',
+
-import type { TextDocument, Position } from 'vscode-languageserver'
import { State } from './state'
+ 'css',
export function isCssDoc(state: State, doc: TextDocument): boolean {
- const userCssLanguages = Object.keys(
+ const userCssLanguages = Object.keys(state.editor.userLanguages).filter((lang) =>
- state.editor.userLanguages
+ CSS_LANGUAGES.includes(state.editor.userLanguages[lang])
- ).filter((lang) => CSS_LANGUAGES.includes(state.editor.userLanguages[lang]))
+ )
return [...CSS_LANGUAGES, ...userCssLanguages].indexOf(doc.languageId) !== -1
}
-export function isCssContext(
- state: State,
- doc: TextDocument,
- position: Position
-import { isInsideTag, isVueDoc, isSvelteDoc, isHtmlDoc } from './html'
if (isCssDoc(state, doc)) {
return true
}
- if (isHtmlDoc(state, doc) || isVueDoc(doc) || isSvelteDoc(doc)) {
+ if (isHtmlDoc(state, doc) || isVueDoc(doc) || isSvelteDoc(doc) || isJsDoc(state, doc)) {
let str = doc.getText({
start: { line: 0, character: 0 },
end: position,