Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Content-Assist question
Content-Assist question [message #715144] Fri, 12 August 2011 14:09 Go to next message
Michel Simeon is currently offline Michel SimeonFriend
Messages: 130
Registered: December 2009
Senior Member
I have a grammar which includes the following rules:

Model :
....
(('OCC' | 'COC') '=')? oCC = Value '%'? ';'
....
;

SignedInt returns ecore::EInt : NegativeINT | INT;
terminal NegativeINT returns ecore::EInt : '-' ('0'..'9')+;
terminal FLOAT returns ecore::EDouble :
('-'|'+')? (INT '.' INT+ | '.' INT+ | INT '.') ('e' ('-'|'+') INT+)?;
Value returns ecore::EDouble :
SignedInt | FLOAT ;

I have a content-assist test as follows:

newBuilder(getSetup())
....
.assertMatchString("COC, OCC")
.append("OCC")
.append(" ")
.assertText("=")
.append("=")
.append(" ")
.assertMatchString("oCC")
.append("10")
.append(" ")
.assertMatchString("%, ;")
.append("% ;")
.append(" ")
;

The test runs fine.

My problem is that if I am in the editor on a line with:
OCC =
then Ctrl-Space does NOT give me anything (for a variable of type STRING for example
I would get "variableName" - STRING

What should be done to display say "oCC" - Value

Thanks in advance
MS
Re: Content-Assist question [message #715157 is a reply to message #715144] Fri, 12 August 2011 14:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

for your own terminal rules (and datatype rules) you have (of course) to care about the content assist yourself Wink

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Content-Assist question [message #715299 is a reply to message #715157] Sat, 13 August 2011 07:19 Go to previous message
Michel Simeon is currently offline Michel SimeonFriend
Messages: 130
Registered: December 2009
Senior Member
Of course ! I should have thought about it.
Thanks for the comment
MS
Previous Topic:[xbase/xcore] infer and refer to constructor
Next Topic:Is it possbile to modify "ImportURI Mechanism"?
Goto Forum:
  


Current Time: Fri Mar 29 01:34:14 GMT 2024

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

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

Back to the top