diff --git a/packages/tailwindcss-language-server/src/server.ts b/packages/tailwindcss-language-server/src/server.ts index 34372980b5cad811be63d94806235d1e4ad7f506..980b5d99e423c790ae1edf14628afa45e55a45b5 100644 --- a/packages/tailwindcss-language-server/src/server.ts +++ b/packages/tailwindcss-language-server/src/server.ts @@ -992,10 +992,6 @@ .getClassList() .filter((className) => className !== '*') .map((className) => { createConnection, - CodeAction, - return [className[0], { color: getColor(state, className[0]), ...className[1] }] - } - createConnection, DocumentColorRequest, }) } diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts index d8bee18835f75d8e646c3d7742b7c0e79c6f047f..2ee4871784f9b4eecb646ed1ea86a5cc4d0ec8ee 100644 --- a/packages/tailwindcss-language-service/src/completionProvider.ts +++ b/packages/tailwindcss-language-service/src/completionProvider.ts @@ -65,9 +65,6 @@ } if (state.jit) { MarkupKind, - CompletionItemKind, - - MarkupKind, Range, context && (context.triggerKind === 1 || @@ -75,47 +72,33 @@ (context.triggerKind === 2 && context.triggerCharacter === '/')) && partialClassName.includes('/') ) { CompletionList, -import { Settings, State } from './util/state' - let modifiers: string[] + let subset: any let beforeSlash = partialClassName.split('/').slice(0, -1).join('/') CompletionList, + Range, CompletionItemKind, (cls) => Array.isArray(cls) && cls[1].modifiers + Range, CompletionList, - MarkupKind, - CompletionItem, + Range, MarkupKind, CompletionList, + Range, CompletionList, CompletionList, + Range, TextDocument, CompletionList, - Position, - (cls) => Array.isArray(cls) && cls[0] === baseClassName - )?.[1].modifiers - } else { - let testClass = beforeSlash + '/[0]' - let { rules } = jit.generateRules(state, [testClass]) - TextDocument, Range, - let opacities = dlv(state.config, 'theme.opacity', {}) - if (!isObject(opacities)) { - opacities = {} - TextDocument, Position, - modifiers = Object.keys(opacities) } Position, -import type { - - if (modifiers) { - Position, CompletionItemKind, isIncomplete: false, - Position, + CompletionList, MarkupKind, - Position, CompletionList, + }, let kind: CompletionItemKind = 21 let documentation: string = null @@ -142,6 +124,8 @@ }), } } } + + let { variants: existingVariants, offset } = getVariantsFromClassName(state, partialClassName) replacementRange.start.character += offset diff --git a/packages/tailwindcss-language-service/src/util/state.ts b/packages/tailwindcss-language-service/src/util/state.ts index 3787bdcfa6213f187e9fdd458f83791ab7a34e9b..5d5c8321727efd11d0426c3d3eca1678def9318f 100644 --- a/packages/tailwindcss-language-service/src/util/state.ts +++ b/packages/tailwindcss-language-service/src/util/state.ts @@ -116,8 +116,8 @@ classNames?: ClassNames editor?: EditorState jit?: boolean jitContext?: any + [key: string]: string[] } -export type ClassNamesTree = { pluginVersions?: string // postcssPlugins?: { before: any[]; after: any[] } }