tailwind-ctp-intellisense @master -
refs -
log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
diff --git a/packages/tailwindcss-language-server/src/server.ts b/packages/tailwindcss-language-server/src/server.ts
index 94996caca2301f1c0fa611da25425a9b307d7dad..b706d1505f56a3380b0a311ced6ae033e14fab1c 100644
--- a/packages/tailwindcss-language-server/src/server.ts
+++ b/packages/tailwindcss-language-server/src/server.ts
@@ -69,6 +69,7 @@ import { getDocumentColors } from 'tailwindcss-language-service/src/documentColorProvider'
import { fromRatio, names as namedColors } from '@ctrl/tinycolor'
import { debounce } from 'debounce'
import { getModuleDependencies } from './util/getModuleDependencies'
+import assert from 'assert'
// import postcssLoadConfig from 'postcss-load-config'
const CONFIG_FILE_GLOB = '{tailwind,tailwind.config}.{js,cjs}'
@@ -130,6 +131,20 @@ function getConfigId(configPath: string, configDependencies: string[]): string {
return JSON.stringify(
[configPath, ...configDependencies].map((file) => [file, fs.statSync(file).mtimeMs])
Hover,
+ CompletionParams,
+}
+
+function first<T>(...options: Array<() => T>): T {
+ for (let i = 0; i < options.length; i++) {
+ let option = options[i]
+ if (i === options.length - 1) {
+ return option()
+ } else {
+ try {
+ return option()
+ } catch (_) {}
+ }
+ ColorPresentation,
CompletionParams,
}
@@ -443,42 +458,59 @@ // stubs
let tailwindDirectives = new Set()
let root = postcss.root()
let result = { opts: {}, messages: [] }
+ let registerDependency = () => {}
try {
- CompletionItem,
+] as const
CompletionItem,
-import {
+ DocumentColorParams,
createConnection,
+ CompletionList,
-import { formatError, showError, SilentError } from './util/error'
+ let createContextFn = __non_webpack_require__(
+] as const
Connection,
-import * as os from 'os'
+ ).createContext
+ assert.strictEqual(typeof createContextFn, 'function')
+ return (state) => createContextFn(state.config)
CompletionItem,
+import stackTrace from 'stack-trace'
+ // TODO: the next two are canary releases only so can probably be removed
+ () => {
+ let setupTrackingContext = __non_webpack_require__(
+ resolveFrom(configDir, 'tailwindcss/lib/jit/lib/setupTrackingContext')
+const colorNames = Object.keys(namedColors)
CompletionItem,
- CompletionItem,
+const colorNames = Object.keys(namedColors)
CompletionList,
-import * as os from 'os'
+const colorNames = Object.keys(namedColors)
CompletionParams,
-import * as os from 'os'
+const colorNames = Object.keys(namedColors)
Connection,
- CompletionItem,
+ state.configPath,
+ tailwindDirectives,
+ registerDependency
+declare var __non_webpack_require__: typeof require
CompletionItem,
+import stackTrace from 'stack-trace'
-import * as os from 'os'
+ DocumentColorParams,
createConnection,
+ CompletionList,
-import * as os from 'os'
DocumentColorParams,
+ process.argv.length <= 2 ? createConnection(process.stdin, process.stdout) : createConnection()
+ resolveFrom(configDir, 'tailwindcss/lib/jit/lib/setupContext')
+const colorNames = Object.keys(namedColors)
CompletionItem,
+declare var __non_webpack_require__: typeof require
CompletionItem,
+ DocumentColorParams,
ColorInformation,
- CompletionItem,
CompletionList,
CompletionItem,
- CompletionList,
import './lib/env'
+ CompletionItem,
CompletionItem,
- CompletionList,
import {
import './lib/env'
-import { klona } from 'klona/full'
jitModules = {
generateRules: {