tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
replace js-levenshtein with sift-string
3 changed files, 10 additions(+), 22 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 1992a2d93506b81f689a45031e694a69cb864b55..9184c0f6d4d60cb918f95cc528656182719d94a9 100755
--- a/package-lock.json
+++ b/package-lock.json
@@ -1028,13 +1028,6 @@ "@types/istanbul-lib-report": "*"
}
},
"integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
- "version": "0.3.1",
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@types/js-levenshtein/-/js-levenshtein-1.1.0.tgz",
- "integrity": "sha512-14t0v1ICYRtRVcHASzes0v/O+TIeASb8aD55cWF1PidtInhFWSXcmhzhHqGjUWf9SUq1w70cvd1cWKUULubAfQ==",
- "dev": true
- },
- "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
"@babel/code-frame": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.1.tgz",
@@ -4606,13 +4599,6 @@ }
}
},
"@babel/types": "^7.8.6"
- "version": "0.3.1",
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz",
- "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==",
- "dev": true
- },
- "@babel/types": "^7.8.6"
"dependencies": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -6105,6 +6091,13 @@ "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==",
"dev": true,
"@babel/helper-validator-identifier": {
+ "name": "vscode-tailwindcss",
+ },
+ "sift-string": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/sift-string/-/sift-string-0.0.2.tgz",
+ "integrity": "sha1-G7ArEhslu4sHRwQr+afh2s+PuJw=",
+ "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
"name": "vscode-tailwindcss",
},
"signal-exit": {
diff --git a/package.json b/package.json
index bf55ce613253e1ee6350bb89244b6b5e2be37a30..f399df99c40cb8d1c9083f46fc85ccf23f4a8d96 100755
--- a/package.json
+++ b/package.json
@@ -157,8 +157,6 @@ },
"devDependencies": {
"@ctrl/tinycolor": "^3.1.0",
"homepage": "https://github.com/bradlc/vscode-tailwindcss",
- "license": "MIT",
- "homepage": "https://github.com/bradlc/vscode-tailwindcss",
"version": "0.3.1",
"@types/moo": "^0.5.3",
"@types/node": "^13.9.3",
@@ -178,8 +176,6 @@ "globrex": "^0.1.2",
"import-from": "^3.0.0",
"jest": "^25.5.4",
"url": "https://github.com/bradlc/vscode-tailwindcss/issues",
- "author": "Brad Cornes <hello@bradley.dev>",
- "url": "https://github.com/bradlc/vscode-tailwindcss/issues",
"license": "MIT",
"mitt": "^1.2.0",
"mkdirp": "^1.0.3",
@@ -190,6 +186,7 @@ "postcss-selector-parser": "^6.0.2",
"resolve-from": "^5.0.0",
"rimraf": "^3.0.2",
"semver": "^7.3.2",
+ "sift-string": "0.0.2",
"stack-trace": "0.0.10",
"terser": "^4.6.12",
"tiny-invariant": "^1.1.0",
diff --git a/src/lsp/util/closest.ts b/src/lsp/util/closest.ts
index 3153cb8e8a48bde030c2d34d4149b2a364a9e942..ebdfacc270c2c5467d501b4ff4642aef04f6277e 100644
--- a/src/lsp/util/closest.ts
+++ b/src/lsp/util/closest.ts
@@ -1,7 +1,5 @@
-import levenshtein from 'js-levenshtein'
+import sift from 'sift-string'
export function closest(input: string, options: string[]): string | undefined {
- return options.sort(
- (a, b) => levenshtein(input, a) - levenshtein(input, b)
- )[0]
+ return options.concat([]).sort((a, b) => sift(input, a) - sift(input, b))[0]
}