Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross reference // Functions // ContentAssist
icon9.gif  Cross reference // Functions // ContentAssist [message #765839] Wed, 14 December 2011 18:48 Go to next message
Federico Sellanes is currently offline Federico SellanesFriend
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.
Re: Cross reference // Functions // ContentAssist [message #765879 is a reply to message #765839] Wed, 14 December 2011 20:31 Go to previous message
Federico Sellanes is currently offline Federico SellanesFriend
Messages: 71
Registered: November 2011
Member
Is solved with the information provided by Christian D. in http://www.eclipse.org/forums/index.php/t/264760/
Previous Topic:Named open and closing tags in xtext grammar?
Next Topic:An existing SQL grammar ?
Goto Forum:
  


Current Time: Thu Sep 26 01:59:33 GMT 2024

Powered by FUDForum. Page generated in 0.03868 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top