|
|
|
|
Re: Documentation on functions called in xtext editor !! [message #760910 is a reply to message #759628] |
Mon, 05 December 2011 15:11 |
Federico Sellanes Messages: 71 Registered: November 2011 |
Member |
|
|
I not understading at all how this works... but im trying. So i have new question.
I think this may be the proper place to use setAdditionalProposalInfo :
@Override
protected ConfigurableCompletionProvider doCreateProposal(String proposal, StyledString displayString, Image image, int priority, context){
ConfigurationCompletionProvider theProposal = super.doCreateProposal(proposal,
displayString, image, priority, context);
theProposal.setAdditionalProposalInfo("functionDocumentation");
}
I have to get from the context, the function that i want to show the doc?... or there is other more efficient way ?
I trying to base my code in the code i found in this post http://www.eclipse.org/forums/index.php/m/643639/ but function "apply(IEObjectDescription candidate)" doesnt exist any more in this version of xtext, i guess.
Wron way?, right way?, other way?
|
|
|
|
Re: Documentation on functions called in xtext editor !! [message #760943 is a reply to message #759628] |
Mon, 05 December 2011 16:49 |
Federico Sellanes Messages: 71 Registered: November 2011 |
Member |
|
|
The functions what i talking about, are the functions uniques of my dsl. Not a cross reference, if i am understanding.
I was asking if what I'm doing is right
I will give you a example of my dsl
Greeting :
'module' name=ID '{'
innerElements += ModuleInnerElements*
'}'
;
ModuleInnerElements:
Functions
| OtherStuff
| OtherStuff
| OtherStuff
| OtherStuff
;
Functions:
(GuiStart | GuiAddRow | GuiEnd) FunctionImplementation
;
GuiStart:
'guiStart';
;
GuiAddRow:
'guiAddRow';
;
GuiEnd:
'guiEnd';
;
Sorry, english is sometimes a nightmare for me !!
Edit: I was looking the picture i posted before and thats was and example of how i want to show the documentation for my functions (in my dsl) and not for java functions.
[Updated on: Mon, 05 December 2011 16:55] Report message to a moderator
|
|
|
Re: Documentation on functions called in xtext editor !! [message #760945 is a reply to message #760943] |
Mon, 05 December 2011 17:02 |
|
in this case you should hook into complete keyword
@Override
public void completeKeyword(Keyword keyword, ContentAssistContext contentAssistContext,
ICompletionProposalAcceptor acceptor) {
ICompletionProposal proposal = createCompletionProposal(keyword.getValue(), getKeywordDisplayString(keyword),
getImage(keyword), contentAssistContext);
//do a downcast here and add the infos you need
getPriorityHelper().adjustKeywordPriority(proposal, contentAssistContext.getPrefix());
acceptor.accept(proposal);
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.03756 seconds