Community
Participate
Working Groups
Task hyperlinks in the task editor should work the same way as in the Java editor: when you hover over the link, there should be a popup simliar to the one for attachment links allowing you to select the repository.
The hyperlinks work consistently with repository web interfaces, i.e. they link to other tasks in the same repository. In order to link to tasks in other repositories you have to provide the full URL. Are you suggesting to always show a list of repositories that may match a task link, e.g. bug 123? My sense is that this would get in the way in the vast majority of cases where the link is referencing a task in the same repository.
It would probably make more sense to only show the list of repositories when holding control.
Thanks for the input. I don't think the modifier keys are available in the hyperlink detector API. I'll keep this open but this type of advanced functionality doesn't fall into the core scope of the project. We'd be happy to resolve this through a contribution though.
Created attachment 208710 [details] patch The modifiers are not available in the detector, but I just defined a new detector that only operates on the task editor when ctrl is held. It works nicely.
Created attachment 208711 [details] mylyn/context/zip
That's an interesting idea. One problem I noticed is that the task editor now highlights bug patterns for other repositories, e.g. "#42" which is a Trac specific pattern is highlighted in the Bugzilla editor. These links are only clickable when holding CTRL which is not intuitive and consistent with other links in the editor. The highlighting code would need to be changed to only highlight these links when CTRL is pressed before considering the patch.
Good catch, I'll look into whether there's anything I can do about that. I only see the problem with on 3.6 though, not 3.7.
Hmm, I see the same problem with another connector.
Created attachment 208972 [details] updated patch This will only create hyperlinks to other repositories if there is a hyperlink to the current repository. It prevents highlighting anything that wouldn't already be highlighted. It's not perfect in that, when using Bugzilla, "#42" will just be ignored even when holding Ctrl. I don't think it's possible to do better than that given that the highlighting is controlled by the platform. This at least supports the common case of using multiple repositories that use the same bug pattern.
Created attachment 208973 [details] mylyn/context/zip
Thanks for the patch. This is very cool! I'd be happy to merge it if you added a few test cases. > It's not perfect in that, when using Bugzilla, "#42" will just be ignored even > when holding Ctrl. I don't think it's possible to do better than that given that > the highlighting is controlled by the platform. The highlighting is implemented in subclasses of AbstractHyperlinkTextPresentationManager. We might be able to add special handling for the new hyperlink detector to only highlight bug links for other repositories when Ctrl is pressed.
Created attachment 209156 [details] patch with tests
Created attachment 209157 [details] mylyn/context/zip
Great! I have simplified the code slightly be removing MultipleTaskHyperlinkDetector.getTaskRepositoryFromSuper() method and replaced the boolean flag to MultipleTaskHyperlinkDetectorTest.createHyperlinkDetector(). Sam, can you take a look if these changes make sense: http://review.mylyn.org/#change,197 ?
Thanks, that is much simpler! I should have thought of that (assuming it works). Regarding the review, the fetch and compare with commands do not work properly. Also, it would be useful to be able to open the patched version of a file directly.
Great. I have pushed the change into master.