Home

tailwind-ctp-intellisense @94786b12de7f42e9710553c6b511d1d0d541b244 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-intellisense / src / lsp / providers / documentColorProvider.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import { onMessage } from '../notifications'
import { State } from '../util/state'
import { getDocumentColors } from 'tailwindcss-language-service'

export function registerDocumentColorProvider(state: State) {
  onMessage(
    state.editor.connection,
    'getDocumentColors',
    async ({ document }) => {
      let doc = state.editor.documents.get(document)
      if (!doc) return { colors: [] }

      return { colors: await getDocumentColors(state, doc) }
    }
  )
}