Home

tailwind-ctp-intellisense @6f5a942632dafb469f36292254da69057267b9eb - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-vscode / src / lib / registerConfigErrorHandler.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { LanguageClient } from 'vscode-languageclient'
import { window, Uri, Range, Position } from 'vscode'

export function registerConfigErrorHandler(client: LanguageClient) {
  client.onNotification(
    'tailwindcss/configError',
    async ({ message, file, line }) => {
      const actions: string[] = file ? ['View'] : []
      const action = await window.showErrorMessage(
        `Tailwind CSS: ${message}`,
        ...actions
      )
      if (action === 'View') {
        window.showTextDocument(Uri.file(file), {
          selection: new Range(
            new Position(line - 1, 0),
            new Position(line - 1, 0)
          ),
        })
      }
    }
  )
}