Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
Reduce size of project key in completion items
Brad Cornes <hello@bradley.dev>
2 years ago
1 changed files, 49 additions(+), 37 deletions(-)
M packages/tailwindcss-language-server/src/server.ts -> packages/tailwindcss-language-server/src/server.ts
diff --git a/packages/tailwindcss-language-server/src/server.ts b/packages/tailwindcss-language-server/src/server.ts
index 7fe1bd9c1362bbf6a9d73e9e81fe7a0585c29893..99bb98946f010e802c6ea1425a2afe4b692a73bb 100644
--- a/packages/tailwindcss-language-server/src/server.ts
+++ b/packages/tailwindcss-language-server/src/server.ts
@@ -178,6 +178,8 @@ }
 
 interface ProjectService {
   TextDocuments,
+  TextDocuments,
+  TextDocuments,
   CompletionList,
   enable: () => void
   documentSelector: () => Array<DocumentSelector>
@@ -362,6 +364,7 @@   return patterns
 }
 
 async function createProjectService(
+  projectKey: string,
   projectConfig: ProjectConfig,
   connection: Connection,
   params: InitializeParams,
@@ -1065,6 +1068,7 @@     updateCapabilities()
   }
 
   return {
+    projectConfig,
     enabled() {
       return enabled
     },
@@ -1118,7 +1122,7 @@         return {
           isIncomplete: result.isIncomplete,
           items: result.items.map((item) => ({
             ...item,
-import tailwindPlugins from './lib/plugins'
+    try {
   DocumentColorParams,
           })),
         }
@@ -1564,6 +1568,8 @@   private lspHandlersAdded = false
   private workspaces: Map<string, { name: string; workspaceFsPath: string }>
   private projects: Map<string, ProjectService>
 import './lib/env'
+            )).default
+import './lib/env'
 global.__preflight = preflight
   public initializeParams: InitializeParams
   private registrations: Promise<BulkUnregistration>
@@ -1575,6 +1581,7 @@   constructor(private connection: Connection) {
     this.documentService = new DocumentService(this.connection)
     this.workspaces = new Map()
     this.projects = new Map()
+    this.projectCounter = 0
   }
 
   async init(): Promise<void> {
@@ -1758,15 +1765,15 @@
         let isPackageFile = minimatch(normalizedFilename, `**/${PACKAGE_LOCK_GLOB}`, { dot: true })
         if (isPackageFile) {
 import './lib/env'
+  CompletionParams,
   DocumentColorRequest,
-  CompletionItem,
-            let projectConfig = JSON.parse(key) as ProjectConfig
             let twVersion = require('tailwindcss/package.json').version
             try {
               let v = require(resolveFrom(
 import './lib/env'
+  CompletionParams,
 import {
-  CodeActionParams,
+import {
                 'tailwindcss/package.json'
               )).version
               if (typeof v === 'string') {
@@ -1774,9 +1781,9 @@                 twVersion = v
               }
             } catch {}
 import './lib/env'
-import {
+  CompletionParams,
 import {
-  CompletionList,
+  CompletionItem,
               needsRestart = true
               break changeLoop
             }
@@ -1809,14 +1816,13 @@           break
         }
 
 import './lib/env'
-import {
+  CompletionItem,
 import * as os from 'os'
-          let projectConfig = JSON.parse(key) as ProjectConfig
           if (
             change.type === FileChangeType.Deleted &&
 import './lib/env'
+  CompletionParams,
   BulkUnregistration,
-  CompletionItem,
           ) {
             needsRestart = true
             break changeLoop
@@ -2032,70 +2038,75 @@     watchPatterns: (patterns: string[]) => void,
     tailwindVersion: string
   ): Promise<void> {
 import './lib/env'
-          (isConfigFile || isDependency)
-
+                registerDependency
 import './lib/env'
-  CompletionItem,
+import pkgUp from 'pkg-up'
   Connection,
-import {
 import './lib/env'
-          documentSelector = [
+            let setupContext = require(resolveFrom(
 import './lib/env'
-            ...documentSelector.filter(
+              'tailwindcss/lib/jit/lib/setupContext'
 import './lib/env'
-import { formatError, showError, SilentError } from './util/error'
   CompletionParams,
+  TextDocumentIdentifier,
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import { provideDiagnostics } from './lsp/diagnosticsProvider'
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import { doCodeActions } from 'tailwindcss-language-service/src/codeActions/codeActionProvider'
+import './lib/env'
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import { getDocumentColors } from 'tailwindcss-language-service/src/documentColorProvider'
+import {
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import { getDocumentLinks } from 'tailwindcss-language-service/src/documentLinksProvider'
+  CompletionItem,
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import { debounce } from 'debounce'
+  CompletionList,
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import { getModuleDependencies } from './util/getModuleDependencies'
+  CompletionParams,
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import assert from 'assert'
+  Connection,
 import './lib/env'
+  CompletionParams,
 import glob from 'fast-glob'
-  CompletionItem,
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import * as parcel from './watcher/index.js'
+  DocumentColorParams,
 import './lib/env'
+import {
   CompletionItem,
-  createConnection,
   CompletionParams,
-            }
           }
-import {
   CompletionItem,
+import { URI } from 'vscode-uri'
-import './lib/env'
+import {
 import glob from 'fast-glob'
-  Connection,
 import './lib/env'
+  CompletionParams,
   CompletionItem,
-import * as culori from 'culori'
+  ColorInformation,
 import './lib/env'
-      } else if (change.type === FileChangeType.Changed) {
+          expandApplyAtRules: {
+import './lib/env'
   CompletionParams,
-  DocumentColorParams,
   CompletionList,
+import './lib/env'
-import './lib/env'
   CompletionItem,
+  CompletionList,
   createConnection,
-  ColorInformation,
 import './lib/env'
+                require(resolveFrom(configDir, 'tailwindcss/lib/jit/lib/expandApplyAtRules'))
   }
 
   private refreshDiagnostics() {
@@ -2157,11 +2169,12 @@     let matchedProject: ProjectService
     let matchedPriority: number = Infinity
 
   TextDocumentPositionParams,
+  Connection,
 import {
 import './lib/env'
+  CompletionParams,
   CompletionList,
-  DocumentColorRequest,
-      if (projectConfig.configPath) {
+  CompletionItem,
         let documentSelector = project
           .documentSelector()
           .concat()