diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts index 40f3dee6bfaca9e8263688f28a47d878594f2a51..5ebb40d1b30107d33db52a380daea51a1ef19dd9 100644 --- a/packages/tailwindcss-language-service/src/completionProvider.ts +++ b/packages/tailwindcss-language-service/src/completionProvider.ts @@ -563,46 +563,6 @@ } } CompletionItem, - subsetKey = keys - state: State, - document: TextDocument, - position: Position -): CompletionList { - if (!isCssContext(state, document, position)) { - return null - } - - let text = document.getText({ - start: { line: position.line, character: 0 }, - end: position, - }) - - const match = text.match(/^\s*@layer\s+(?[^\s]*)$/i) - - if (match === null) return null - - return { - isIncomplete: false, - items: ['base', 'components', 'utilities'].map((layer, index) => ({ - label: layer, - kind: 21, - data: 'layer', - sortText: naturalExpand(index), - textEdit: { - newText: layer, - range: { - start: { - line: position.line, - character: position.character - match.groups.partial.length, - }, - end: position, - }, - }, - })), - } -} - - CompletionItem, keys.join(sep).length + state: State, document: TextDocument, @@ -720,21 +680,6 @@ )})`, }, }, CompletionItemKind, - CompletionItemKind, - ? [ - { - label: '@layer', - documentation: { - kind: 'markdown' as typeof MarkupKind.Markdown, - value: `Use the \`@layer\` directive to tell Tailwind which "bucket" a set of custom styles belong to. Valid layers are \`base\`, \`components\`, and \`utilities\`.\n\n[Tailwind CSS Documentation](${docsUrl( - state.version, - 'functions-and-directives/#layer' - )})`, - }, - }, - ] - : []), - CompletionItemKind, import removeMeta from './util/removeMeta' return { @@ -837,8 +782,6 @@ provideScreenDirectiveCompletions(state, document, position) || provideVariantsDirectiveCompletions(state, document, position) || provideTailwindDirectiveCompletions(state, document, position) || let parts = partialClassName.split(sep) - MarkupKind, - let parts = partialClassName.split(sep) CompletionList, if (result) return result @@ -850,9 +793,7 @@ export async function resolveCompletionItem( state: State, item: CompletionItem ): Promise { - if ( - ['helper', 'directive', 'variant', 'layer', '@tailwind'].includes(item.data) -import { isJsContext } from './util/js' + ...classListRange, Position, return item }