-
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
terminal: Support VS Code Terminal Link Providers #11552
terminal: Support VS Code Terminal Link Providers #11552
Conversation
53cbe4a
to
339ebcd
Compare
Reminder to myself: Consider #11398 after that PR has been merged! |
@msujew Yes, that's correct! Thanks for the info! I've updated the description. |
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.
I can already confirm that the functionality works as expected 👍
I have a small favor to ask for the provided test extension. Do you mind adding a command to dynamically unregister the link provider again? I would love to test that as well. The code for that looks reasonable, but I'd like to be better safe than sorry :D
@msujew Thank you very much for your detailed review and your great feedback! 👍 Good idea to test the disposal of the terminal link provider registration! I'll address and/or comment on your other suggestions inline. Thanks again! |
c99474d
to
5f11e46
Compare
@planger Please ping me when the CQ has been approved. I'll do a final review of the functionality afterwards. I don't have any more comments on the code for now. |
CQ: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=24248 (Status: NEW) |
5f11e46
to
a7992c4
Compare
a7992c4 just rebases and resolves conflicts. Still waiting on https://dev.eclipse.org/ipzilla/show_bug.cgi?id=24248 |
a7992c4
to
b23a19a
Compare
@msujew The CQ has now been resolved. So I rebased this change and retested everything. Seems to be still fine after resolving some minor conflicts. PS: Please note that I had to remove all plugins listed in Edit: PPS: The outage of OpenVSX also seems to break the build in the CI with the same error. So it is certainly not just me. |
b23a19a
to
9baa004
Compare
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.
Alright, looks good to me 👍
- The built-in link providers work as expected
- The extension provides custom links once enabled
- Using the disabling command correctly removes the custom link provider again
On another note: Do you mind adding a breaking change entry for this? Something along the lines of "The AbstractCmdClickTerminalContribution
API has been removed in favor of the TerminalLinkProvider
interface"?
* Implement the previously mocked support for Terminal Link Providers * Introduce Theia contribution point for adding link providers * Migrate existing link matchers to this new contribution point * Get rid of the usage of the deprecated xterm.registerLinkMatcher API * Fix UI bug where the link hover doesn't show up This happened when the mouse is above the hover as it gets visible, leading to xterm canceling the hover right away, because the mouse "seemingly" left the link. This has been fixed by preventing to hide it if the mouse left the link but is above the hover. * Turn the hover text into a clickable link Contributed on behalf of STMicroelectronics. Fixes eclipse-theia#11521 Fixes eclipse-theia#11507 Fixes eclipse-theia#11491 Change-Id: I01f907d778f4a5f0588202ea28c4c82252ab75dc Signed-off-by: Philip Langer <[email protected]>
9baa004
to
bb17f8e
Compare
@msujew Thank you for your review! I added a line to the changelog as you suggested, rebased the change on current master and gave it another quick test. 👍 |
@@ -61,6 +61,7 @@ generating the main code bundle (as before), the second serves to generate a *.c | |||
- [core] changed type of `FrontendApplicationConfig#defaultTheme` from `string` to `DefaultTheme` [#11570](https://github.com/eclipse-theia/theia/pull/11570) | |||
- From now on, the default theme can be dispatched based on the OS theme. Use `DefaultTheme#defaultForOSTheme` to derive the `string` theme ID. | |||
- [plugin-ext] removed `ctrlcmd+shift+l` keybinding for `pluginsView:toggle` [#11608](https://github.com/eclipse-theia/theia/pull/11608) | |||
- [terminal] The `AbstractCmdClickTerminalContribution` API has been removed in favor of the `TerminalLinkProvider` interface [#11552](https://github.com/eclipse-theia/theia/pull/11552) - Contributed on behalf of STMicroelectronics |
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.
@planger I believe you meant to add this under 1.31.0
not 1.30.0
which was already released? If so I can update when I update the changelog before the 1.31.0
release :)
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.
Oh right, I'm sorry about that. I've opened a PR to fix that: #11761
What it does
window.registerTerminalLinkProvider
#11521)TerminalLink
with a class to be compatible with VS Code ([vscode]TerminalLink
turned into a class with constructor #11507)TerminalLinkProvider
for registering link providers via dependency injectionxterm.registerLinkMatcher
API (Use Xterm'sregisterLinkProvider
instead ofregisterLinkMatcher
#11491)This occurs when the mouse happened to be on the position where the hover is placed as it gets visible, which leads to a mouse event that makes xterm cancel the hover right away, because the mouse "seemingly" left the link. This happened quite easily when you enter the link from below and move the mouse up, passing 30 px up during the delay until the hover shows up.
This has been fixed by preventing to hide the hover if the mouse left the link but is above the hover, as well as using the actual current mouse position to define the location of the hover, instead of the one that we had when scheduling the hover with delay.
Contributed on behalf of STMicroelectronics.
Fixes #11521
Fixes #11507
Fixes #11491
How to test
Below is what I tested as well as a short GIF showing how it looks like:
General Theia link provider contribution
https://theia-ide.org/docs
)localhost:3000
)./test.html
)--- a/<git-relative-path>/file
)VS Code extensions' link providers
Enable test terminal link provider
to test if dynamic registration workslink:
in the terminal and turns them into a linkReview checklist
Reminder for reviewers