File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/tailwindcss-language-service/src/util Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -296,10 +296,10 @@ export async function findClassListsInRange(
296296 mode ?: 'html' | 'css' | 'jsx' ,
297297 includeCustom : boolean = true
298298) : Promise < DocumentClassList [ ] > {
299- let classLists : DocumentClassList [ ]
299+ let classLists : DocumentClassList [ ] = [ ]
300300 if ( mode === 'css' ) {
301301 classLists = findClassListsInCssRange ( state , doc , range )
302- } else {
302+ } else if ( mode === 'html' || mode === 'jsx' ) {
303303 classLists = await findClassListsInHtmlRange ( state , doc , mode , range )
304304 }
305305 return dedupeByRange ( [
@@ -449,6 +449,8 @@ export async function findClassNameAtPosition(
449449 classNames = await findClassNamesInRange ( state , doc , searchRange , 'html' )
450450 } else if ( isJsxContext ( state , doc , position ) ) {
451451 classNames = await findClassNamesInRange ( state , doc , searchRange , 'jsx' )
452+ } else {
453+ classNames = await findClassNamesInRange ( state , doc , searchRange )
452454 }
453455
454456 if ( classNames . length === 0 ) {
You can’t perform that action at this time.
0 commit comments