Skip to content

Commit 62124ba

Browse files
committed
Merge branch 'master' into v3
2 parents f0d664e + 11e097e commit 62124ba

File tree

7 files changed

+23
-24
lines changed

7 files changed

+23
-24
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,13 @@ async function createProjectService(
240240
let file = normalizePath(change.file)
241241

242242
for (let ignorePattern of ignore) {
243-
if (minimatch(file, ignorePattern)) {
243+
if (minimatch(file, ignorePattern, { dot: true })) {
244244
continue
245245
}
246246
}
247247

248-
let isConfigFile = minimatch(file, `**/${CONFIG_FILE_GLOB}`)
249-
let isPackageFile = minimatch(file, '**/package.json')
248+
let isConfigFile = minimatch(file, `**/${CONFIG_FILE_GLOB}`, { dot: true })
249+
let isPackageFile = minimatch(file, '**/package.json', { dot: true })
250250
let isDependency = state.dependencies && state.dependencies.includes(change.file)
251251

252252
if (!isConfigFile && !isPackageFile && !isDependency) continue

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

Lines changed: 1 addition & 3 deletions
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/getLanguageBoundaries.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ export interface LanguageBoundaries {
99
css: Range[]
1010
}
1111

12-
export function getLanguageBoundaries(
13-
state: State,
14-
doc: TextDocument
15-
): LanguageBoundaries | null {
12+
export function getLanguageBoundaries(state: State, doc: TextDocument): LanguageBoundaries | null {
1613
if (isVueDoc(doc)) {
1714
let text = doc.getText()
1815
let blocks = findAll(
@@ -23,10 +20,7 @@ export function getLanguageBoundaries(
2320
let cssRanges: Range[] = []
2421
for (let i = 0; i < blocks.length; i++) {
2522
let range = {
26-
start: indexToPosition(
27-
text,
28-
blocks[i].index + blocks[i].groups.open.length
29-
),
23+
start: indexToPosition(text, blocks[i].index + blocks[i].groups.open.length),
3024
end: indexToPosition(
3125
text,
3226
blocks[i].index + blocks[i][0].length - blocks[i].groups.close.length
@@ -48,7 +42,7 @@ export function getLanguageBoundaries(
4842
if (isHtmlDoc(state, doc) || isJsDoc(state, doc) || isSvelteDoc(doc)) {
4943
let text = doc.getText()
5044
let styleBlocks = findAll(
51-
/(?<open><style(?:\s[^>]*>|>)).*?(?<close><\/style>|$)/gis,
45+
/(?<open><style(?:\s[^>]*[^\/]>|\s*>)).*?(?<close><\/style>|$)/gis,
5246
text
5347
)
5448
let htmlRanges: Range[] = []
@@ -61,15 +55,10 @@ export function getLanguageBoundaries(
6155
end: indexToPosition(text, styleBlocks[i].index),
6256
})
6357
cssRanges.push({
64-
start: indexToPosition(
65-
text,
66-
styleBlocks[i].index + styleBlocks[i].groups.open.length
67-
),
58+
start: indexToPosition(text, styleBlocks[i].index + styleBlocks[i].groups.open.length),
6859
end: indexToPosition(
6960
text,
70-
styleBlocks[i].index +
71-
styleBlocks[i][0].length -
72-
styleBlocks[i].groups.close.length
61+
styleBlocks[i].index + styleBlocks[i][0].length - styleBlocks[i].groups.close.length
7362
),
7463
})
7564
currentIndex = styleBlocks[i].index + styleBlocks[i][0].length

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function isInsideTag(str: string, tag: string | string[]): boolean {
4444
let close = 0
4545
let match: RegExpExecArray
4646
let tags = Array.isArray(tag) ? tag : [tag]
47-
let regex = new RegExp(`<(?<slash>/?)(?:${tags.join('|')})\\b`, 'ig')
47+
let regex = new RegExp(`<(?<slash>/?)(?:${tags.join('|')})(?:\\s[^>]*[^\/]>|\\s*>)`, 'ig')
4848
while ((match = regex.exec(str)) !== null) {
4949
if (match.groups.slash) {
5050
close += 1

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

Lines changed: 1 addition & 0 deletions
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/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.6.15
4+
5+
- Support config files in hidden (dot) folders (#389)
6+
- Disable extension in virtual workspaces (#398)
7+
- Support `exports` fields when resolving dependencies (#412)
8+
- Add `phoenix-heex` language (#407)
9+
- Improve color parsing (#415)
10+
311
## 0.6.14
412

513
- Fix false positive error when using `theme` helper with a function value (thanks @choplin, #365)

packages/vscode-tailwindcss/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"preview": true,
66
"author": "Brad Cornes <hello@bradley.dev>",
77
"license": "MIT",
8-
"version": "0.6.14",
8+
"version": "0.6.15",
99
"homepage": "https://github.com/tailwindlabs/tailwindcss-intellisense",
1010
"bugs": {
1111
"url": "https://github.com/tailwindlabs/tailwindcss-intellisense/issues",
@@ -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)