Skip to content

Conversation

@Tim-ats-d
Copy link
Contributor

@Tim-ats-d Tim-ats-d commented Oct 27, 2025

Implement the new setting provided by this PR ocaml/ocaml-lsp#1567

@smorimoto smorimoto added type: feature New feature or request vscode labels Oct 27, 2025
@smorimoto smorimoto changed the title Implement the new codelens.forNestedBindings setting. Implement the new codelens.forNestedBindings setting Oct 27, 2025
Tim-ats-d and others added 3 commits October 28, 2025 07:01
Updated the parameter name from `codelens` to
`codelens_for_nested_bindings` in the set_configuration functionto enhance
code readability and maintain consistency with the naming convention.

Signed-off-by: Sora Morimoto <[email protected]>
@smorimoto smorimoto force-pushed the configurable-internal-code-lens branch from e192973 to b8b84bf Compare October 27, 2025 22:15
Signed-off-by: Sora Morimoto <[email protected]>
_
Signed-off-by: Sora Morimoto <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements support for the new codelens.forNestedBindings LSP setting from ocaml-lsp, allowing users to control whether CodeLens appears on nested let bindings. The implementation also includes a breaking change by renaming the existing ocaml.server.codelens setting to ocaml.server.codelens.enable.

Key changes:

  • Added codelens.forNestedBindings setting with a default value of false
  • Renamed existing ocaml.server.codelens setting to ocaml.server.codelens.enable
  • Introduced new OcamllspSettingCodeLens module to handle structured codelens configuration

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/settings.ml Added new setting and updated codelens setting key from ocaml.server.codelens to ocaml.server.codelens.enable
src/settings.mli Added interface declaration for the new nested bindings setting
src/vscode_ocaml_platform.ml Read and pass the new nested bindings setting to the extension instance
src/extension_instance.ml Store and propagate the nested bindings setting to the LSP client configuration
src/extension_instance.mli Added parameter for nested bindings setting in configuration function
src/ocaml_lsp.ml Replaced OcamllspSettingEnable with structured OcamllspSettingCodeLens module for codelens settings
src/ocaml_lsp.mli Updated interface to use the new codelens settings structure
package.json Updated configuration schema with renamed setting and new nested bindings option
CHANGELOG.md Documented the breaking change and new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@smorimoto smorimoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Tim-ats-d
Copy link
Contributor Author

Tim-ats-d commented Oct 28, 2025

There is an incompatibility between older versions of OCaml-lsp-server that do not implement the setting and the version of vscode-ocaml-platform that uses this patch. I'm trying to find a workaround.

It seems that this is not due to the difference in naming convention pointed out by Max (#1990 (comment)), even after fixing this, the problem is still present.

@Tim-ats-d
Copy link
Contributor Author

The field forNestedBindings is now marked as optional in the JSON setting decoding. This no longer create incompatibility error when testing with previous OCaml LSP server version that does not handle the forNestedBindings option.

@Tim-ats-d
Copy link
Contributor Author

Should be correct now, thank you @voodoos 👍

@smorimoto smorimoto requested review from mlantas and voodoos November 3, 2025 13:18
@smorimoto smorimoto merged commit 43fcee4 into ocamllabs:master Nov 5, 2025
6 checks passed
@smorimoto
Copy link
Collaborator

Thanks @Tim-ats-d!

@Tim-ats-d Tim-ats-d deleted the configurable-internal-code-lens branch November 5, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature or request vscode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants