Migrate from deprecated text document (#781)
* Removed instances of deprecated TextDocument * Replaced TextDocument type in diagnosticsmaster
parent
460d921ca3
commit
35b9d115bb
|
@ -1,4 +1,4 @@
|
|||
import { TextDocument } from 'vscode-languageserver/node'
|
||||
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'
|
||||
import isExcluded from '../util/isExcluded'
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -5,10 +5,10 @@ import type {
|
|||
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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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('--')
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -6,7 +6,8 @@ import {
|
|||
} 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'
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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 { isVueDoc, isHtmlDoc, isSvelteDoc } from './html'
|
||||
import { State } from './state'
|
||||
import { indexToPosition } from './find'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 { jsLanguages } from './languages'
|
||||
import { getLanguageBoundaries } from './getLanguageBoundaries'
|
||||
|
|
Loading…
Reference in New Issue