Skip to content

Commit d883eba

Browse files
committed
Change class regex to match elm source
1 parent b3fef94 commit d883eba

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

src/lib/languages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const DEFAULT_LANGUAGES = [
55
'django-html',
66
'edge',
77
'ejs',
8+
'elm',
89
'erb',
910
'gohtml',
1011
'GoHTML',

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)?(=|\s+)['"`{]/gi, 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)?(=|\s+)['"`{]/g, text)
139139
const result: DocumentClassList[] = []
140140

141141
matches.forEach((match) => {

src/lsp/util/html.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const HTML_LANGUAGES = [
77
'django-html',
88
'edge',
99
'ejs',
10+
'elm',
1011
'erb',
1112
'gohtml',
1213
'GoHTML',

0 commit comments

Comments
 (0)