Skip to content

Commit c6cc715

Browse files
authored
Specify -index 0 in type-enclosing queries. (#1191)
* Specify `-index 0` in type-enclosing queries. This change might greatly improve performances in some cases where Merlin would format big types that were discarded by ocaml-lsp anyway.
1 parent 26b52dd commit c6cc715

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/build-and-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ jobs:
2323
ocaml-compiler:
2424
- 4.14.x
2525
- 5.0.x
26-
- ocaml-variants.5.1.0+trunk
26+
- 5.1.x
2727
exclude:
2828
- os: windows-latest
2929
ocaml-compiler: 5.0.x
3030
- os: windows-latest
31-
ocaml-compiler: ocaml-variants.5.1.0+trunk
31+
ocaml-compiler: 5.1.x
3232
- os: macos-latest
3333
ocaml-compiler: 5.0.x
3434
- os: macos-latest
35-
ocaml-compiler: ocaml-variants.5.1.0+trunk
35+
ocaml-compiler: 5.1.x
3636

3737
runs-on: ${{ matrix.os }}
3838

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- Do not invoke dune at all if `--fallback-read-dot-merlin` flag is on. (#1173)
77
- Fix semantic highlighting of infix operators that contain '.'. (#1186)
88
- Disable highlighting unit as an enum member to fix comment highlighting bug. (#1185)
9+
- Improve type-on-hover efficiency by only formatting the type of the first
10+
enclosing. (#1191)
911

1012
## Features
1113

ocaml-lsp-server/src/document.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ module Merlin = struct
289289

290290
let type_enclosing doc pos verbosity =
291291
with_pipeline_exn doc (fun pipeline ->
292-
let command = Query_protocol.Type_enclosing (None, pos, None) in
292+
let command = Query_protocol.Type_enclosing (None, pos, Some 0) in
293293
let pipeline =
294294
match verbosity with
295295
| 0 -> pipeline

0 commit comments

Comments
 (0)