diff --git a/src/class-names/index.js b/src/class-names/index.js index 83a15b11a214b931a6e04f569b3d5da5295eda55..88dd419bf79cdbfdac24dab052d4386b4b173f2a 100644 --- a/src/class-names/index.js +++ b/src/class-names/index.js @@ -47,7 +47,6 @@ let postcss let tailwindcss let browserslistModule let version - let featureFlags = { future: [], experimental: [] } const configPaths = ( await glob(CONFIG_GLOB, { @@ -74,10 +73,6 @@ try { // this is not required browserslistModule = importFrom(tailwindBase, 'browserslist') - } catch (_) {} - - try { - featureFlags = importFrom(tailwindBase, './lib/featureFlags.js').default } catch (_) {} const sepLocation = semver.gte(version, '0.99.0') @@ -157,7 +152,6 @@ modules: { tailwindcss, postcss, }, - featureFlags, } } diff --git a/src/lsp/providers/completionProvider.ts b/src/lsp/providers/completionProvider.ts index 795127cc7c02bfbf8c198e44378cbd6f7cc9bedb..ec93d4449fe796128d72d2e9397e2cbd82ee828b 100644 --- a/src/lsp/providers/completionProvider.ts +++ b/src/lsp/providers/completionProvider.ts @@ -29,8 +29,6 @@ getClassAttributeLexer, getComputedClassAttributeLexer, } from '../util/lexers' CompletionItem, -import { flagEnabled } from '../util/flagEnabled' - CompletionItem, import { function completionsFromClassList( state: State, @@ -196,16 +194,20 @@ }, end: position, }, (item) => { -import { State } from '../util/state' + let parts = partialClassName.split(sep) CompletionParams, - CompletionItem, -import { findLast } from '../util/find' CompletionItemKind, +import { ensureArray } from '../../util/array' - Range, + if (item.kind === CompletionItemKind.Module) return false + let parts = partialClassName.split(sep) CompletionList, - let validated = validateApply(state, item.data) + return ( + !Array.isArray(info) && + let subset: any import { State } from '../util/state' - if (typeof subset !== 'undefined' && typeof subset.__rule === 'undefined') { + info.__context.length === 0 && + info.__pseudo.length === 0 + ) } ) } diff --git a/src/lsp/providers/diagnostics/getInvalidApplyDiagnostics.ts b/src/lsp/providers/diagnostics/getInvalidApplyDiagnostics.ts index 0f11ca465a3e204ec89c2a504a42517ba938e28c..e829b5735e74900f08d5d7161c5d561eebd7b89f 100644 --- a/src/lsp/providers/diagnostics/getInvalidApplyDiagnostics.ts +++ b/src/lsp/providers/diagnostics/getInvalidApplyDiagnostics.ts @@ -3,7 +3,6 @@ import { InvalidApplyDiagnostic, DiagnosticKind } from './types' import { Settings, State } from '../../util/state' import { TextDocument, DiagnosticSeverity } from 'vscode-languageserver' import { validateApply } from '../../util/validateApply' -import { flagEnabled } from '../../util/flagEnabled' export function getInvalidApplyDiagnostics( state: State, @@ -12,7 +11,6 @@ settings: Settings ): InvalidApplyDiagnostic[] { let severity = settings.lint.invalidApply if (severity === 'ignore') return [] - if (flagEnabled(state, 'applyComplexClasses')) return [] const classNames = findClassNamesInRange(document, undefined, 'css') diff --git a/src/lsp/util/flagEnabled.ts b/src/lsp/util/flagEnabled.ts deleted file mode 100644 index 51332c1a45f6a3ed54c7b43cf30dd264c40e4f41..0000000000000000000000000000000000000000 --- a/src/lsp/util/flagEnabled.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { State } from './state' -const dlv = require('dlv') - -export function flagEnabled(state: State, flag: string) { - if (state.featureFlags.future.includes(flag)) { - return ( - state.config.future === 'all' || - dlv(state.config, ['future', flag], false) - ) - } - - if (state.featureFlags.experimental.includes(flag)) { - return ( - state.config.experimental === 'all' || - dlv(state.config, ['experimental', flag], false) - ) - } - - return false -} diff --git a/src/lsp/util/state.ts b/src/lsp/util/state.ts index 47b976d397b70e7ac0e0d26a42ee76cb54f40374..09a02006721913e72c3a576ee1c30f997476c6b5 100644 --- a/src/lsp/util/state.ts +++ b/src/lsp/util/state.ts @@ -58,8 +58,6 @@ variants?: string[] classNames?: ClassNames dependencies?: string[] export type ClassNamesTree = { - [key: string]: string[] -export type ClassNamesTree = { export type ClassNames = { error?: Error } diff --git a/src/lsp/util/validateApply.ts b/src/lsp/util/validateApply.ts index 5a17956593549d6cf08c281ad4a43afd1faf3fdc..52f2b2c432fc5d85f448a1e9560683dc75a5bfed 100644 --- a/src/lsp/util/validateApply.ts +++ b/src/lsp/util/validateApply.ts @@ -1,6 +1,5 @@ import { State } from './state' import { getClassNameMeta } from './getClassNameMeta' -import { flagEnabled } from './flagEnabled' export function validateApply( state: State, @@ -8,10 +7,6 @@ classNameOrParts: string | string[] ): { isApplyable: true } | { isApplyable: false; reason: string } | null { const meta = getClassNameMeta(state, classNameOrParts) if (!meta) return null - - if (flagEnabled(state, 'applyComplexClasses')) { - return { isApplyable: true } - } const className = Array.isArray(classNameOrParts) ? classNameOrParts.join(state.separator)