-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(commands): open urls with goto_file command #5820
Conversation
d28a23e
to
078e059
Compare
Thanks for using The |
For helix we don't actually need to wait for The best way to deal with blocking here for helix would be to use the tokio The easiest way to implement this would be if Looking at the code there are potentially multiple |
I really like that idea - that would conveniently bypass the blocking issue (in every direction). Even if a launcher blocks, that wouldn't be able to block Returning a list of On windows, somebody tried to remove the It's probably safe to assume that on windows, this new interface we are talking about can't exist, and one would have to work around it in |
I looked into this quite a bit more and it seems that the user simply used the wrong program. He called
So that refactor should be possible after all. |
Thanks for the research! I think Would @matoous have some time for the |
Yeah it does seem that this approach was used in the past but removed: Byron/open-rs#17 It sounds like there weren't really any issues with this tough just "performance" which I don't think matters much when opening a URL compared to being able to do it correctly asynronously. If you are really attachted to using the winapi call here we could have seperate It seems like the bug that this PR reffered to which caused rustup to switch to this function has been fixed in windows 10 since 2017: rust-lang/rustup#499 (comment). It sounds like it only ever occured on a preview build to begin with. From the rustup PR it sounds like this is really not that critical and they did it more as a nice to have: rust-lang/rustup#1117 (comment) (" It also should fix opening docs for the few people still using a year-old insider preview build.") |
Great detective work, thank you! Who would have thought that It definitely sounds like it's best to drop using this function and use To me the path forward seems to be clear and I am happy that thanks to |
Use std `Command` instead of `ShellExecuteW` from windows sys crate. This change was already attempted in: Byron#25 and later reverted in: Byron#27 and it it seems that it didn't work due to incorrect usage of `explorer` instead of `cmd /c start`. (see helix-editor/helix#5820 (comment) for detailed explanation). Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
Adds new `command` function that returns the underlying `std::Command` that would be called to open given path. Related: Byron#63 Related: helix-editor/helix#5820
A new release of |
5213c3f
to
5a94c36
Compare
e7105df
to
a1c6d42
Compare
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.
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.
just some minor comments, otherwise I think this looks good
@the-mikedavis thank you, addressed. |
Works great using Firefox on Linux, thanks! For Markdown:
Selecting I noticed these warnings when compiling:
I see #8874 rustix was updated very recently. |
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.
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.
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.
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.
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.
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.
* 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 #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]>
* 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]>
* feat(commands): open urls with goto_file command Add capability for `goto_file` command to open an URL under cursor. Fixes: helix-editor#1472 Superseds: helix-editor#4398 * open files inside helix * address code review * bump deps * fix based on code review comments
* 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]>
* feat(commands): open urls with goto_file command Add capability for `goto_file` command to open an URL under cursor. Fixes: helix-editor#1472 Superseds: helix-editor#4398 * open files inside helix * address code review * bump deps * fix based on code review comments
* 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]>
* feat(commands): open urls with goto_file command Add capability for `goto_file` command to open an URL under cursor. Fixes: helix-editor#1472 Superseds: helix-editor#4398 * open files inside helix * address code review * bump deps * fix based on code review comments
* 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]>
* feat(commands): open urls with goto_file command Add capability for `goto_file` command to open an URL under cursor. Fixes: helix-editor#1472 Superseds: helix-editor#4398 * open files inside helix * address code review * bump deps * fix based on code review comments
* 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]>
Add capability for
goto_file
command to open an URL under cursor.This pulls in additional dependency -
open
by @Byron which seems to be very minimal and as such doesn't impact the compile time and/or the final size of the binary.The updated implementation of
goto_file
first attempts to parse the WORD under the cursor as an URL. If it suceeds to do so it tries to open it in a browser (platform specific implementation from theopen
crate). If we fail to parse the WORD as URL the implementation tries to open it as a file in the editor.Fixes: #1472
Superseds: #4398