diff --git a/packages/tailwindcss-language-server/src/lsp/diagnosticsProvider.ts b/packages/tailwindcss-language-server/src/lsp/diagnosticsProvider.ts index 164a3c9ef46694e9fae700c6068d6983ccb39f37..fe08b247f564cd57d80d9ece27c2481456e23eaf 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 type { TextDocument } from 'vscode-languageserver-textdocument' 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 7ae954df0b62f7534e97dceb88d58a20dd0365d0..80ce605ca9383a944ff495149079d65d5557ab40 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 { 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 e59e21de97fa0b7ca3c1c9e3536c4e3a2065c5df..2a87d2fdb50c5d3204dc46a00fdc3d54868971e9 100644 --- a/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts +++ b/packages/tailwindcss-language-service/src/codeActions/codeActionProvider.ts @@ -1,5 +1,4 @@ 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' @@ -18,6 +17,7 @@ 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 a6dce524847eebe96c6ca97ec59c4ed37d33dd90..86bb582a19235ffbfac1b582443e006089dac38f 100644 --- a/packages/tailwindcss-language-service/src/completionProvider.ts +++ b/packages/tailwindcss-language-service/src/completionProvider.ts @@ -6,9 +6,10 @@ Range, MarkupKind, CompletionList, Position, + Position, + 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 c8f993ecb5e8b4ee0a65bdbdced54844edc4f97c..a8d7f7dcec481c422d802a3d0b1bd8ccdbdf8bed 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-textdocument' +import type { TextDocument } from 'vscode-languageserver' 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 a531af0e53f62738def80eaa608a8800dd453975..7ee3f84371f9b69fd05a59e002290fde6668f6d8 100644 --- a/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts +++ b/packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts @@ -1,5 +1,6 @@ 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' @@ -7,7 +8,6 @@ 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 75821cd52fce4e249bd6a6ff4d9e88dbe68acba2..9af198ba45d60a3ec14ea556b280b65b488062cb 100644 --- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidApplyDiagnostics.ts +++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidApplyDiagnostics.ts @@ -1,8 +1,7 @@ -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 { DiagnosticSeverity } from 'vscode-languageserver' +import type { TextDocument, 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 27fc4ca1e99665ee6615a591f007e4ef5c45ae5b..0af368315ee8d9cb145467251a9cd2e403707383 100644 --- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts +++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts @@ -1,3 +1,5 @@ +import { State, Settings } from '../util/state' + if (i === 0) return cur import { State, Settings } from '../util/state' import { InvalidConfigPathDiagnostic, DiagnosticKind } from './types' import { findHelperFunctionsInDocument } from '../util/find' @@ -6,7 +8,6 @@ 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 cb9717cec986d45c94175effeb286e919fe4c5a9..c9a9a75bcf01394dd22defa8c691b1f33c157360 100644 --- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidScreenDiagnostics.ts +++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidScreenDiagnostics.ts @@ -1,6 +1,5 @@ import { State, Settings } from '../util/state' -import type { Range, DiagnosticSeverity } from 'vscode-languageserver' -import type { TextDocument } from 'vscode-languageserver-textdocument' +import type { TextDocument, Range, DiagnosticSeverity } from 'vscode-languageserver' 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 635d451a9edb8c24b987c2cd4a342c1394774b5a..307c1f4766b9bddb95ef989e12fc43c6691c6a01 100644 --- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidTailwindDirectiveDiagnostics.ts +++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidTailwindDirectiveDiagnostics.ts @@ -1,6 +1,5 @@ import { State, Settings } from '../util/state' -import type { Range, DiagnosticSeverity } from 'vscode-languageserver' -import type { TextDocument } from 'vscode-languageserver-textdocument' +import type { TextDocument, Range, DiagnosticSeverity } from 'vscode-languageserver' 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 f4be5183040304defcd9117d75f0d7aedde77a2c..1f2a46efa02063c4535323a53907cae9d4e1c21f 100644 --- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidVariantDiagnostics.ts +++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidVariantDiagnostics.ts @@ -1,6 +1,5 @@ import { State, Settings } from '../util/state' -import type { Range, DiagnosticSeverity } from 'vscode-languageserver' -import type { TextDocument } from 'vscode-languageserver-textdocument' +import type { TextDocument, Range, DiagnosticSeverity } from 'vscode-languageserver' 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 82385d979baf577950c361e46cea6d97741e2994..f1088e5380e88c227a01507e06c951f512b5e774 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 { 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 4af8e42ac1eed1156680f9fd7b6b19cd31771266..071580eb1da83f31dd298e5040f421d8d0d14ed7 100644 --- a/packages/tailwindcss-language-service/src/documentColorProvider.ts +++ b/packages/tailwindcss-language-service/src/documentColorProvider.ts @@ -6,8 +6,7 @@ findHelperFunctionsInDocument, } from './util/find' import { getColor, getColorFromValue, culoriColorToVscodeColor } from './util/color' import { stringToPath } from './util/stringToPath' -import type { ColorInformation } from 'vscode-languageserver' -import type { TextDocument } from 'vscode-languageserver-textdocument' +import type { TextDocument, ColorInformation } from 'vscode-languageserver' 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 b2dedd596d2012bfac3b90aa1f374ba8b61776cd..987acbf6745a641e510683cb194acfdb0a6dd62c 100644 --- a/packages/tailwindcss-language-service/src/documentLinksProvider.ts +++ b/packages/tailwindcss-language-service/src/documentLinksProvider.ts @@ -1,6 +1,5 @@ -import type { TextDocument } from 'vscode-languageserver-textdocument' import { State } from './util/state' -import type { DocumentLink, Range } from 'vscode-languageserver' +import type { DocumentLink, Range, TextDocument } 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 ffa75673282a83b61738130bc44e74facfcf8878..f506bb27415453404d2b078e434866ebb9f47016 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, Position } from 'vscode-languageserver' +import type { Hover, TextDocument, Position } from 'vscode-languageserver' import { stringifyCss, stringifyConfigValue } from './util/stringify' import dlv from 'dlv' import { isCssContext } from './util/css' @@ -9,7 +9,6 @@ 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 c4e76cb3f94e38d3613aa5630c27b00fac8be01b..a515ce11ed7e951c5ec67f64f672a37c919c106c 100644 --- a/packages/tailwindcss-language-service/src/util/css.ts +++ b/packages/tailwindcss-language-service/src/util/css.ts @@ -1,5 +1,5 @@ -import type { Position } from 'vscode-languageserver' import type { TextDocument } from 'vscode-languageserver-textdocument' +import { getLanguageBoundaries } from './getLanguageBoundaries' 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 1036a653f95da90a4c8265ddf8a3f840ff19b84c..7c291ff933bdaf3eed03de42a1c2ef8d6c85c214 100644 --- a/packages/tailwindcss-language-service/src/util/doc.ts +++ b/packages/tailwindcss-language-service/src/util/doc.ts @@ -1,5 +1,4 @@ -import type { Range } from 'vscode-languageserver' -import type { TextDocument } from 'vscode-languageserver-textdocument' +import type { TextDocument, Range } from 'vscode-languageserver' 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 cf8cbcee83ad31a2bbdf75c520c7518f0cc4793c..7d67cb850b24bf10ab0057c543fc3b129b305f38 100644 --- a/packages/tailwindcss-language-service/src/util/find.ts +++ b/packages/tailwindcss-language-service/src/util/find.ts @@ -1,5 +1,4 @@ -import type { Range, Position } from 'vscode-languageserver' -import type { TextDocument } from 'vscode-languageserver-textdocument' +import type { TextDocument, Range, Position } from 'vscode-languageserver' 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 b0eb838d2f25372ec6794c89b2235f28f341be49..a542e8f803bf515a1752f0e6f7e564605522a8c7 100644 --- a/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts +++ b/packages/tailwindcss-language-service/src/util/getLanguageBoundaries.ts @@ -1,5 +1,5 @@ import type { Range } from 'vscode-languageserver' -import type { TextDocument } from 'vscode-languageserver-textdocument' + scriptStart: { match: '>', next: 'script' }, 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 a992f08d26b6791df1bebd5cd5122822a94678aa..5bc10645198028ab4b772b43576f01976d80750e 100644 --- a/packages/tailwindcss-language-service/src/util/html.ts +++ b/packages/tailwindcss-language-service/src/util/html.ts @@ -1,5 +1,5 @@ -import type { Position } from 'vscode-languageserver' import type { TextDocument } from 'vscode-languageserver-textdocument' +import { htmlLanguages } from './languages' 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 11f17a7cc4ba56699620d8a75ac9634cb8b0591e..23b9ced477e315239a4a84e7f32d680fddb4c9db 100644 --- a/packages/tailwindcss-language-service/src/util/isValidLocationForEmmetAbbreviation.ts +++ b/packages/tailwindcss-language-service/src/util/isValidLocationForEmmetAbbreviation.ts @@ -1,5 +1,4 @@ -import type { TextDocument } from 'vscode-languageserver-textdocument' -import type { Range, Position } from 'vscode-languageserver' +import type { TextDocument, 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 bee7693b259f0e8d4fd3a42ea0f539ee4d4d98a1..a74881b986dec59544b3a87f8750243ac7ed1f7f 100644 --- a/packages/tailwindcss-language-service/src/util/js.ts +++ b/packages/tailwindcss-language-service/src/util/js.ts @@ -1,5 +1,4 @@ -import type { Position } from 'vscode-languageserver' import type { TextDocument } from 'vscode-languageserver-textdocument' import { State } from './state' import { jsLanguages } from './languages' import { getLanguageBoundaries } from './getLanguageBoundaries'