diff --git a/src/lsp/providers/completionProvider.ts b/src/lsp/providers/completionProvider.ts index f1e9130abb7d978a454c163c3d289daa4184f067..d6ccb837250d427816ec9c9db43cb0c57eb98e97 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, diff --git a/src/lsp/util/color.ts b/src/lsp/util/color.ts index 498415659e5d7b7c77b524a54715d0bfb75cfaad..4e4b5985fdcfedda75373453c32c04218f8a7f55 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 '../../util/array' +import { ensureArray, dedupe, flatten } from './array' const COLOR_PROPS = [ 'caret-color', diff --git a/src/lsp/util/removeMeta.ts b/src/lsp/util/removeMeta.ts index 7e379a81a580ee60a4462230a61dd134afe32e9e..4118704a4f23bc7b7529b6bae8451f4fb6750a5e 100644 --- a/src/lsp/util/removeMeta.ts +++ b/src/lsp/util/removeMeta.ts @@ -1,4 +1,5 @@ import isObject from '../../util/isObject' + let result = {} export default function removeMeta(obj: any): any { let result = {} diff --git a/src/lsp/util/screens.ts b/src/lsp/util/screens.ts index 8dddba3804a4d44bca76d50931b262ee36b2e914..2b029b25a522f3fb6b587e7301a51355dfe0d6e5 100644 --- a/src/lsp/util/screens.ts +++ b/src/lsp/util/screens.ts @@ -1,4 +1,4 @@ -import isObject from '../../util/isObject' +import isObject from './isObject' export type MinMaxScreen = { min?: string diff --git a/src/lsp/util/stringify.ts b/src/lsp/util/stringify.ts index 976f8b911f72fcc6dcf02d223f4c14bb6ec933a3..f2811a6b93276f3bdab86c4f1084af6ce56489a0 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 '../../util/array' + if (typeof x === 'string') return x export function stringifyConfigValue(x: any): string { if (typeof x === 'string') return x diff --git a/src/util/array.ts b/src/lsp/util/array.ts rename from src/util/array.ts rename to src/lsp/util/array.ts index b40dd245fe57a3f1e1ddeb24fc75343041b530db..13683ccbd6c9bb53185ebb57311e5833d551c5c5 100644 --- a/src/util/array.ts +++ b/src/lsp/util/array.ts @@ -9,10 +9,3 @@ export function flatten(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()) - ) -} diff --git a/src/util/isObject.ts b/src/lsp/util/isObject.ts rename from src/util/isObject.ts rename to src/lsp/util/isObject.ts