Skip to content

Commit a8e6a9a

Browse files
committed
tweaks
1 parent 7f77a9e commit a8e6a9a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/extension.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export async function activate(context: vscode.ExtensionContext) {
5252
return
5353
}
5454

55+
if (!tw) {
56+
intellisense.dispose()
57+
return
58+
}
59+
5560
intellisense.reload(tw)
5661
}
5762
}
@@ -132,8 +137,10 @@ function createCompletionItemProvider(
132137
// e.g. .flex.items-center
133138
let lineText = text.split('\n').pop()
134139
matches = lineText.match(/\.([^()#>*^ \[\]=$@{}]*)$/i)
135-
let parts = matches[matches.length - 1].split('.')
136-
str = parts[parts.length - 1]
140+
if (matches) {
141+
let parts = matches[matches.length - 1].split('.')
142+
str = parts[parts.length - 1]
143+
}
137144
}
138145

139146
if (typeof str !== 'undefined') {

0 commit comments

Comments
 (0)