Home

tailwind-ctp-intellisense @f1198cf053cbc02b41ea441074db80fa5f4eee9e - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-service / src / util / getDocumentSettings.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { State, Settings } from './state'
import type { TextDocument } from 'vscode-languageserver'

export async function getDocumentSettings(
  state: State,
  document?: TextDocument
): Promise<Settings> {
  if (!state.editor.capabilities.configuration) {
    return Promise.resolve(state.editor.globalSettings)
  }
  const uri = document ? document.uri : undefined
  let result = state.editor.documentSettings.get(uri)
  if (!result) {
    result = await state.emitter.emit(
      'getConfiguration',
      document
        ? {
            languageId: document.languageId,
          }
        : undefined
    )
    state.editor.documentSettings.set(uri, result)
  }
  return result
}