Conversation
Pull Request Test Coverage Report for Build 4624Details
💛 - Coveralls |
|
We should think about what we want to do with the jump code action. The two obvious possibilities are:
I am personally in favor of 2, since the nice trick allows direct support in any editor with the required capabilities. |
I am also in favor of 2. |
voodoos
left a comment
There was a problem hiding this comment.
These changes looks ok to me. It's one more custom request as discussed with @awilliambauer , but hopefully we will be able to work on client implementations soon.
|
This should be ready to merge now, and we have the vscode implementation ready: ocamllabs/vscode-ocaml-platform#1654 |
CHANGES: ## Features - Add custom [`ocamllsp/typeSearch`](/ocaml-lsp-server/docs/ocamllsp/typeSearch-spec.md) request (ocaml/ocaml-lsp#1369) - Make MerlinJump code action configurable (ocaml/ocaml-lsp#1376) - Add custom [`ocamllsp/jump`](/ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md) request (ocaml/ocaml-lsp#1374) ## Fixes - Fix fd leak in running external processes for preprocessing (ocaml/ocaml-lsp#1349) - Fix prefix parsing for completion of object methods (ocaml/ocaml-lsp#1363, fixes ocaml/ocaml-lsp#1358) - Remove some duplicates in the `selectionRange` answers (ocaml/ocaml-lsp#1368)
CHANGES: ## Features - Add custom [`ocamllsp/typeSearch`](/ocaml-lsp-server/docs/ocamllsp/typeSearch-spec.md) request (ocaml/ocaml-lsp#1369) - Make MerlinJump code action configurable (ocaml/ocaml-lsp#1376) - Add custom [`ocamllsp/jump`](/ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md) request (ocaml/ocaml-lsp#1374) ## Fixes - Fix fd leak in running external processes for preprocessing (ocaml/ocaml-lsp#1349) - Fix prefix parsing for completion of object methods (ocaml/ocaml-lsp#1363, fixes ocaml/ocaml-lsp#1358) - Remove some duplicates in the `selectionRange` answers (ocaml/ocaml-lsp#1368)
CHANGES: ## Features - Add custom [`ocamllsp/typeSearch`](/ocaml-lsp-server/docs/ocamllsp/typeSearch-spec.md) request (ocaml/ocaml-lsp#1369) - Make MerlinJump code action configurable (ocaml/ocaml-lsp#1376) - Add custom [`ocamllsp/jump`](/ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md) request (ocaml/ocaml-lsp#1374) ## Fixes - Fix fd leak in running external processes for preprocessing (ocaml/ocaml-lsp#1349) - Fix prefix parsing for completion of object methods (ocaml/ocaml-lsp#1363, fixes ocaml/ocaml-lsp#1358) - Remove some duplicates in the `selectionRange` answers (ocaml/ocaml-lsp#1368)
related to #1360
This PR contains an implementation for a custom requests based on Merlin's jump command.
Using code actions introduces some noise as referenced in this comment: #1364 (comment)
An alternative solution will be to use a custom request, which allows for more better finetuning.
Merlin Jump Request
Description
This custom request allows Merlin-type code navigation in a source buffer.
Server capability
handleMerlinJumpbooleanRequest
ocamllsp/merlinJumpTextDocumentIdentifier: Specifies the document for which the request is sent. It includes a uri property that points to the document.Position: Specifies the position in the document for which the documentation is requested. It includes line and character properties.More details can be found in the TextDocumentPositionParams - LSP Specification.
Target: A string representing the identifier within the document to search for and jump to.The target can be any of
fun,let,module,module-type,match,match-next-case,match-prev-case.Response
Position: The position to jump toTextDocumentIdentifier: the document path which contains this position (ideally the same document as the request)cc @voodoos @xvw @rgrinberg @awilliambauer