https://git.jolheiser.com/tailwind-ctp-intellisense.git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
diff --git a/src/extension.ts b/src/extension.ts index c0c3fecf093fc5c02759b58d9f4facfea161e890..5f796c94c1b678aeeb1c99ff1350732c2200f194 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -52,6 +52,11 @@ intellisense.dispose() return } + if (!tw) { + intellisense.dispose() + return + } + intellisense.reload(tw) } } @@ -132,8 +137,10 @@ // match emmet style syntax // e.g. .flex.items-center let lineText = text.split('\n').pop() matches = lineText.match(/\.([^()#>*^ \[\]=$@{}]*)$/i) - let parts = matches[matches.length - 1].split('.') - str = parts[parts.length - 1] + if (matches) { + let parts = matches[matches.length - 1].split('.') + str = parts[parts.length - 1] + } } if (typeof str !== 'undefined') {