File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
type position = {line : int ; character : int }
2
2
type range = {start : position ; end_ : position }
3
3
type markupContent = {kind : string ; value : string }
4
+ type command = {title : string ; command : string }
5
+ type codeLens = {range : range ; command : command option }
4
6
type inlayHint = {
5
7
position : position ;
6
8
label : string ;
@@ -147,6 +149,26 @@ let stringifyHint hint =
147
149
(stringifyPosition hint.position)
148
150
(Json. escape hint.label) hint.kind hint.paddingLeft hint.paddingRight
149
151
152
+ let stringifyCommand (command : command ) =
153
+ Printf. sprintf
154
+ {| {
155
+ " title" : " %s" ,
156
+ " command" : " %s"
157
+ }| }
158
+ (Json. escape command.title)
159
+ (Json. escape command.command)
160
+
161
+ let stringifyCodeLens (codeLens : codeLens ) =
162
+ Printf. sprintf
163
+ {| {
164
+ " range" : % s,
165
+ " command" : % s
166
+ }| }
167
+ (stringifyRange codeLens.range)
168
+ (match codeLens.command with
169
+ | None -> " "
170
+ | Some command -> stringifyCommand command)
171
+
150
172
(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#diagnostic *)
151
173
let stringifyDiagnostic d =
152
174
Printf. sprintf
You can’t perform that action at this time.
0 commit comments