Debian Codegraph @

structures.go

raw symbols SCIP
1 package lsp
2
3 import "fmt"
4
5 type Position struct {
6 /**
7 * Line position in a document (zero-based).
8 */
9 Line int `json:"line"`
10
11 /**
12 * Character offset on a line in a document (zero-based).
13 */
14 Character int `json:"character"`
15 }
16
17 func (p Position) String() string {
18 return fmt.Sprintf("%d:%d", p.Line, p.Character)
19 }
20
21 type Range struct {
22 /**
23 * The range's start position.
24 */
25 Start Position `json:"start"`
26
27 /**
28 * The range's end position.
29 */
30 End Position `json:"end"`
31 }
32
33 func (r Range) String() string {
34 return fmt.Sprintf("%s-%s", r.Start, r.End)
35 }
36
37 type Location struct {
38 URI DocumentURI `json:"uri"`
39 Range Range `json:"range"`
40 }
41
42 type Diagnostic struct {
43 /**
44 * The range at which the message applies.
45 */
46 Range Range `json:"range"`
47
48 /**
49 * The diagnostic's severity. Can be omitted. If omitted it is up to the
50 * client to interpret diagnostics as error, warning, info or hint.
51 */
52 Severity DiagnosticSeverity `json:"severity,omitempty"`
53
54 /**
55 * The diagnostic's code. Can be omitted.
56 */
57 Code string `json:"code,omitempty"`
58
59 /**
60 * A human-readable string describing the source of this
61 * diagnostic, e.g. 'typescript' or 'super lint'.
62 */
63 Source string `json:"source,omitempty"`
64
65 /**
66 * The diagnostic's message.
67 */
68 Message string `json:"message"`
69 }
70
71 type DiagnosticSeverity int
72
73 const (
74 Error DiagnosticSeverity = 1
75 Warning = 2
76 Information = 3
77 Hint = 4
78 )
79
80 type Command struct {
81 /**
82 * Title of the command, like `save`.
83 */
84 Title string `json:"title"`
85 /**
86 * The identifier of the actual command handler.
87 */
88 Command string `json:"command"`
89 /**
90 * Arguments that the command handler should be
91 * invoked with.
92 */
93 Arguments []interface{} `json:"arguments"`
94 }
95
96 type TextEdit struct {
97 /**
98 * The range of the text document to be manipulated. To insert
99 * text into a document create a range where start === end.
100 */
101 Range Range `json:"range"`
102
103 /**
104 * The string to be inserted. For delete operations use an
105 * empty string.
106 */
107 NewText string `json:"newText"`
108 }
109
110 type WorkspaceEdit struct {
111 /**
112 * Holds changes to existing resources.
113 */
114 Changes map[string][]TextEdit `json:"changes"`
115 }
116
117 type TextDocumentIdentifier struct {
118 /**
119 * The text document's URI.
120 */
121 URI DocumentURI `json:"uri"`
122 }
123
124 type TextDocumentItem struct {
125 /**
126 * The text document's URI.
127 */
128 URI DocumentURI `json:"uri"`
129
130 /**
131 * The text document's language identifier.
132 */
133 LanguageID string `json:"languageId"`
134
135 /**
136 * The version number of this document (it will strictly increase after each
137 * change, including undo/redo).
138 */
139 Version int `json:"version"`
140
141 /**
142 * The content of the opened text document.
143 */
144 Text string `json:"text"`
145 }
146
147 type VersionedTextDocumentIdentifier struct {
148 TextDocumentIdentifier
149 /**
150 * The version number of this document.
151 */
152 Version int `json:"version"`
153 }
154
155 type TextDocumentPositionParams struct {
156 /**
157 * The text document.
158 */
159 TextDocument TextDocumentIdentifier `json:"textDocument"`
160
161 /**
162 * The position inside the text document.
163 */
164 Position Position `json:"position"`
165 }