Skip to content

Conversation

@voodoos
Copy link
Collaborator

@voodoos voodoos commented Dec 6, 2024

As far as I know it is not possible to disable the default hover provider on the client side in vscode due to how the official LSP client implementation manage it.

However it is sometimes necessary to disable that hover provider to provide alternative information in the hover tooltips without additional clutter.

This PR introduces an option that allows the client to ask the server to not return anything when hover requests are made.

The diff is a bit larger than necessary because dune build @lint had not been run when options when last updated so the inlining has changed a bit.

The first use case for this option is described in this vscode-ocaml-platform PR: ocamllabs/vscode-ocaml-platform#1675

@coveralls
Copy link

coveralls commented Dec 10, 2024

Pull Request Test Coverage Report for Build 4650

Details

  • 6 of 40 (15.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 22.175%

Changes Missing Coverage Covered Lines Changed/Added Lines %
ocaml-lsp-server/src/ocaml_lsp_server.ml 4 5 80.0%
ocaml-lsp-server/src/config_data.ml 2 35 5.71%
Totals Coverage Status
Change from base Build 4649: 0.04%
Covered Lines: 5651
Relevant Lines: 25484

💛 - Coveralls

Copy link
Collaborator

@xvw xvw left a comment

Choose a reason for hiding this comment

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

Wow configuration capabilities are hard!

@voodoos voodoos merged commit 8d0c35c into ocaml:master Dec 11, 2024
6 checks passed
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jan 9, 2025
CHANGES:

## Features

- Add a new server option `standardHover`, that can be used by clients to
  disable the default hover provider.  When `standardHover = false`
  `textDocument/hover` requests always returns with empty result. (ocaml/ocaml-lsp#1416)
voodoos added a commit to voodoos/ocaml-lsp that referenced this pull request Jun 6, 2025
* Add option to mute the hover + ensure jump CA is disabled
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jun 23, 2025
CHANGES:

## Features

- Make `inlay-hint` for function parameters configurable (ocaml/ocaml-lsp#1515)

- Add custom `ocamllsp/jumpToTypedHole` to navigate through typed holes (ocaml/ocaml-lsp#1516)

- Add a code-action for combining pattern cases (just relaying on regex) (ocaml/ocaml-lsp#1514)

- Allow (by configuration) shortening of diagnostics (just highlighting the first line) (ocaml/ocaml-lsp#1513)

- Fix `yojson_of_t` for `Nullable_option`: serialize `None` as `Null` instead of asserting false (ocaml/ocaml-lsp#1525 fixes ocaml/ocaml-lsp#1524)

## Fixes

- Support for `class`, `class type`, `method` and `property` for `DocumentSymbol` query (ocaml/ocaml-lsp#1487 fixes ocaml/ocaml-lsp#1449)

- Fix `inlay-hint` for function parameters (ocaml/ocaml-lsp#1515)

- More precise diagnostics in the event of a failed identifier search (`Definition_query`) (ocaml/ocaml-lsp#1518)

- Remove `ocamlformat` application after `destruct` (that remove some useful parenthesis) (ocaml/ocaml-lsp#1519)

- Add a new server option `standardHover`, that can be used by clients to
  disable the default hover provider.  When `standardHover = false`
  `textDocument/hover` requests always returns with empty result. (ocaml/ocaml-lsp#1416)
voodoos added a commit to voodoos/opam-repository that referenced this pull request Jun 23, 2025
CHANGES:

## Features

- Make `inlay-hint` for function parameters configurable (ocaml/ocaml-lsp#1515)

- Add custom `ocamllsp/jumpToTypedHole` to navigate through typed holes (ocaml/ocaml-lsp#1516)

- Add a code-action for combining pattern cases (just relaying on regex) (ocaml/ocaml-lsp#1514)

- Allow (by configuration) shortening of diagnostics (just highlighting the first line) (ocaml/ocaml-lsp#1513)

- Fix `yojson_of_t` for `Nullable_option`: serialize `None` as `Null` instead of asserting false (ocaml/ocaml-lsp#1525 fixes ocaml/ocaml-lsp#1524)

## Fixes

- Support for `class`, `class type`, `method` and `property` for `DocumentSymbol` query (ocaml/ocaml-lsp#1487 fixes ocaml/ocaml-lsp#1449)

- Fix `inlay-hint` for function parameters (ocaml/ocaml-lsp#1515)

- More precise diagnostics in the event of a failed identifier search (`Definition_query`) (ocaml/ocaml-lsp#1518)

- Remove `ocamlformat` application after `destruct` (that remove some useful parenthesis) (ocaml/ocaml-lsp#1519)

- Add a new server option `standardHover`, that can be used by clients to
  disable the default hover provider.  When `standardHover = false`
  `textDocument/hover` requests always returns with empty result. (ocaml/ocaml-lsp#1416)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants