Home

tailwind-ctp-intellisense @99febcd4c096452b2469c1f320a9ca5d7cbfca03 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-intellisense / src / lsp / util / getDocumentSettings.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import { State, Settings } from './state'
import { 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)
  }
  let result = state.editor.documentSettings.get(document.uri)
  if (!result) {
    result = await state.emitter.emit('getConfiguration', {
      languageId: document.languageId,
    })
    state.editor.documentSettings.set(document.uri, result)
  }
  return result
}