File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Expand file tree Collapse file tree 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 =
141141 Ast_iterator. default_iterator.value_binding iterator vb
142142 in
143143 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. *)
144146 (if Filename. check_suffix path " .res" then
145147 let parser =
146148 Res_driver. parsingEngine.parseImplementation ~for Printer:false
Original file line number Diff line number Diff line change 11type position = {line : int ; character : int }
22type range = {start : position ; end_ : position }
33type markupContent = {kind : string ; value : string }
4+
5+ (* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#command *)
46type command = {title : string ; command : string }
7+
8+ (* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeLens *)
59type codeLens = {range : range ; command : command option }
10+
611type inlayHint = {
712 position : position ;
813 label : string ;
Original file line number Diff line number Diff line change @@ -240,6 +240,11 @@ export function activate(context: ExtensionContext) {
240240 // language client, and because of that requires a full restart.
241241 context . subscriptions . push (
242242 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.
243248 if (
244249 affectsConfiguration ( "rescript.settings.inlayHints" ) ||
245250 affectsConfiguration ( "rescript.settings.codeLens" )
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ interface extensionConfiguration {
3434 codeLens : boolean ;
3535 binaryPath : string | null ;
3636}
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.
3740let extensionConfiguration : extensionConfiguration = {
3841 askToStartBuild : true ,
3942 inlayHints : {
You can’t perform that action at this time.
0 commit comments