Home

tailwind-ctp-intellisense @86497bb3802ce7f918ff01a474ad78e05e3a2567 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-language-service / src / util / resolveRange.ts
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import type { Range } from 'vscode-languageserver'

export function resolveRange(range: Range, relativeTo?: Range) {
  return {
    start: {
      line: (relativeTo?.start.line || 0) + range.start.line,
      character:
        (range.end.line === 0 ? relativeTo?.start.character || 0 : 0) +
        range.start.character,
    },
    end: {
      line: (relativeTo?.start.line || 0) + range.end.line,
      character:
        (range.end.line === 0 ? relativeTo?.start.character || 0 : 0) +
        range.end.character,
    },
  }
}