Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315624 - [ContentAssist] Provide CA for terminal rules
Summary: [ContentAssist] Provide CA for terminal rules
Status: CLOSED DUPLICATE of bug 309303
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-03 12:33 EDT by Moritz Eysholdt CLA
Modified: 2011-07-18 01:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2010-06-03 12:33:54 EDT
Currently, there is no content assist for terminal/datatype rules. However, people sometimes use them to group keywords or allow a particular ambiguity of keywords.

Examples1:
   "foo" | "bar";


terminal Examples2:
   "." | (" " | "\n");


It can be analyzed statically how many possible values for a datatype/terminal rule there are. How about providing content assist if there are... let's say... less then a hundred?
Comment 1 Sebastian Zarnekow CLA 2010-10-05 08:44:18 EDT
100's of synthetic proposals do not seem to be helpful.
Comment 2 Sebastian Zarnekow CLA 2010-10-05 08:46:40 EDT
See also 309303

*** This bug has been marked as a duplicate of bug 309303 ***
Comment 3 Mirko Raner CLA 2011-07-18 01:13:50 EDT
I am not sure whether this is really a duplicate of 309303.
There is a difference in the content assist support between inlined keywords and terminal rules.
For example,

grammar ws.raner.xtext.Fish with org.eclipse.xtext.common.Terminals
generate fish "http://raner.ws/xtext/Fish"
Fish: I LIKE fish=QualifiedFish;
QualifiedFish: qualifier=Qualifier 'fish';
enum Qualifier: one|two|red|blue;
terminal I: 'I';
terminal LIKE: 'like';

will provide no content assist support, but when the terminal rules are replaced by keywords content assist will work:

grammar ws.raner.xtext.Fish with org.eclipse.xtext.common.Terminals
generate fish "http://raner.ws/xtext/Fish"
Fish: 'I' 'like' fish=QualifiedFish;
QualifiedFish: qualifier=Qualifier 'fish';
enum Qualifier: one|two|red|blue;

See http://www.eclipse.org/forums/index.php/mv/msg/220809/ for further discussion of this topic.
Comment 4 Mirko Raner CLA 2011-07-18 01:18:49 EDT
My findings were based on Xtext 2.0.0, so this is still an ongoing problem.