-
Notifications
You must be signed in to change notification settings - Fork 121
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
Documentation custom query #1336
Conversation
Pull Request Test Coverage Report for Build 4469Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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.
Very nice work!
I think that we can improve a little bit the code organization exposing only a Request_params
module (for the input arguments) and exposing a type (t
) that describes the output of the query.
I think that we can also only "produces parameters" into the body of the Fiber.thrunk
and using a dedicated function to fetching the documentation.
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.
Approved! Thanks a lot @PizieDust!
Thanks for the reviews |
@rgrinberg Do you want to make one last pass? |
The implementation looks fine. @awilliambauer do you want to take a look at the docs? Is this something that you will be able to use? |
``` | ||
- method : `ocamllsp/getDocumentation` | ||
- params : | ||
- `position`: The position of the cursor. |
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.
position
does not appear in the object type above - is that intentional?
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.
Yes, since the interface itself extends TextDocumentPositionParams
which contains both the Document Uri and the Position
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.
We can probably provide a link to the TextDocumentPositionParams and remove the description of position
(since textDocument
, the TextDocumentIdentifier
is not mentionned in the documentation).
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.
Not sure that it is right. I think that you should explain that the param should be a TextDocumentPositionParams (with a link to the specification) with additonal ones, enumerated.
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.
@xvw I just pushed a commit with some documentation changes. Can you check if it's more structured?
This looks reasonable to me, and useful for providing documentation-focus functionality. |
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.
This PR looks good, thanks @PizieDust
I think we do miss one thing however: when markdown is requested we should use the Doc_to_md
module to translate ocamldoc syntax to markown.
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.
Thanks for the change ! I think this is ready then ?
CHANGES: ## Features - Add custom [`ocamllsp/getDocumentation`](/ocaml-lsp-server/docs/ocamllsp/getDocumentation-spec.md) request (ocaml/ocaml-lsp#1336) - Add support for OCaml 5.2 (ocaml/ocaml-lsp#1233) ## Fixes - Kill unnecessary ocamlformat processes with sigterm rather than sigint or sigkill (ocaml/ocaml-lsp#1343)
CHANGES: ## Features - Add custom [`ocamllsp/getDocumentation`](/ocaml-lsp-server/docs/ocamllsp/getDocumentation-spec.md) request (ocaml/ocaml-lsp#1336) - Add support for OCaml 5.2 (ocaml/ocaml-lsp#1233) ## Fixes - Kill unnecessary ocamlformat processes with sigterm rather than sigint or sigkill (ocaml/ocaml-lsp#1343)
CHANGES: ## Features - Add custom [`ocamllsp/getDocumentation`](/ocaml-lsp-server/docs/ocamllsp/getDocumentation-spec.md) request (ocaml/ocaml-lsp#1336) - Add support for OCaml 5.2 (ocaml/ocaml-lsp#1233) ## Fixes - Kill unnecessary ocamlformat processes with sigterm rather than sigint or sigkill (ocaml/ocaml-lsp#1343)
closes #1319
Add
documentation
custom query.