File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
packages/tailwindcss-language-server/src Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,8 @@ enum DocumentSelectorPriority {
211211 CONTENT_FILE = 1 ,
212212 CSS_DIRECTORY = 2 ,
213213 CONFIG_DIRECTORY = 3 ,
214- ROOT_DIRECTORY = 4 ,
214+ PACKAGE_DIRECTORY = 4 ,
215+ ROOT_DIRECTORY = 5 ,
215216}
216217type DocumentSelector = { pattern : string ; priority : DocumentSelectorPriority }
217218
@@ -1733,7 +1734,7 @@ class TW {
17331734 : [ ] ) ,
17341735 {
17351736 pattern : normalizePath ( path . join ( getPackageRoot ( path . dirname ( configPath ) , base ) , '**' ) ) ,
1736- priority : DocumentSelectorPriority . ROOT_DIRECTORY ,
1737+ priority : DocumentSelectorPriority . PACKAGE_DIRECTORY ,
17371738 } ,
17381739 ]
17391740
@@ -1744,7 +1745,16 @@ class TW {
17441745 }
17451746 }
17461747
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+ }
17481758 workspaceFolders = Object . entries ( projects ) . map ( ( [ configPath , documentSelector ] ) => {
17491759 return {
17501760 folder : base ,
You can’t perform that action at this time.
0 commit comments