Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Same function, different signature -> ContentAssist
Same function, different signature -> ContentAssist [message #761490] Tue, 06 December 2011 09:45 Go to next message
Eclipse UserFriend
Hi !, is me again... Rolling Eyes

In my dsl i have predefined functions like :

guiAddLabel(context,id,text)
guiAddLabel(context,id,text,align)

guiAnotherFunction(arg1,arg2,arg3)
guiAnotherAnotherFunction(arg1)

but in my grammar i only have registered one for each type, for example :

Module:
'module' name=ID 
functions += GuiFunctions*
;

GuiFunctions:
(guiAddLabel=GuiAddLabel
|guiAnotherFunction=GuiAnotherFunction
|guiAnotherAnotherFunction=GuiAnotherAnotherFunction
;

GuiAddLabel:
'guiAddLabel' FunctionImplementation
;

GuiAnotherFunction:
'guiAnotherFunction' FunctionImplementation
;

GuiAnotherAnotherFunction:
'guiAnotherAnotherFunction' FunctionImplementation
;



The point is that when i typed "g" and press ctrl+space the content assist show me :

guiAddLabel
guiAnotherFunction
guiAnotherAnotherFunction

and when i switch from one to other the content assist show me the doc I was wrote and seted before. This work nice.

But, what i am trying to achieve is, get in the content assist something like:

guiAddLabel(context,id,text)
guiAddLabel(context,id,text,align)
guiAnotherFunction(arg1,arg2,arg3)
guiAnotherAnotherFunction(arg1)

And when i press enter above one of this functions, in the editor must appear, for example :

guiAddLabel "without (context,id,text)" or
guiAnotherFunction "without (arg1,arg2,arg3)"

(this is already working in this way, but has not the different signatures of the functions).

Can somebody tell me if i need to update my grammar or if a need to do something in other place, and where?

Honestly i dont know how search for what i want because i dont know how is called what i need

The content assist and the doc is already working, so i not need to know about this.

Thanks, in advanced.

Sorry for my bad english i am using google translate a bit.

[Updated on: Tue, 06 December 2011 09:46] by Moderator

Re: Same function, different signature -> ContentAssist [message #761638 is a reply to message #761490] Tue, 06 December 2011 14:28 Go to previous messageGo to next message
Eclipse UserFriend
With your grammar same as the last time
hook into completekeyword (to suppress the keyword)
and into complete_GuiAnotherFunction and similar
to do the actual completion

~Christian

[Updated on: Tue, 06 December 2011 14:34] by Moderator

Re: Same function, different signature -> ContentAssist [message #762000 is a reply to message #761638] Wed, 07 December 2011 07:09 Go to previous messageGo to next message
Eclipse UserFriend
Thanks again, work properly
Re: Same function, different signature -> ContentAssist [message #764785 is a reply to message #762000] Mon, 12 December 2011 16:02 Go to previous message
Eclipse UserFriend
Hi again Very Happy,

Supress the keywords in completeKeywords work great when there are only a few functions that i want to delete , but what happens if there is a lot of functions

Suposse now my grammar is :


Module:
'module' name=ID 
(functionsGui += GuiFunctions
functionsView += ViewFunctions)*
;

GuiFunctions:
'guiAddRow' FunctionImplementation 
| 'guiRemoveRow' FunctionImplementation 
// and a lot of anothers functions
;

ViewFunctions:
'viewFunction' FunctionImplementation 
| 'viewFunction2' FunctionImplementation 
// and a lot of anothers functions
;



Exist some way for delete, for example, only the guiFunctions in the contentAssist?

Thanks, in advance.
Previous Topic:Primitive boxing
Next Topic:Strange scoping behaviour
Goto Forum:
  


Current Time: Sun Jul 27 06:37:44 EDT 2025

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

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

Back to the top