Skip to content

Commit 28814af

Browse files
committed
Add support for twin.macro
1 parent b3fef94 commit 28814af

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/lsp/providers/completionProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ function provideClassAttributeCompletions(
130130
end: position,
131131
})
132132

133-
const match = findLast(/(?:\b|:)class(?:Name)?=['"`{]/gi, str)
133+
const match = findLast( /(?:\b|:)class(?:Name)?=['"`{]|\btw=['"{]|\btw(?:\.\w+)?`/g, str)
134134

135135
if (match === null) {
136136
return null

src/lsp/util/find.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export function findClassListsInHtmlRange(
135135
range?: Range
136136
): DocumentClassList[] {
137137
const text = doc.getText(range)
138-
const matches = findAll(/(?:\b|:)class(?:Name)?=['"`{]/g, text)
138+
const matches = findAll(/(?:\b|:)class(?:Name)?=['"`{]|\btw=['"{]|\btw(?:\.\w+)?`/g, text)
139139
const result: DocumentClassList[] = []
140140

141141
matches.forEach((match) => {

src/lsp/util/lexers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const getClassAttributeLexer = lazy(() =>
4848
start1: { match: '"', push: 'doubleClassList' },
4949
start2: { match: "'", push: 'singleClassList' },
5050
start3: { match: '{', push: 'interpBrace' },
51+
start4: { match: '`', push: 'tickClassList' },
5152
},
5253
...classAttributeStates,
5354
})

0 commit comments

Comments
 (0)