Skip to content

Commit 980beeb

Browse files
committed
Add clarifying comments.
1 parent 8d76d6f commit 980beeb

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

analysis/src/Hint.ml

+2
Original file line numberDiff line numberDiff 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 ~forPrinter:false

analysis/src/Protocol.ml

+5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
type position = {line: int; character: int}
22
type range = {start: position; end_: position}
33
type markupContent = {kind: string; value: string}
4+
5+
(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#command *)
46
type command = {title: string; command: string}
7+
8+
(* https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeLens *)
59
type codeLens = {range: range; command: command option}
10+
611
type inlayHint = {
712
position: position;
813
label: string;

client/src/extension.ts

+5
Original file line numberDiff line numberDiff 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")

server/src/server.ts

+3
Original file line numberDiff line numberDiff 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.
3740
let extensionConfiguration: extensionConfiguration = {
3841
askToStartBuild: true,
3942
inlayHints: {

0 commit comments

Comments
 (0)