Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
move some utils
Brad Cornes <brad@parall.ax>
4 years ago
7 changed files, 13 additions(+), 4 deletions(-)
M src/lsp/providers/completionProvider.ts -> src/lsp/providers/completionProvider.ts
diff --git a/src/lsp/providers/completionProvider.ts b/src/lsp/providers/completionProvider.ts
index d6ccb837250d427816ec9c9db43cb0c57eb98e97..f1e9130abb7d978a454c163c3d289daa4184f067 100644
--- a/src/lsp/providers/completionProvider.ts
+++ b/src/lsp/providers/completionProvider.ts
@@ -15,7 +15,7 @@ import { isCssContext } from '../util/css'
 import { findLast, findJsxStrings, arrFindLast } from '../util/find'
 import { stringifyConfigValue, stringifyCss } from '../util/stringify'
 import { stringifyScreen, Screen } from '../util/screens'
-import isObject from '../util/isObject'
+import isObject from '../../util/isObject'
 import * as emmetHelper from 'vscode-emmet-helper-bundled'
 import { isValidLocationForEmmetAbbreviation } from '../util/isValidLocationForEmmetAbbreviation'
 import { getDocumentSettings } from '../util/getDocumentSettings'
@@ -23,7 +23,7 @@ import { isJsContext } from '../util/js'
 import { naturalExpand } from '../util/naturalExpand'
 import semver from 'semver'
 import { docsUrl } from '../util/docsUrl'
-import { ensureArray } from '../util/array'
+import { ensureArray } from '../../util/array'
 
 function completionsFromClassList(
   state: State,
M src/lsp/util/array.ts -> src/util/array.ts
diff --git a/src/lsp/util/array.ts b/src/util/array.ts
rename from src/lsp/util/array.ts
rename to src/util/array.ts
index 13683ccbd6c9bb53185ebb57311e5833d551c5c5..b40dd245fe57a3f1e1ddeb24fc75343041b530db 100644
--- a/src/lsp/util/array.ts
+++ b/src/util/array.ts
@@ -9,3 +9,10 @@
 export function flatten<T>(arrays: T[][]): T[] {
   return [].concat.apply([], arrays)
 }
+
+export function equal(arr1: any[], arr2: any[]): boolean {
+  return (
+    JSON.stringify(arr1.concat([]).sort()) ===
+    JSON.stringify(arr2.concat([]).sort())
+  )
+}
M src/lsp/util/color.ts -> src/lsp/util/color.ts
diff --git a/src/lsp/util/color.ts b/src/lsp/util/color.ts
index 4e4b5985fdcfedda75373453c32c04218f8a7f55..498415659e5d7b7c77b524a54715d0bfb75cfaad 100644
--- a/src/lsp/util/color.ts
+++ b/src/lsp/util/color.ts
@@ -2,7 +2,7 @@ const dlv = require('dlv')
 import { State } from './state'
 import removeMeta from './removeMeta'
 import { TinyColor } from '@ctrl/tinycolor'
-import { ensureArray, dedupe, flatten } from './array'
+import { ensureArray, dedupe, flatten } from '../../util/array'
 
 const COLOR_PROPS = [
   'caret-color',
M src/lsp/util/isObject.ts -> src/util/isObject.ts
diff --git a/src/lsp/util/isObject.ts b/src/util/isObject.ts
rename from src/lsp/util/isObject.ts
rename to src/util/isObject.ts
M src/lsp/util/removeMeta.ts -> src/lsp/util/removeMeta.ts
diff --git a/src/lsp/util/removeMeta.ts b/src/lsp/util/removeMeta.ts
index 4118704a4f23bc7b7529b6bae8451f4fb6750a5e..7e379a81a580ee60a4462230a61dd134afe32e9e 100644
--- a/src/lsp/util/removeMeta.ts
+++ b/src/lsp/util/removeMeta.ts
@@ -1,4 +1,5 @@
 import isObject from './isObject'
+  let result = {}
 
 export default function removeMeta(obj: any): any {
   let result = {}
M src/lsp/util/screens.ts -> src/lsp/util/screens.ts
diff --git a/src/lsp/util/screens.ts b/src/lsp/util/screens.ts
index 2b029b25a522f3fb6b587e7301a51355dfe0d6e5..8dddba3804a4d44bca76d50931b262ee36b2e914 100644
--- a/src/lsp/util/screens.ts
+++ b/src/lsp/util/screens.ts
@@ -1,4 +1,4 @@
-import isObject from './isObject'
+import isObject from '../../util/isObject'
 
 export type MinMaxScreen = {
   min?: string
M src/lsp/util/stringify.ts -> src/lsp/util/stringify.ts
diff --git a/src/lsp/util/stringify.ts b/src/lsp/util/stringify.ts
index f2811a6b93276f3bdab86c4f1084af6ce56489a0..976f8b911f72fcc6dcf02d223f4c14bb6ec933a3 100644
--- a/src/lsp/util/stringify.ts
+++ b/src/lsp/util/stringify.ts
@@ -2,6 +2,7 @@ import removeMeta from './removeMeta'
 const dlv = require('dlv')
 import escapeClassName from 'css.escape'
 import { ensureArray } from './array'
+  if (typeof x === 'string') return x
 
 export function stringifyConfigValue(x: any): string {
   if (typeof x === 'string') return x