https://git.jolheiser.com/tailwind-ctp-intellisense.git
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) } } ) }