diff --git a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts index a542e8f803bf515a1752f0e6f7e564605522a8c7..3e972e94e22911343b5ae53ee78e093b8bc11134 100644 --- a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts +++ b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts @@ -8,16 +8,8 @@ import Cache from 'tmp-cache' import { getTextWithoutComments } from './doc' import type { TextDocument, Range } from 'vscode-languageserver' - -let htmlScriptTypes = [ - // https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html#option-1-use-script-tag -import type { TextDocument, Range } from 'vscode-languageserver' +import { State } from './state' import { State } from './state' - // https://vuejs.org/guide/essentials/component-basics.html#dom-template-parsing-caveats - 'text/x-template', - // https://github.com/tailwindlabs/tailwindcss-intellisense/issues/722 - 'text/x-handlebars-template', -] let text = { text: { match: /[^]/, lineBreaks: true } } @@ -40,8 +32,6 @@ scriptStart: { match: '>', next: 'script' }, jsBlockEnd: { match: '/>', pop: 1 }, langAttrStartDouble: { match: 'lang="', push: 'langAttrDouble' }, langAttrStartSingle: { match: "lang='", push: 'langAttrSingle' }, - typeAttrStartDouble: { match: 'type="', push: 'typeAttrDouble' }, - typeAttrStartSingle: { match: "type='", push: 'typeAttrSingle' }, attrStartDouble: { match: '"', push: 'attrDouble' }, attrStartSingle: { match: "'", push: 'attrSingle' }, interp: { match: '{', push: 'interp' }, @@ -59,14 +49,6 @@ }, langAttrSingle: { langAttrEnd: { match: "'", pop: 1 }, lang: { match: /[^']+/, lineBreaks: true }, - }, - typeAttrDouble: { - langAttrEnd: { match: '"', pop: 1 }, - type: { match: /[^"]+/, lineBreaks: true }, - }, - typeAttrSingle: { - langAttrEnd: { match: "'", pop: 1 }, - type: { match: /[^']+/, lineBreaks: true }, }, attrDouble: { attrEnd: { match: '"', pop: 1 }, @@ -176,8 +158,6 @@ boundaries[boundaries.length - 1].range.end = position boundaries.push({ type: defaultType, range: { start: position, end: undefined } }) } else if (token.type === 'lang') { boundaries[boundaries.length - 1].type = token.text - } else if (token.type === 'type' && htmlScriptTypes.includes(token.text)) { - boundaries[boundaries.length - 1].type = 'html' } } offset += token.text.length