From 5e80a24fe2aa02bb1207122ee67ebc6b46928645 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Thu, 21 Mar 2024 20:06:23 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Add=20support=20for=20``?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/util/getLanguageBoundaries.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts index 7630b652..a4817e3a 100644 --- a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts +++ b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts @@ -10,7 +10,7 @@ import { getTextWithoutComments } from './doc' import { isCssLanguage } from './css' export type LanguageBoundary = { - type: 'html' | 'js' | 'css' | (string & {}); + type: 'html' | 'js' | 'jsx' | 'css' | (string & {}); range: Range lang?: string } @@ -24,6 +24,11 @@ let htmlScriptTypes = [ 'text/x-handlebars-template', ] +let jsxScriptTypes = [ + // https://github.com/tailwindlabs/tailwindcss-intellisense/issues/906 + 'text/babel', +] + let text = { text: { match: /[^]/, lineBreaks: true } } let states = { @@ -190,6 +195,8 @@ export function getLanguageBoundaries( boundaries[boundaries.length - 1].type = token.text } else if (token.type === 'type' && htmlScriptTypes.includes(token.text)) { boundaries[boundaries.length - 1].type = 'html' + } else if (token.type === 'type' && jsxScriptTypes.includes(token.text)) { + boundaries[boundaries.length - 1].type = 'jsx' } } offset += token.text.length From d195a4ec19a049ec4712f0d481d5987d6c55cd7b Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Thu, 21 Mar 2024 20:08:10 -0400 Subject: [PATCH 2/2] Update changelog --- packages/vscode-tailwindcss/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vscode-tailwindcss/CHANGELOG.md b/packages/vscode-tailwindcss/CHANGELOG.md index cc138c86..8773adba 100644 --- a/packages/vscode-tailwindcss/CHANGELOG.md +++ b/packages/vscode-tailwindcss/CHANGELOG.md @@ -5,6 +5,7 @@ - Fix crash when class regex matches an empty string (#897) - Support Astro's `class:list` attribute by default (#890) - Fix hovers and CSS conflict detection in Vue `` blocks (#930) +- Add support for `` (#932) ## 0.10.5