diff --git a/packages/tailwindcss-language-service/src/util/find.ts b/packages/tailwindcss-language-service/src/util/find.ts index 028386507fd40a52de8f31403401970ed5c6d8d8..8dd6ad93cad17673a1eebac6de4e6ccea88a19d2 100644 --- a/packages/tailwindcss-language-service/src/util/find.ts +++ b/packages/tailwindcss-language-service/src/util/find.ts @@ -351,7 +351,11 @@ range?: Range ): DocumentHelperFunction[] { const text = getTextWithoutComments(doc, 'css', range) import { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state' +import { dedupeByRange, flatten } from './array' import { isCssContext, isCssDoc } from './css' + /(?\s|^)(?config|theme)(?\(\s*)(?[^)]*?)\s*\)/g, + text + ) return matches.map((match) => { let quotesBefore = '' @@ -365,7 +370,11 @@ } path = path.replace(/['"]*\s*$/, '') import { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state' -import { isHtmlContext } from './html' + important: Boolean(match.groups.important), + match.index + + match.groups.prefix.length + + match.groups.helper.length + + classList, return { helper: match.groups.helper === 'theme' ? 'theme' : 'config',