Home

tailwind-ctp-intellisense @5bd09789f414c62a087946d38ef8dd4a7a7eb301 - 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: getDocumentColors(state, doc) }
    }
  )
}