tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Signature
-----BEGIN PGP SIGNATURE-----
wsBcBAABCAAQBQJjtVZBCRBK7hj4Ov3rIwAA87IIAFumpGsB61FbYFGDOFQS6lS4
LJTbR3Y9lrwPirMN5FDhXiZ70f1VayUOPiLlo4wLVnv76RHoV3HWEJLcuaFX++bV
JJEaWBBJ0oryrXTKlYuqxK4XTJGBLJ7CphcK2lvZTpP+9mgqNbeyk9k5pVlpufTq
i3HooILnVhDcqY1sUm1K3tOs7FP5p6A6hW+jSIxNXKWt/uO/RLwDRRGw5rOQY2Ue
GursuBheiA2wE5yMctUw5HUM1TnF9KFb73yFSS3UZg8PHqPGqUEtHC1Y25tm+Xnt
8CsEdbwo2QTNlcgD4oQfVE8DYy38dyLEXf0R8wrtWWWqTMFc1w7VzZY6TQj4KXw=
=kWNY
-----END PGP SIGNATURE-----
diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts
index d8bee18835f75d8e646c3d7742b7c0e79c6f047f..63a5edf3b6f87daf725592ef09d841e7e54b5bae 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(/\b(?<helper>config|theme)\(\s*['"]?(?<path>[^)'"]*)$/)
+ .match(/[\s:;/*(){}](?<helper>config|theme)\(\s*['"]?(?<path>[^)'"]*)$/)
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 028386507fd40a52de8f31403401970ed5c6d8d8..1977ef89a20f15fb0a736b7aae346804e1048b42 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'
+ /(?<prefix>[\s:;/*(){}])(?<helper>config|theme)(?<innerPrefix>\(\s*)(?<path>[^)]*?)\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',