-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jump Custom Request #1374
Jump Custom Request #1374
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
handleMerlinJump
boolean
Request
ocamllsp/merlinJump
TextDocumentIdentifier
: 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