File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
tailwindcss-language-service/src/util Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { getTextWithoutComments } from './doc'
10
10
import { isCssLanguage } from './css'
11
11
12
12
export type LanguageBoundary = {
13
- type : 'html' | 'js' | 'css' | ( string & { } ) ;
13
+ type : 'html' | 'js' | 'jsx' | ' css' | ( string & { } ) ;
14
14
range : Range
15
15
lang ?: string
16
16
}
@@ -24,6 +24,11 @@ let htmlScriptTypes = [
24
24
'text/x-handlebars-template' ,
25
25
]
26
26
27
+ let jsxScriptTypes = [
28
+ // https://github.com/tailwindlabs/tailwindcss-intellisense/issues/906
29
+ 'text/babel' ,
30
+ ]
31
+
27
32
let text = { text : { match : / [ ^ ] / , lineBreaks : true } }
28
33
29
34
let states = {
@@ -190,6 +195,8 @@ export function getLanguageBoundaries(
190
195
boundaries [ boundaries . length - 1 ] . type = token . text
191
196
} else if ( token . type === 'type' && htmlScriptTypes . includes ( token . text ) ) {
192
197
boundaries [ boundaries . length - 1 ] . type = 'html'
198
+ } else if ( token . type === 'type' && jsxScriptTypes . includes ( token . text ) ) {
199
+ boundaries [ boundaries . length - 1 ] . type = 'jsx'
193
200
}
194
201
}
195
202
offset += token . text . length
Original file line number Diff line number Diff line change 5
5
- Fix crash when class regex matches an empty string (#897 )
6
6
- Support Astro's ` class:list ` attribute by default (#890 )
7
7
- Fix hovers and CSS conflict detection in Vue ` <style lang="sass"> ` blocks (#930 )
8
+ - Add support for ` <script type="text/babel"> ` (#932 )
8
9
9
10
## 0.10.5
10
11
You can’t perform that action at this time.
0 commit comments