Skip to content

Commit

Permalink
Disable jump code action by default (#1411)
Browse files Browse the repository at this point in the history
In some cases these can make the codeAction request slow (>2s).
  • Loading branch information
voodoos authored Dec 2, 2024
1 parent 09eb7b5 commit 53fd4e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Unreleased

## Fixes

- Deactivate the `jump` code actions by default. Clients can enable them with
the `merlinJumpCodeActions` configuration option. Alternatively a custom
request is provided for ad hoc use of the feature. (#1411)

# 1.20.0

## Features
Expand Down
4 changes: 2 additions & 2 deletions ocaml-lsp-server/src/code_actions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ let compute server (params : CodeActionParams.t) =
let open_related = Action_open_related.for_uri capabilities doc in
let* merlin_jumps =
match state.configuration.data.merlin_jump_code_actions with
| Some { enable = true } | None -> Action_jump.code_actions doc params capabilities
| Some { enable = false } -> Fiber.return []
| Some { enable = true } -> Action_jump.code_actions doc params capabilities
| Some { enable = false } | None -> Fiber.return []
in
(match Document.syntax doc with
| Ocamllex | Menhir | Cram | Dune ->
Expand Down

0 comments on commit 53fd4e0

Please sign in to comment.