Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316380

Summary: Allow bug hyperlinking in .spec editor
Product: [Tools] Linux Tools Reporter: Andrew Overholt <overholt>
Component: RPMAssignee: Alexander Kurtakov <akurtakov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: linux.rpm-inbox
Version: 0.7.0   
Target Milestone: 0.7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Patch allowing hyperlinking none

Description Andrew Overholt CLA 2010-06-09 16:43:59 EDT
It would be nice to be able to click on text like "bug #12345" in a .spec file open with the .spec editor and have it open the associated bug report.  This works in most text editors so we'll just have to see what we're doing wrong (or not doing) that makes this not work.
Comment 1 Charley Wang CLA 2010-06-14 13:56:43 EDT
I can see "bug #12345" working with Mylyn installed -- it opens a menu that prompts the user to select a repository to open the bug with. Is this the behaviour we want to emulate? I wrote up a little patch that opens "bug #12345" in a hard-coded repository, but not sure how best to get a list of repositories for a user to select without using Mylyn. I could populate one manually.

I could also just try to enable the Mylyn behaviour to function in the specfile editor when Mylyn and RPM are both installed.
Comment 2 Andrew Overholt CLA 2010-06-14 14:21:39 EDT
What you're seeing is correct.  It doesn't work for me which is why I filed this, thinking it was something we had to enable in the .spec editor.  I wonder why it works for you and not me?  I don't see anything in the log and I have the task repository selected for the project.
Comment 3 Charley Wang CLA 2010-06-15 17:16:55 EDT
I meant it works for me in text editors, and I can write a patch to create a customized hover for the .spec editor :)

Took a look at how Mylyn does it -- it uses "org.eclipse.ui.DefaultTextEditor" as a target for the hover action. SpecfileEditor extends TextEditor which has the id "org.eclipse.ui.DefaultTextEditor", I will work on getting it recognized as a valid target for the Mylyn hover action.
Comment 4 Charley Wang CLA 2010-06-22 16:44:36 EDT
Created attachment 172462 [details]
Patch allowing hyperlinking

Changed HyperlinkDetectors in .spec editor to use the extension point. Added HyperlinkDetectorTarget, fixed Detectors to have appopriate default constructor and use IAdapter to get Specfile/SpecfileEditor instances as needed.
Comment 5 Alexander Kurtakov CLA 2010-10-26 08:46:36 EDT
Modified patch applied to trunk.