Skip to content

Commit 62ddc24

Browse files
committed
Merge branch 'master' into bugfix-style
2 parents 6367de3 + 365281c commit 62ddc24

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

packages/tailwindcss-language-server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@tailwindcss/language-server",
33
"description": "Tailwind CSS Language Server",
44
"license": "MIT",
5-
"version": "0.0.3",
5+
"version": "0.0.4",
66
"scripts": {
77
"build": "npm run clean && ncc build src/server.ts -o bin --minify && mv bin/index.js bin/tailwindcss-language-server && npm run hashbang",
88
"clean": "rimraf dist",

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ async function createProjectService(
228228
let file = normalizePath(change.file)
229229

230230
for (let ignorePattern of ignore) {
231-
if (minimatch(file, ignorePattern)) {
231+
if (minimatch(file, ignorePattern, { dot: true })) {
232232
continue
233233
}
234234
}
235235

236-
let isConfigFile = minimatch(file, `**/${CONFIG_FILE_GLOB}`)
237-
let isPackageFile = minimatch(file, '**/package.json')
236+
let isConfigFile = minimatch(file, `**/${CONFIG_FILE_GLOB}`, { dot: true })
237+
let isPackageFile = minimatch(file, '**/package.json', { dot: true })
238238
let isDependency = state.dependencies && state.dependencies.includes(change.file)
239239

240240
if (!isConfigFile && !isPackageFile && !isDependency) continue
@@ -414,6 +414,7 @@ async function createProjectService(
414414
onlyFiles: true,
415415
absolute: true,
416416
suppressErrors: true,
417+
dot: true,
417418
concurrency: Math.max(os.cpus().length, 1),
418419
})
419420
)

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ function createResolver(options: Partial<ResolveOptions> = {}): Resolver {
66
fileSystem: new CachedInputFileSystem(fs, 4000),
77
useSyncFileSystemCalls: true,
88
// cachePredicate: () => false,
9-
exportsFields: [],
10-
conditionNames: ['node'],
11-
extensions: ['.js', '.json', '.node'],
9+
conditionNames: ['node', 'require'],
1210
...options,
1311
})
1412
}

packages/tailwindcss-language-service/src/util/color.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ function getKeywordColor(value: unknown): KeywordColor | null {
4040

4141
// https://github.com/khalilgharbaoui/coloregex
4242
const colorRegex = new RegExp(
43-
`(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\\((-?[\\d.]+%?[,\\s]+){2,3}\\s*([\\d.]+%?|var\\([^)]+\\))?\\)|transparent|currentColor|${Object.keys(
43+
`(?:^|\\s|,)(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\\((-?[\\d.]+%?[,\\s]+){2,3}\\s*([\\d.]+%?|var\\([^)]+\\))?\\)|transparent|currentColor|${Object.keys(
4444
colorNames
45-
).join('|')})`,
45+
).join('|')})(?:$|\\s|,)`,
4646
'gi'
4747
)
4848

@@ -52,7 +52,12 @@ function getColorsInString(str: string): (TinyColor | KeywordColor)[] {
5252
return (
5353
str
5454
.match(colorRegex)
55-
?.map((color) => color.replace(/var\([^)]+\)/, '1'))
55+
?.map((color) =>
56+
color
57+
.trim()
58+
.replace(/^,|,$/g, '')
59+
.replace(/var\([^)]+\)/, '1')
60+
)
5661
.map((color) => getKeywordColor(color) ?? new TinyColor(color))
5762
.filter((color) => (color instanceof TinyColor ? color.isValid : true)) ?? []
5863
)

packages/tailwindcss-language-service/src/util/languages.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const htmlLanguages = [
2424
'mustache',
2525
'njk',
2626
'nunjucks',
27+
'phoenix-heex',
2728
'php',
2829
'razor',
2930
'slim',

packages/vscode-tailwindcss/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
"onStartupFinished"
4040
],
4141
"main": "dist/extension/index.js",
42+
"capabilities": {
43+
"virtualWorkspaces": false
44+
},
4245
"contributes": {
4346
"commands": [
4447
{

0 commit comments

Comments
 (0)