Skip to content
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

feat(lsp): implement show document request #8865

Merged
merged 5 commits into from
Jan 17, 2024

Conversation

matoous
Copy link
Contributor

@matoous matoous commented Nov 19, 2023

Implement window.showDocument LSP server-sent request.

This PR builds on top of #5820, moves the external-URL opening functionality into shared crate-level function that returns a callback that is now used by both the open_file command as well as the window.showDocument handler if the URL is marked as external.

Requires

@the-mikedavis the-mikedavis added A-language-server Area: Language server client S-waiting-on-review Status: Awaiting review from a maintainer. labels Nov 21, 2023
@matoous matoous force-pushed the md/lsp-show-document branch 2 times, most recently from ccfda22 to 464a64a Compare November 21, 2023 12:47
helix-term/src/application.rs Outdated Show resolved Hide resolved
helix-term/src/application.rs Outdated Show resolved Hide resolved
@kirawi kirawi added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from a maintainer. labels Dec 12, 2023
@matoous matoous force-pushed the md/lsp-show-document branch 2 times, most recently from 5a86376 to 113700e Compare December 13, 2023 20:17
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 13, 2023
pascalkuthe
pascalkuthe previously approved these changes Jan 8, 2024
Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument)
LSP server-sent request.

This PR builds on top of helix-editor#5820,
moves the external-URL opening functionality into shared crate-level
function that returns a callback that is now used by both the
`open_file` command as well as the window.showDocument handler if
the URL is marked as external.
pascalkuthe
pascalkuthe previously approved these changes Jan 8, 2024
@pascalkuthe pascalkuthe merged commit c60ba4b into helix-editor:master Jan 17, 2024
6 checks passed
@David-Else
Copy link
Contributor

@matoous Thanks for your great work! Does this unlock any features in any particular language server? For example, the ability to jump to documentation when we get a lint error? Cheers!

@matoous
Copy link
Contributor Author

matoous commented Jan 17, 2024

@David-Else I honestly haven't check the support from various LSPs.

Some references I found:

I don't think the adoption is wide.

@tmistele
Copy link

@David-Else It unlocked this for me (typst live preview with "inverse search")

typst-lsp-test.webm

which I find pretty cool, thanks @matoous for the implementation in helix!

What you're seeing here is typst-lsp with some experimental patches for live preview on top.

hamrik pushed a commit to hamrik/helix that referenced this pull request Jan 27, 2024
* feat(lsp): implement show document request

Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument)
LSP server-sent request.

This PR builds on top of helix-editor#5820,
moves the external-URL opening functionality into shared crate-level
function that returns a callback that is now used by both the
`open_file` command as well as the window.showDocument handler if
the URL is marked as external.

* add return

* use vertical split

* refactor

---------

Co-authored-by: Michael Davis <[email protected]>
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
* feat(lsp): implement show document request

Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument)
LSP server-sent request.

This PR builds on top of helix-editor#5820,
moves the external-URL opening functionality into shared crate-level
function that returns a callback that is now used by both the
`open_file` command as well as the window.showDocument handler if
the URL is marked as external.

* add return

* use vertical split

* refactor

---------

Co-authored-by: Michael Davis <[email protected]>
@knuesel
Copy link

knuesel commented May 1, 2024

Thanks for the inspiration @tmistele, I've suggested enabling something similar in texlab and the devs have been super responsive (see texlab 5.16.0 released today). So Latex inverse search now works in Helix :)

mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* feat(lsp): implement show document request

Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument)
LSP server-sent request.

This PR builds on top of helix-editor#5820,
moves the external-URL opening functionality into shared crate-level
function that returns a callback that is now used by both the
`open_file` command as well as the window.showDocument handler if
the URL is marked as external.

* add return

* use vertical split

* refactor

---------

Co-authored-by: Michael Davis <[email protected]>
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
* feat(lsp): implement show document request

Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument)
LSP server-sent request.

This PR builds on top of helix-editor#5820,
moves the external-URL opening functionality into shared crate-level
function that returns a callback that is now used by both the
`open_file` command as well as the window.showDocument handler if
the URL is marked as external.

* add return

* use vertical split

* refactor

---------

Co-authored-by: Michael Davis <[email protected]>
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* feat(lsp): implement show document request

Implement [window.showDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showDocument)
LSP server-sent request.

This PR builds on top of helix-editor#5820,
moves the external-URL opening functionality into shared crate-level
function that returns a callback that is now used by both the
`open_file` command as well as the window.showDocument handler if
the URL is marked as external.

* add return

* use vertical split

* refactor

---------

Co-authored-by: Michael Davis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants