Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348427 - Content assist offers illegal keywords
Summary: Content assist offers illegal keywords
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-06 11:45 EDT by Peter Feiler CLA
Modified: 2017-09-19 17:18 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
Grammar that produces the bug (3.08 KB, text/plain)
2011-06-06 11:46 EDT, Peter Feiler CLA
no flags Details
generation script for grammar (generic from new Xtext project) (3.95 KB, text/plain)
2011-06-06 11:47 EDT, Peter Feiler CLA
no flags Details
Example model that produces the bug (665 bytes, text/plain)
2011-06-06 11:48 EDT, Peter Feiler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Feiler CLA 2011-06-06 11:45:36 EDT
Build Identifier: Eclipse Helios Build id: 20110218-0911 Xtext 2.0.0.v201106010845

I have a grammar for language whose syntax is already defined. In this grammar I have a rule that has several lists of elements, each section starting with a keyword. In one of the sections I have lists of alternatives via an alternatives rule, where each alternative has its own rule that includes a name, an optional element with two keywords and an enumeration. If I am after the name, content asssist not only shows the legal elements of the subrule, but also offers the keyword of the next section, which is not legal and the parser then marks.
This occurs only if I have three or more alternatives in the alternative rule and both the optional and enumeration in each of the subrules. It does not occur if I have only two alternatives, or a single keyword in the optional, or only the optional and not the enumeration. It also does not occur if I do not have three subrules, but a single rule that returns the appropriate subclasses - in this case all the subclasses are stored in a single list rather than the desirable separate lists for each subclass.

Reproducible: Always

Steps to Reproduce:
1.Install the attached grammar and generate the editor using MyDsl
2.Open the editor on the attached example file
3.Place the cursor after the colon (:) in the port declaration and activate content assist. The example has several places (marked with comments) wherre content assist works or does not work.
Comment 1 Peter Feiler CLA 2011-06-06 11:46:29 EDT
Created attachment 197410 [details]
Grammar that produces the bug
Comment 2 Peter Feiler CLA 2011-06-06 11:47:35 EDT
Created attachment 197411 [details]
generation script for grammar (generic from new Xtext project)
Comment 3 Peter Feiler CLA 2011-06-06 11:48:13 EDT
Created attachment 197412 [details]
Example model that produces the bug
Comment 4 Peter Feiler CLA 2011-06-06 11:49:21 EDT
XText Build  2.0.0.v201106010845 under Helios.
Comment 5 Sebastian Zarnekow CLA 2011-06-14 08:39:52 EDT
Pushed to master.
Comment 6 Karsten Thoms CLA 2017-09-19 17:06:49 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 7 Karsten Thoms CLA 2017-09-19 17:18:37 EDT
Closing all bugs that were set to RESOLVED before Neon.0