Home

tailwind-ctp-intellisense @81e6c7bef52081ada263f9244d0799f7b132b4d5 - 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) }
    }
  )
}