Merge branch 'master' into bugfix-style
commit
62ddc243d3
|
@ -2,7 +2,7 @@
|
|||
"name": "@tailwindcss/language-server",
|
||||
"description": "Tailwind CSS Language Server",
|
||||
"license": "MIT",
|
||||
"version": "0.0.3",
|
||||
"version": "0.0.4",
|
||||
"scripts": {
|
||||
"build": "npm run clean && ncc build src/server.ts -o bin --minify && mv bin/index.js bin/tailwindcss-language-server && npm run hashbang",
|
||||
"clean": "rimraf dist",
|
||||
|
|
|
@ -228,13 +228,13 @@ async function createProjectService(
|
|||
let file = normalizePath(change.file)
|
||||
|
||||
for (let ignorePattern of ignore) {
|
||||
if (minimatch(file, ignorePattern)) {
|
||||
if (minimatch(file, ignorePattern, { dot: true })) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
let isConfigFile = minimatch(file, `**/${CONFIG_FILE_GLOB}`)
|
||||
let isPackageFile = minimatch(file, '**/package.json')
|
||||
let isConfigFile = minimatch(file, `**/${CONFIG_FILE_GLOB}`, { dot: true })
|
||||
let isPackageFile = minimatch(file, '**/package.json', { dot: true })
|
||||
let isDependency = state.dependencies && state.dependencies.includes(change.file)
|
||||
|
||||
if (!isConfigFile && !isPackageFile && !isDependency) continue
|
||||
|
@ -414,6 +414,7 @@ async function createProjectService(
|
|||
onlyFiles: true,
|
||||
absolute: true,
|
||||
suppressErrors: true,
|
||||
dot: true,
|
||||
concurrency: Math.max(os.cpus().length, 1),
|
||||
})
|
||||
)
|
||||
|
|
|
@ -6,9 +6,7 @@ function createResolver(options: Partial<ResolveOptions> = {}): Resolver {
|
|||
fileSystem: new CachedInputFileSystem(fs, 4000),
|
||||
useSyncFileSystemCalls: true,
|
||||
// cachePredicate: () => false,
|
||||
exportsFields: [],
|
||||
conditionNames: ['node'],
|
||||
extensions: ['.js', '.json', '.node'],
|
||||
conditionNames: ['node', 'require'],
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -40,9 +40,9 @@ function getKeywordColor(value: unknown): KeywordColor | null {
|
|||
|
||||
// https://github.com/khalilgharbaoui/coloregex
|
||||
const colorRegex = new RegExp(
|
||||
`(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\\((-?[\\d.]+%?[,\\s]+){2,3}\\s*([\\d.]+%?|var\\([^)]+\\))?\\)|transparent|currentColor|${Object.keys(
|
||||
`(?:^|\\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(
|
||||
colorNames
|
||||
).join('|')})`,
|
||||
).join('|')})(?:$|\\s|,)`,
|
||||
'gi'
|
||||
)
|
||||
|
||||
|
@ -52,7 +52,12 @@ function getColorsInString(str: string): (TinyColor | KeywordColor)[] {
|
|||
return (
|
||||
str
|
||||
.match(colorRegex)
|
||||
?.map((color) => color.replace(/var\([^)]+\)/, '1'))
|
||||
?.map((color) =>
|
||||
color
|
||||
.trim()
|
||||
.replace(/^,|,$/g, '')
|
||||
.replace(/var\([^)]+\)/, '1')
|
||||
)
|
||||
.map((color) => getKeywordColor(color) ?? new TinyColor(color))
|
||||
.filter((color) => (color instanceof TinyColor ? color.isValid : true)) ?? []
|
||||
)
|
||||
|
|
|
@ -24,6 +24,7 @@ export const htmlLanguages = [
|
|||
'mustache',
|
||||
'njk',
|
||||
'nunjucks',
|
||||
'phoenix-heex',
|
||||
'php',
|
||||
'razor',
|
||||
'slim',
|
||||
|
|
|
@ -39,6 +39,9 @@
|
|||
"onStartupFinished"
|
||||
],
|
||||
"main": "dist/extension/index.js",
|
||||
"capabilities": {
|
||||
"virtualWorkspaces": false
|
||||
},
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue