File tree 1 file changed +13
-3
lines changed
packages/tailwindcss-language-server/src
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,8 @@ enum DocumentSelectorPriority {
211
211
CONTENT_FILE = 1 ,
212
212
CSS_DIRECTORY = 2 ,
213
213
CONFIG_DIRECTORY = 3 ,
214
- ROOT_DIRECTORY = 4 ,
214
+ PACKAGE_DIRECTORY = 4 ,
215
+ ROOT_DIRECTORY = 5 ,
215
216
}
216
217
type DocumentSelector = { pattern : string ; priority : DocumentSelectorPriority }
217
218
@@ -1733,7 +1734,7 @@ class TW {
1733
1734
: [ ] ) ,
1734
1735
{
1735
1736
pattern : normalizePath ( path . join ( getPackageRoot ( path . dirname ( configPath ) , base ) , '**' ) ) ,
1736
- priority : DocumentSelectorPriority . ROOT_DIRECTORY ,
1737
+ priority : DocumentSelectorPriority . PACKAGE_DIRECTORY ,
1737
1738
} ,
1738
1739
]
1739
1740
@@ -1744,7 +1745,16 @@ class TW {
1744
1745
}
1745
1746
}
1746
1747
1747
- if ( Object . keys ( projects ) . length > 0 ) {
1748
+ let projectKeys = Object . keys ( projects )
1749
+ let projectCount = projectKeys . length
1750
+
1751
+ if ( projectCount > 0 ) {
1752
+ if ( projectCount === 1 ) {
1753
+ projects [ projectKeys [ 0 ] ] . push ( {
1754
+ pattern : normalizePath ( path . join ( base , '**' ) ) ,
1755
+ priority : DocumentSelectorPriority . ROOT_DIRECTORY ,
1756
+ } )
1757
+ }
1748
1758
workspaceFolders = Object . entries ( projects ) . map ( ( [ configPath , documentSelector ] ) => {
1749
1759
return {
1750
1760
folder : base ,
You can’t perform that action at this time.
0 commit comments