Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » code completion
code completion [message #1069382] Mon, 15 July 2013 19:53 Go to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
Hi,
Is there any way to customize the code completion in Xtext?

for example:
if i defined a rule like this:
rule:
key_value_pair = VALUE
;
terminal VALUE:
(.)*
;

actually key_value_pair is in the form: component.resource value-list
where value-list accept one or more values.
I also have a list of component and resource pair.

How to configure the xtext to offer some options when users input something.
For example, if there is a component = good and this component has resource ={ morning, afternoon}, then when user has input "good" and "." the editor can offer { morning, afternoon} .
or the user wants a completion even he/she just typed "g".

Thanks
Sincerely,
yueming
Re: code completion [message #1069385 is a reply to message #1069382] Mon, 15 July 2013 20:00 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi,

have a look at the MyDslProposalProvider and the methods that where generated into its abstract superclass.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:about grammar
Next Topic:ComposedChecks are triggered twice
Goto Forum:
  


Current Time: Sat Apr 27 02:44:42 GMT 2024

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

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

Back to the top