-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtext.go
More file actions
45 lines (36 loc) · 823 Bytes
/
text.go
File metadata and controls
45 lines (36 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2025 TypeFox GmbH
// This program and the accompanying materials are made available under the
// terms of the MIT License, which is available in the project root.
package fastbelt
import "typefox.dev/lsp"
type TextIndex int32
type TextLine int32
type TextColumn int32
type TextIndexRange struct {
Start TextIndex
End TextIndex
}
type TextLocation struct {
Line TextLine
Column TextColumn
}
func (l TextLocation) LspPosition() lsp.Position {
return lsp.Position{
Line: uint32(l.Line),
Character: uint32(l.Column),
}
}
type TextRange struct {
Start TextLocation
End TextLocation
}
func (r TextRange) LspRange() lsp.Range {
return lsp.Range{
Start: r.Start.LspPosition(),
End: r.End.LspPosition(),
}
}
type TextSegment struct {
Indices TextIndexRange
Range TextRange
}