tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
Migrate from deprecated text document (#781)
* Removed instances of deprecated TextDocument
* Replaced TextDocument type in diagnostics
Signature
-----BEGIN PGP SIGNATURE-----
wsBcBAABCAAQBQJkYge3CRBK7hj4Ov3rIwAAavIIAFElBaIJ+kLziUfbqZGZ88Ue
6a98jrF6LhIZTkmHusbiBFu2H3px0zoeZtk+1UrIg5auDoNd81VhI2Zs7jQc0DOZ
QDunM453iUAoWCIdx81xwqT5ye2qCq4lFSs3C/LWhlK6b8mldFzI3hc7E2hMQjJP
KEbDDDtdGI4mjqaHDF2d/KxOxcSi3rUCSW34qhqbhROX5m0tM7AZvd4qiG1AVw9O
IywgkJ2KkXrZtuvHLK51MYbquF3X9awsBi8962ZY/cFOXG+TwtPWkDiFlU+Gff3x
J5RX9dd/nCKC8l3WzuHljIO2n7L25YRnfmHT16m8tGirN5gOJPou+WQfx7kTcx4=
=cuLA
-----END PGP SIGNATURE-----
22 changed files, 36 additions(+), 19 deletions(-)
diff --git a/packages/tailwindcss-language-server/src/lsp/diagnosticsProvider.ts b/packages/tailwindcss-language-server/src/lsp/diagnosticsProvider.ts
index fe08b247f564cd57d80d9ece27c2481456e23eaf..164a3c9ef46694e9fae700c6068d6983ccb39f37 100644
--- a/packages/tailwindcss-language-server/src/lsp/diagnosticsProvider.ts
+++ b/packages/tailwindcss-language-server/src/lsp/diagnosticsProvider.ts
@@ -1,3 +1,4 @@
+import { State } from 'tailwindcss-language-service/src/util/state'
import { TextDocument } from 'vscode-languageserver/node'
import { State } from 'tailwindcss-language-service/src/util/state'
import { doValidate } from 'tailwindcss-language-service/src/diagnostics/diagnosticsProvider'
diff --git a/packages/tailwindcss-language-server/src/util/isExcluded.ts b/packages/tailwindcss-language-server/src/util/isExcluded.ts
index 80ce605ca9383a944ff495149079d65d5557ab40..7ae954df0b62f7534e97dceb88d58a20dd0365d0 100644
--- a/packages/tailwindcss-language-server/src/util/isExcluded.ts
+++ b/packages/tailwindcss-language-server/src/util/isExcluded.ts
@@ -1,7 +1,7 @@
import minimatch from 'minimatch'
import * as path from 'path'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { State } from 'tailwindcss-language-service/src/util/state'
-import { TextDocument } from 'vscode-languageserver-textdocument'
import { getFileFsPath } from './uri'
export default async function isExcluded(
diff --git a/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts b/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts
index 2a87d2fdb50c5d3204dc46a00fdc3d54868971e9..e59e21de97fa0b7ca3c1c9e3536c4e3a2065c5df 100644
--- a/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts
+++ b/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts
@@ -1,4 +1,5 @@
import type { CodeAction, CodeActionParams } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { State } from '../util/state'
import { doValidate } from '../diagnostics/diagnosticsProvider'
import { rangesEqual } from '../util/rangesEqual'
@@ -17,7 +18,6 @@ import { flatten, dedupeBy } from '../util/array'
import { provideCssConflictCodeActions } from './provideCssConflictCodeActions'
import { provideInvalidApplyCodeActions } from './provideInvalidApplyCodeActions'
import { provideSuggestionCodeActions } from './provideSuggestionCodeActions'
-import { TextDocument } from 'vscode-languageserver-textdocument'
async function getDiagnosticsFromCodeActionParams(
state: State,
diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts
index 86bb582a19235ffbfac1b582443e006089dac38f..a6dce524847eebe96c6ca97ec59c4ed37d33dd90 100644
--- a/packages/tailwindcss-language-service/src/completionProvider.ts
+++ b/packages/tailwindcss-language-service/src/completionProvider.ts
@@ -5,10 +5,10 @@ CompletionItemKind,
Range,
MarkupKind,
CompletionList,
- TextDocument,
Position,
CompletionContext,
} from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import dlv from 'dlv'
import removeMeta from './util/removeMeta'
import { getColor, getColorFromValue } from './util/color'
diff --git a/packages/tailwindcss-language-service/src/diagnostics/diagnosticsProvider.ts b/packages/tailwindcss-language-service/src/diagnostics/diagnosticsProvider.ts
index a8d7f7dcec481c422d802a3d0b1bd8ccdbdf8bed..c8f993ecb5e8b4ee0a65bdbdced54844edc4f97c 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/diagnosticsProvider.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/diagnosticsProvider.ts
@@ -1,4 +1,4 @@
-import type { TextDocument } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { State } from '../util/state'
import { DiagnosticKind, AugmentedDiagnostic } from './types'
import { getCssConflictDiagnostics } from './getCssConflictDiagnostics'
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts
index 7ee3f84371f9b69fd05a59e002290fde6668f6d8..a531af0e53f62738def80eaa608a8800dd453975 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts
@@ -1,6 +1,5 @@
import { joinWithAnd } from '../util/joinWithAnd'
import { State, Settings } from '../util/state'
-import type { TextDocument } from 'vscode-languageserver'
import { CssConflictDiagnostic, DiagnosticKind } from './types'
import { findClassListsInDocument, getClassNamesInClassList } from '../util/find'
import { getClassNameDecls } from '../util/getClassNameDecls'
@@ -8,6 +7,7 @@ import { getClassNameMeta } from '../util/getClassNameMeta'
import { equal } from '../util/array'
import * as jit from '../util/jit'
import type { AtRule, Node, Rule } from 'postcss'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
function isCustomProperty(property: string): boolean {
return property.startsWith('--')
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getInvalidApplyDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getInvalidApplyDiagnostics.ts
index 9af198ba45d60a3ec14ea556b280b65b488062cb..75821cd52fce4e249bd6a6ff4d9e88dbe68acba2 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidApplyDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidApplyDiagnostics.ts
@@ -1,7 +1,8 @@
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { findClassNamesInRange } from '../util/find'
import { InvalidApplyDiagnostic, DiagnosticKind } from './types'
import { Settings, State } from '../util/state'
-import type { TextDocument, DiagnosticSeverity } from 'vscode-languageserver'
+import type { DiagnosticSeverity } from 'vscode-languageserver'
import { validateApply } from '../util/validateApply'
export async function getInvalidApplyDiagnostics(
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts
index 0af368315ee8d9cb145467251a9cd2e403707383..27fc4ca1e99665ee6615a591f007e4ef5c45ae5b 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts
@@ -1,5 +1,4 @@
import { State, Settings } from '../util/state'
-import type { TextDocument } from 'vscode-languageserver'
import { InvalidConfigPathDiagnostic, DiagnosticKind } from './types'
import { findHelperFunctionsInDocument } from '../util/find'
import { stringToPath } from '../util/stringToPath'
@@ -7,6 +6,7 @@ import isObject from '../util/isObject'
import { closest } from '../util/closest'
import { combinations } from '../util/combinations'
import dlv from 'dlv'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
function pathToString(path: string | string[]): string {
if (typeof path === 'string') return path
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getInvalidScreenDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getInvalidScreenDiagnostics.ts
index c9a9a75bcf01394dd22defa8c691b1f33c157360..cb9717cec986d45c94175effeb286e919fe4c5a9 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidScreenDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidScreenDiagnostics.ts
@@ -1,5 +1,6 @@
import { State, Settings } from '../util/state'
-import type { TextDocument, Range, DiagnosticSeverity } from 'vscode-languageserver'
+import type { Range, DiagnosticSeverity } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { InvalidScreenDiagnostic, DiagnosticKind } from './types'
import { isCssDoc } from '../util/css'
import { getLanguageBoundaries } from '../util/getLanguageBoundaries'
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getInvalidTailwindDirectiveDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getInvalidTailwindDirectiveDiagnostics.ts
index 307c1f4766b9bddb95ef989e12fc43c6691c6a01..635d451a9edb8c24b987c2cd4a342c1394774b5a 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidTailwindDirectiveDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidTailwindDirectiveDiagnostics.ts
@@ -1,5 +1,6 @@
import { State, Settings } from '../util/state'
-import type { TextDocument, Range, DiagnosticSeverity } from 'vscode-languageserver'
+import type { Range, DiagnosticSeverity } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { InvalidTailwindDirectiveDiagnostic, DiagnosticKind } from './types'
import { isCssDoc } from '../util/css'
import { getLanguageBoundaries } from '../util/getLanguageBoundaries'
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getInvalidVariantDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getInvalidVariantDiagnostics.ts
index 1f2a46efa02063c4535323a53907cae9d4e1c21f..f4be5183040304defcd9117d75f0d7aedde77a2c 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidVariantDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidVariantDiagnostics.ts
@@ -1,5 +1,6 @@
import { State, Settings } from '../util/state'
-import type { TextDocument, Range, DiagnosticSeverity } from 'vscode-languageserver'
+import type { Range, DiagnosticSeverity } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { InvalidVariantDiagnostic, DiagnosticKind } from './types'
import { isCssDoc } from '../util/css'
import { getLanguageBoundaries } from '../util/getLanguageBoundaries'
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts
index f1088e5380e88c227a01507e06c951f512b5e774..82385d979baf577950c361e46cea6d97741e2994 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts
@@ -1,5 +1,5 @@
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { State, Settings } from '../util/state'
-import type { TextDocument } from 'vscode-languageserver'
import { RecommendedVariantOrderDiagnostic, DiagnosticKind } from './types'
import { findClassListsInDocument, getClassNamesInClassList } from '../util/find'
import * as jit from '../util/jit'
diff --git a/packages/tailwindcss-language-service/src/documentColorProvider.ts b/packages/tailwindcss-language-service/src/documentColorProvider.ts
index 071580eb1da83f31dd298e5040f421d8d0d14ed7..4af8e42ac1eed1156680f9fd7b6b19cd31771266 100644
--- a/packages/tailwindcss-language-service/src/documentColorProvider.ts
+++ b/packages/tailwindcss-language-service/src/documentColorProvider.ts
@@ -6,7 +6,8 @@ findHelperFunctionsInDocument,
} from './util/find'
import { getColor, getColorFromValue, culoriColorToVscodeColor } from './util/color'
import { stringToPath } from './util/stringToPath'
-import type { TextDocument, ColorInformation } from 'vscode-languageserver'
+import type { ColorInformation } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import dlv from 'dlv'
import { dedupeByRange } from './util/array'
diff --git a/packages/tailwindcss-language-service/src/documentLinksProvider.ts b/packages/tailwindcss-language-service/src/documentLinksProvider.ts
index 987acbf6745a641e510683cb194acfdb0a6dd62c..b2dedd596d2012bfac3b90aa1f374ba8b61776cd 100644
--- a/packages/tailwindcss-language-service/src/documentLinksProvider.ts
+++ b/packages/tailwindcss-language-service/src/documentLinksProvider.ts
@@ -1,5 +1,6 @@
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { State } from './util/state'
-import type { DocumentLink, Range, TextDocument } from 'vscode-languageserver'
+import type { DocumentLink, Range } from 'vscode-languageserver'
import { isCssDoc } from './util/css'
import { getLanguageBoundaries } from './util/getLanguageBoundaries'
import { findAll, indexToPosition } from './util/find'
diff --git a/packages/tailwindcss-language-service/src/hoverProvider.ts b/packages/tailwindcss-language-service/src/hoverProvider.ts
index f506bb27415453404d2b078e434866ebb9f47016..ffa75673282a83b61738130bc44e74facfcf8878 100644
--- a/packages/tailwindcss-language-service/src/hoverProvider.ts
+++ b/packages/tailwindcss-language-service/src/hoverProvider.ts
@@ -1,5 +1,5 @@
import { State } from './util/state'
-import type { Hover, TextDocument, Position } from 'vscode-languageserver'
+import type { Hover, Position } from 'vscode-languageserver'
import { stringifyCss, stringifyConfigValue } from './util/stringify'
import dlv from 'dlv'
import { isCssContext } from './util/css'
@@ -9,6 +9,7 @@ import { getClassNameParts } from './util/getClassNameAtPosition'
import * as jit from './util/jit'
import { validateConfigPath } from './diagnostics/getInvalidConfigPathDiagnostics'
import { isWithinRange } from './util/isWithinRange'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
export async function doHover(
state: State,
diff --git a/packages/tailwindcss-language-service/src/util/css.ts b/packages/tailwindcss-language-service/src/util/css.ts
index a515ce11ed7e951c5ec67f64f672a37c919c106c..c4e76cb3f94e38d3613aa5630c27b00fac8be01b 100644
--- a/packages/tailwindcss-language-service/src/util/css.ts
+++ b/packages/tailwindcss-language-service/src/util/css.ts
@@ -1,4 +1,5 @@
-import type { TextDocument, Position } from 'vscode-languageserver'
+import type { Position } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { isVueDoc, isSvelteDoc, isHtmlDoc } from './html'
import { isJsDoc } from './js'
import { State } from './state'
diff --git a/packages/tailwindcss-language-service/src/util/doc.ts b/packages/tailwindcss-language-service/src/util/doc.ts
index 7c291ff933bdaf3eed03de42a1c2ef8d6c85c214..1036a653f95da90a4c8265ddf8a3f840ff19b84c 100644
--- a/packages/tailwindcss-language-service/src/util/doc.ts
+++ b/packages/tailwindcss-language-service/src/util/doc.ts
@@ -1,4 +1,5 @@
-import type { TextDocument, Range } from 'vscode-languageserver'
+import type { Range } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import moo from 'moo'
export function getTextWithoutComments(
diff --git a/packages/tailwindcss-language-service/src/util/find.ts b/packages/tailwindcss-language-service/src/util/find.ts
index 7d67cb850b24bf10ab0057c543fc3b129b305f38..cf8cbcee83ad31a2bbdf75c520c7518f0cc4793c 100644
--- a/packages/tailwindcss-language-service/src/util/find.ts
+++ b/packages/tailwindcss-language-service/src/util/find.ts
@@ -1,4 +1,5 @@
-import type { TextDocument, Range, Position } from 'vscode-languageserver'
+import type { Range, Position } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state'
import lineColumn from 'line-column'
import { isCssContext, isCssDoc } from './css'
diff --git a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts
index a542e8f803bf515a1752f0e6f7e564605522a8c7..b0eb838d2f25372ec6794c89b2235f28f341be49 100644
--- a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts
+++ b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts
@@ -1,4 +1,6 @@
import type { TextDocument, Range } from 'vscode-languageserver'
+ scriptStart: { match: '>', next: 'script' },
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { isVueDoc, isHtmlDoc, isSvelteDoc } from './html'
import { State } from './state'
import { indexToPosition } from './find'
diff --git a/packages/tailwindcss-language-service/src/util/html.ts b/packages/tailwindcss-language-service/src/util/html.ts
index 5bc10645198028ab4b772b43576f01976d80750e..a992f08d26b6791df1bebd5cd5122822a94678aa 100644
--- a/packages/tailwindcss-language-service/src/util/html.ts
+++ b/packages/tailwindcss-language-service/src/util/html.ts
@@ -1,4 +1,5 @@
-import type { TextDocument, Position } from 'vscode-languageserver'
+import type { Position } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { State } from './state'
import { htmlLanguages } from './languages'
import { getLanguageBoundaries } from './getLanguageBoundaries'
diff --git a/packages/tailwindcss-language-service/src/util/isValidLocationForEmmetAbbreviation.ts b/packages/tailwindcss-language-service/src/util/isValidLocationForEmmetAbbreviation.ts
index 23b9ced477e315239a4a84e7f32d680fddb4c9db..11f17a7cc4ba56699620d8a75ac9634cb8b0591e 100644
--- a/packages/tailwindcss-language-service/src/util/isValidLocationForEmmetAbbreviation.ts
+++ b/packages/tailwindcss-language-service/src/util/isValidLocationForEmmetAbbreviation.ts
@@ -1,4 +1,5 @@
-import type { TextDocument, Range, Position } from 'vscode-languageserver'
+import type { TextDocument } from 'vscode-languageserver-textdocument'
+import type { Range, Position } from 'vscode-languageserver'
export function isValidLocationForEmmetAbbreviation(
document: TextDocument,
diff --git a/packages/tailwindcss-language-service/src/util/js.ts b/packages/tailwindcss-language-service/src/util/js.ts
index a74881b986dec59544b3a87f8750243ac7ed1f7f..bee7693b259f0e8d4fd3a42ea0f539ee4d4d98a1 100644
--- a/packages/tailwindcss-language-service/src/util/js.ts
+++ b/packages/tailwindcss-language-service/src/util/js.ts
@@ -1,4 +1,6 @@
import type { TextDocument, Position } from 'vscode-languageserver'
+ )
+import type { TextDocument } from 'vscode-languageserver-textdocument'
import { State } from './state'
import { jsLanguages } from './languages'
import { getLanguageBoundaries } from './getLanguageBoundaries'