Skip to content

Commit 2920da8

Browse files
committed
tidy
1 parent 3e923db commit 2920da8

File tree

1 file changed

+23
-19
lines changed
  • packages/tailwindcss-language-server/src

1 file changed

+23
-19
lines changed

packages/tailwindcss-language-server/src/server.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,40 +1567,44 @@ class TW {
15671567
contentSelector = getContentDocumentSelectorFromConfigFile(configPath, twVersion, base)
15681568
} catch {}
15691569

1570-
let documentSelector = contentSelector
1571-
.concat({
1570+
let documentSelector: DocumentSelector[] = [
1571+
{
15721572
pattern: normalizePath(filename),
15731573
priority: isCssFile
15741574
? DocumentSelectorPriority.CSS_FILE
15751575
: DocumentSelectorPriority.CONFIG_FILE,
1576-
})
1577-
.concat(
1578-
isCssFile
1579-
? {
1576+
},
1577+
...(isCssFile
1578+
? [
1579+
{
15801580
pattern: normalizePath(configPath),
15811581
priority: DocumentSelectorPriority.CONFIG_FILE,
1582-
}
1583-
: []
1584-
)
1585-
.concat({
1582+
},
1583+
]
1584+
: []),
1585+
...contentSelector,
1586+
{
15861587
pattern: normalizePath(path.join(path.dirname(filename), '**')),
15871588
priority: isCssFile
15881589
? DocumentSelectorPriority.CSS_DIRECTORY
15891590
: DocumentSelectorPriority.CONFIG_DIRECTORY,
1590-
})
1591-
.concat(
1592-
isCssFile
1593-
? {
1591+
},
1592+
...(isCssFile
1593+
? [
1594+
{
15941595
pattern: normalizePath(path.join(path.dirname(configPath), '**')),
15951596
priority: DocumentSelectorPriority.CONFIG_DIRECTORY,
1596-
}
1597-
: []
1598-
)
1599-
.concat({
1597+
},
1598+
]
1599+
: []),
1600+
{
16001601
pattern: normalizePath(path.join(getPackageRoot(path.dirname(configPath), base), '**')),
16011602
priority: DocumentSelectorPriority.ROOT_DIRECTORY,
1602-
})
1603+
},
1604+
]
1605+
16031606
projects[configPath] = [...(projects[configPath] ?? []), ...documentSelector]
1607+
16041608
if (isCssFile) {
16051609
cssFileConfigMap.set(normalizedFilename, configPath)
16061610
}

0 commit comments

Comments
 (0)