|
|
Re: F3/Open Declaration disabled on cross references [message #929284 is a reply to message #926302] |
Mon, 01 October 2012 10:46 |
Olivier Petri Messages: 9 Registered: July 2012 |
Junior Member |
|
|
Hi Christian,
Thanks for your fast reply.
I did investigate in the direction you have indicated, but any of:
- IHyperlinkHelper.createHyperlinksByOffset()
- HyperlinkHelper.createHyperlinksTo()
- IHyperlinkDetector.detectHyperlinks()
is called only for ctrl+mouse where only ctrl+mouse works and for both, ctrl+mouse and F3, where both work. In other words, it is too late at those points.
I do not think its a key binding problem though, since the "Open Declaration" item is disabled in the "F3 does not work" case, and not simply missing (plus the disabled menue item shows the F3 shortcut).
For similar reasons it does not seem to be very likely that I am facing an event propagation problem, like hitting F3 being swallowed by the SemanticHighlighter or something: If it was that, I'd expect the "Open Declaration" context menu to be enabled but not responding.
Thus I assume Xtext is not registering the defining rules of the cross references in question as "Declarations" upon Eclipse. Pure speculation of corse.
I'd be happy if I had made an obvious mistake in the definition of the cross referencable rule, but what can go wrong in this?:
ExampleItem:
(optionalStuff = STRING)?
'ExamplKeyWord' name = ID
'(' SomeMoreStuff ')'
;
ExampleUse:
exampleCall = [ ExampleItem ] '(' YetMoreStuff ')'
;
Best regards,
Olivier
[Updated on: Mon, 01 October 2012 11:12] Report message to a moderator
|
|
|
Re: F3/Open Declaration disabled on cross references [message #929486 is a reply to message #929284] |
Mon, 01 October 2012 13:52 |
Olivier Petri Messages: 9 Registered: July 2012 |
Junior Member |
|
|
It seems as if this was a global problem on grammar level.
Global, because F3 works, or does not work, for all cross references in a project/language.
On grammar level (and not on ui level), because I disabled every customisation in the UIModule of the defective project, and it still won't work. Makes me think this must be something in the main project. But where could it be?
Meanwhile I discovered there is an OpenDeclarationHandler (org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler). As you will guess, it is called when F3 gets through, but it is not called at all in the "F3 does not work" case.
...
DefaultHyperlinkDetector$1.exec(XtextResource) line: 38
DefaultHyperlinkDetector$1.exec(Object) line: 1
XtextDocument$XtextDocumentLocker(AbstractReadWriteAcces<P>).readOnly(IUnitOfWork<T,P>) line: 32
XtextDocument.readOnly(IUnitOfWork<T,XtextResource>) line: 78
TestingHyperlinkDetector(DefaultHyperlinkDetector).detectHyperlinks(ITextViewer, IRegion, boolean) line: 36
TestingHyperlinkDetector.detectHyperlinks(ITextViewer, IRegion, boolean) line: 65
OpenDeclarationHandler.execute(ExecutionEvent) line: 42
...
So this somewhat confirms my suspicion about Xtext not identifying the rules in question as a "Declaration". But it does not lead any further though, because we are still in the call stack of F3 - or not. That is too late again.
Cheers,
Olivier
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06103 seconds