Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/tailwindcss-language-service/src/util/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,11 @@ export async function findClassListsInRange(
range?: Range,
mode?: 'html' | 'css' | 'jsx',
includeCustom: boolean = true,
lang?: string,
): Promise<DocumentClassList[]> {
let classLists: DocumentClassList[] = []
if (mode === 'css') {
classLists = findClassListsInCssRange(state, doc, range)
classLists = findClassListsInCssRange(state, doc, range, lang)
} else if (mode === 'html' || mode === 'jsx') {
classLists = await findClassListsInHtmlRange(state, doc, mode, range)
}
Expand Down Expand Up @@ -448,11 +449,11 @@ export async function findClassNameAtPosition(
let groups = await Promise.all(
boundaries.map(async ({ type, range, lang }) => {
if (type === 'css') {
return findClassListsInCssRange(state, doc, range, lang)
return await findClassListsInRange(state, doc, range, 'css', true, lang)
}

if (type === 'html') {
return await findClassListsInHtmlRange(state, doc, 'html', range)
return await findClassListsInRange(state, doc, range, 'html')
}

if (type === 'js' || type === 'jsx') {
Expand Down
1 change: 1 addition & 0 deletions packages/vscode-tailwindcss/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Show warning when loading a config in v3 fails ([#1191](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1191))
- Better handle really long class lists in attributes and custom regexes ([#1192](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1192))
- Add support for Astro’s template literal attributes ([#1193](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1193))
- Match custom class regex in Vue templates ([#1194](https://github.com/tailwindlabs/tailwindcss-intellisense/pull/1194))

## 0.14.3

Expand Down