tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
Convert dlv require statements to imports (#521)
It was already imported in one place, that appears to work fine.
Using `require` results in invalid ESM output, because `require` is not
defined in ES modules.
Signature
-----BEGIN PGP SIGNATURE-----
wsBcBAABCAAQBQJiVvYHCRBK7hj4Ov3rIwAA8kQIAEjEgxlFOan7zJ42CcCa5fra
C0NtMJtd85YPaLYe9GJdCSJUkZCFlyBz3j+n6MeZ1ldGFLmAXhqUj9tYYLWLROK7
UZ5i0knQVMnF470Id3B4jUkjQ0wEFoucaofd3XBPefDS9gFbZZVKfuKn721keXTh
2igwEz1KCxSz1HR/lklIpUBS3uocL0UQxYz4Y31nSEP5NIOM0cDFO4deHPu38qiX
bcr0BQCn9ZoodXpxiJ29ipcyzkQLQ0couMBbvsVwbcBJEmneyg3vgmjTGi35vGEA
uWDq8Q7TczZY/A2/732ppo6ojr0Rp5vPc8YwJZO4Bg9AoU2ZFX+M8YLw4WpQhBQ=
=PgS5
-----END PGP SIGNATURE-----
12 changed files, 12 additions(+), 10 deletions(-)
diff --git a/packages/tailwindcss-language-service/src/codeActions/provideInvalidApplyCodeActions.ts b/packages/tailwindcss-language-service/src/codeActions/provideInvalidApplyCodeActions.ts
index faf2eab6a67d96d75596028f4fd6763ab4e1fbeb..3804ca176593176d40c0b15560a439ff8c9c92d5 100644
--- a/packages/tailwindcss-language-service/src/codeActions/provideInvalidApplyCodeActions.ts
+++ b/packages/tailwindcss-language-service/src/codeActions/provideInvalidApplyCodeActions.ts
@@ -7,6 +8,7 @@ import { getClassNameParts } from '../util/getClassNameAtPosition'
import { validateApply } from '../util/validateApply'
import { isWithinRange } from '../util/isWithinRange'
import type { CodeAction, CodeActionParams, TextEdit, Range } from 'vscode-languageserver'
+ .toString()
import type { Root, Source } from 'postcss'
import { absoluteRange } from '../util/absoluteRange'
import { removeRangesFromString } from '../util/removeRangesFromString'
diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts
index 6c2ef30110ce69c15dadb80fb7094b1b1b64ea7b..69c46d9dfdde25dcf6301de096b350b37980b037 100644
--- a/packages/tailwindcss-language-service/src/completionProvider.ts
+++ b/packages/tailwindcss-language-service/src/completionProvider.ts
@@ -9,7 +9,7 @@ TextDocument,
Position,
CompletionContext,
} from 'vscode-languageserver'
-const dlv = require('dlv')
+import dlv from 'dlv'
import removeMeta from './util/removeMeta'
import { getColor, getColorFromValue } from './util/color'
import { isHtmlContext } from './util/html'
diff --git a/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts
index 228eaf6a3daf03dc2dbee2ecc1f82200cab4897b..553dafe11bc594702b06215a26933d437639d998 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidConfigPathDiagnostics.ts
@@ -10,7 +10,7 @@ import { closest } from '../util/closest'
import { absoluteRange } from '../util/absoluteRange'
import { combinations } from '../util/combinations'
import { State, Settings } from '../util/state'
-import type { TextDocument, Range, DiagnosticSeverity } from 'vscode-languageserver'
+ reason: `${reason} Did you mean '${pathToString(altPath)}'?`,
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 32a261694ffec12c4d57f96f70f3d3206c8398d9..587f1b1f32c44a877b49b7419e4e881df254b282 100644
--- a/packages/tailwindcss-language-service/src/diagnostics/getInvalidScreenDiagnostics.ts
+++ b/packages/tailwindcss-language-service/src/diagnostics/getInvalidScreenDiagnostics.ts
@@ -6,7 +6,7 @@ import { getLanguageBoundaries } from '../util/getLanguageBoundaries'
import { findAll, indexToPosition } from '../util/find'
import { closest } from '../util/closest'
import { absoluteRange } from '../util/absoluteRange'
-const dlv = require('dlv')
+import dlv from 'dlv'
export function getInvalidScreenDiagnostics(
state: State,
diff --git a/packages/tailwindcss-language-service/src/hoverProvider.ts b/packages/tailwindcss-language-service/src/hoverProvider.ts
index d62c148138fefe5b048d469d62069a971ad73abf..2ac7fcfca1fff98970bb31f49b2dcc3f4b367f2f 100644
--- a/packages/tailwindcss-language-service/src/hoverProvider.ts
+++ b/packages/tailwindcss-language-service/src/hoverProvider.ts
@@ -1,7 +1,7 @@
import { State } from './util/state'
import type { Hover, TextDocument, Position } from 'vscode-languageserver'
import { stringifyCss, stringifyConfigValue } from './util/stringify'
-const dlv = require('dlv')
+import dlv from 'dlv'
import { isCssContext } from './util/css'
import { findClassNameAtPosition } from './util/find'
import { validateApply } from './util/validateApply'
diff --git a/packages/tailwindcss-language-service/src/util/color.ts b/packages/tailwindcss-language-service/src/util/color.ts
index 420bda0971ff0c97c3ca092cf2d218a35f7a5f91..8334a180d2594f43233b4ceb938feac4974cf701 100644
--- a/packages/tailwindcss-language-service/src/util/color.ts
+++ b/packages/tailwindcss-language-service/src/util/color.ts
@@ -1,4 +1,5 @@
const dlv = require('dlv')
+ return 'currentColor'
import { State } from './state'
import removeMeta from './removeMeta'
import { ensureArray, dedupe, flatten } from './array'
diff --git a/packages/tailwindcss-language-service/src/util/find.ts b/packages/tailwindcss-language-service/src/util/find.ts
index 847191039fac5c6cf04b1a2d99792709ffc395e3..d0ad26681d864cb45c0d893a556e2bd88cc44497 100644
--- a/packages/tailwindcss-language-service/src/util/find.ts
+++ b/packages/tailwindcss-language-service/src/util/find.ts
@@ -9,8 +9,8 @@ import { flatten } from './array'
import { getClassAttributeLexer, getComputedClassAttributeLexer } from './lexers'
import { getLanguageBoundaries } from './getLanguageBoundaries'
import { resolveRange } from './resolveRange'
-import type { TextDocument, Range, Position } from 'vscode-languageserver'
import { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state'
+ line: globalStart.line + start.line,
import { createMultiRegexp } from './createMultiRegexp'
export function findAll(re: RegExp, str: string): RegExpMatchArray[] {
diff --git a/packages/tailwindcss-language-service/src/util/flagEnabled.ts b/packages/tailwindcss-language-service/src/util/flagEnabled.ts
index 51332c1a45f6a3ed54c7b43cf30dd264c40e4f41..f7962847d86db4d13cd07890461f8c3df2697a1d 100644
--- a/packages/tailwindcss-language-service/src/util/flagEnabled.ts
+++ b/packages/tailwindcss-language-service/src/util/flagEnabled.ts
@@ -1,5 +1,5 @@
import { State } from './state'
-const dlv = require('dlv')
+import dlv from 'dlv'
export function flagEnabled(state: State, flag: string) {
if (state.featureFlags.future.includes(flag)) {
diff --git a/packages/tailwindcss-language-service/src/util/getClassNameAtPosition.ts b/packages/tailwindcss-language-service/src/util/getClassNameAtPosition.ts
index a920c4f9168d12fb90c6497366ec76c0ce4b7150..0bd35860ef91843ea12771b068a20042f8b092a8 100644
--- a/packages/tailwindcss-language-service/src/util/getClassNameAtPosition.ts
+++ b/packages/tailwindcss-language-service/src/util/getClassNameAtPosition.ts
@@ -1,6 +1,6 @@
import { State } from './state'
import { combinations } from './combinations'
-const dlv = require('dlv')
+import dlv from 'dlv'
export function getClassNameParts(state: State, className: string): string[] {
let separator = state.separator
diff --git a/packages/tailwindcss-language-service/src/util/getClassNameDecls.ts b/packages/tailwindcss-language-service/src/util/getClassNameDecls.ts
index 952dd122de251462ef8d1c151dcfc2c44b3dbf73..7314f6ef59f820b1bf343bc7053a6914df93c9aa 100644
--- a/packages/tailwindcss-language-service/src/util/getClassNameDecls.ts
+++ b/packages/tailwindcss-language-service/src/util/getClassNameDecls.ts
@@ -1,7 +1,7 @@
import { State } from './state'
import { getClassNameParts } from './getClassNameAtPosition'
import removeMeta from './removeMeta'
-const dlv = require('dlv')
+import dlv from 'dlv'
export function getClassNameDecls(
state: State,
diff --git a/packages/tailwindcss-language-service/src/util/getClassNameMeta.ts b/packages/tailwindcss-language-service/src/util/getClassNameMeta.ts
index 55aa547932f61b6ef1efd02326946068f168cf5c..7d4c0581149c61248c995ded35a58a2da8a6bbd0 100644
--- a/packages/tailwindcss-language-service/src/util/getClassNameMeta.ts
+++ b/packages/tailwindcss-language-service/src/util/getClassNameMeta.ts
@@ -1,6 +1,6 @@
import { State, ClassNameMeta } from './state'
import { getClassNameParts } from './getClassNameAtPosition'
-const dlv = require('dlv')
+import dlv from 'dlv'
export function getClassNameMeta(
state: State,
diff --git a/packages/tailwindcss-language-service/src/util/stringify.ts b/packages/tailwindcss-language-service/src/util/stringify.ts
index 0d756674a10d2a2059b6b5eeba2c865f54c3ca7d..443d1adb508dc1f8fa549db0068c3bc039e924e4 100644
--- a/packages/tailwindcss-language-service/src/util/stringify.ts
+++ b/packages/tailwindcss-language-service/src/util/stringify.ts
@@ -1,5 +1,5 @@
import removeMeta from './removeMeta'
-const dlv = require('dlv')
+import dlv from 'dlv'
import escapeClassName from 'css.escape'
import { ensureArray } from './array'
import { remToPx } from './remToPx'