File tree 4 files changed +15
-0
lines changed
4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,8 @@ let codeLens ~path ~debug =
141
141
Ast_iterator. default_iterator.value_binding iterator vb
142
142
in
143
143
let iterator = {Ast_iterator. default_iterator with value_binding} in
144
+ (* We only print code lenses in implementation files. This is because they'd be redundant in interface files,
145
+ where the definition itself will be the same thing as what would've been printed in the code lens. *)
144
146
(if Filename. check_suffix path " .res" then
145
147
let parser =
146
148
Res_driver. parsingEngine.parseImplementation ~for Printer:false
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
+
5
+ (* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#command *)
4
6
type command = {title : string ; command : string }
7
+
8
+ (* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeLens *)
5
9
type codeLens = {range : range ; command : command option }
10
+
6
11
type inlayHint = {
7
12
position : position ;
8
13
label : string ;
Original file line number Diff line number Diff line change @@ -240,6 +240,11 @@ export function activate(context: ExtensionContext) {
240
240
// language client, and because of that requires a full restart.
241
241
context . subscriptions . push (
242
242
workspace . onDidChangeConfiguration ( ( { affectsConfiguration } ) => {
243
+ // Put any configuration that, when changed, requires a full restart of
244
+ // the server here. That will typically be any configuration that affects
245
+ // the capabilities declared by the server, since those cannot be updated
246
+ // on the fly, and require a full restart with new capabilities set when
247
+ // initializing.
243
248
if (
244
249
affectsConfiguration ( "rescript.settings.inlayHints" ) ||
245
250
affectsConfiguration ( "rescript.settings.codeLens" )
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ interface extensionConfiguration {
34
34
codeLens : boolean ;
35
35
binaryPath : string | null ;
36
36
}
37
+
38
+ // All values here are temporary, and will be overridden as the server is
39
+ // initialized, and the current config is received from the client.
37
40
let extensionConfiguration : extensionConfiguration = {
38
41
askToStartBuild : true ,
39
42
inlayHints : {
You can’t perform that action at this time.
0 commit comments