Cross reference // Functions // ContentAssist [message #765839] |
Wed, 14 December 2011 18:48 |
Federico Sellanes Messages: 71 Registered: November 2011 |
Member |
|
|
Hi, i have a problem that i cant find the way to solve. I dug a lot in ProposalProvider but i not had good news.
A quick grammar example :
Module :
(functions=+ModuleUserFunction)*
;
ModuleUserFunction :
'function' name=ID implementation=FunctionImplementation
;
FunctionImplementation :
FunctionParameterDeclaration Codeblock
;
FunctionParameterDeclaration :
'(' ID ((',' ID)*)? ')'
;
Suppose that in some place, my DSL allows to call functions :
ModuleFunctionCall :
function=[ModuleUserFunction | QualifiedName] parameters=FunctionParametersInvocation
;
QualifiedName :
ID '.' ID
;
The problem is in the content assist, im trying to show "Module.functionName(arg1,arg2)" for the functions declared in all the modules !!
For example content assist should show me :
"Module1.functionName(arg1,arg2)"
"Module2.functionName(arg1,arg2)"
"Module2.functionName(arg1,arg2)"
So i hook complete_moduleFunctionCall and trough the node, i am getting the parameters of every functions and adding them in a String. So, this work fine when the functions are inside this module but i cant get the functions and parameters declared in others modules.
Exist some correct way for acomplish that? or i have to hook doCreateProposal and read the text in my xxxx.mydsl file and get from him the fragment next to "function functionName(". It sound really bad but i dont know other way.
Maybe this is so confuse, sorry my english is not good.
Thanks.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03868 seconds