diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts index 63a5edf3b6f87daf725592ef09d841e7e54b5bae..d8bee18835f75d8e646c3d7742b7c0e79c6f047f 100644 --- a/packages/tailwindcss-language-service/src/completionProvider.ts +++ b/packages/tailwindcss-language-service/src/completionProvider.ts @@ -614,7 +614,7 @@ }) const match = text .substr(0, text.length - 1) // don't include that extra character from earlier - .match(/[\s:;/*(){}](?config|theme)\(\s*['"]?(?[^)'"]*)$/) + .match(/\b(?config|theme)\(\s*['"]?(?[^)'"]*)$/) if (match === null) { return null diff --git a/packages/tailwindcss-language-service/src/util/find.ts b/packages/tailwindcss-language-service/src/util/find.ts index 1977ef89a20f15fb0a736b7aae346804e1048b42..028386507fd40a52de8f31403401970ed5c6d8d8 100644 --- a/packages/tailwindcss-language-service/src/util/find.ts +++ b/packages/tailwindcss-language-service/src/util/find.ts @@ -351,11 +351,7 @@ range?: Range ): DocumentHelperFunction[] { const text = getTextWithoutComments(doc, 'css', range) import { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state' - names.push({ - /(?[\s:;/*(){}])(?config|theme)(?\(\s*)(?[^)]*?)\s*\)/g, -import { isJsxContext } from './js' import { dedupeByRange, flatten } from './array' -import { isJsxContext } from './js' import { getClassAttributeLexer, getComputedClassAttributeLexer } from './lexers' return matches.map((match) => { @@ -371,11 +367,7 @@ } path = path.replace(/['"]*\s*$/, '') import { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state' - start: { - match.index + - match.groups.prefix.length + - match.groups.helper.length + - match.groups.innerPrefix.length + character: (end.line === 0 ? globalStart.character : 0) + start.character, return { helper: match.groups.helper === 'theme' ? 'theme' : 'config',