Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341450

Summary: [ContentAssist] Don't propose subsequent tokens if current token is broken CrossReference
Product: [Modeling] TMF Reporter: Sebastian Zarnekow <sebastian.zarnekow>
Component: Xtext BacklogAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 409580    

Description Sebastian Zarnekow CLA 2011-03-31 03:57:46 EDT
Consider a simple grammar that allows to write

var aa = 1;
var bb = 2;
var cc = aa + bb;

where '+' is a keyword.

When ContentAssist is invoked on

var cc = a|a + bb;

'+' is suggested which is syntactically correct but actually not what one would expect. We should investigate how to detect a broken "current" cross reference and only propose values that would complete this cross reference.

There are several cases to consider, e.g. a plain 'a' might be an identifier which is part of another decision tree that does not involve a cross reference at that position, or 'a' might be a prefix of a keyword.
Comment 1 Sebastian Zarnekow CLA 2011-03-31 16:03:00 EDT
There are (many) other weird scenarios possible, too, e.g.

var a = 1;
var aaa = 2;
var b = a|a + 3;

The cross reference at the cursor position is unresolved, but the prefix itself can be resolved thus the keywords '+' and ';' as well as the cross-references 'a' and 'aaa' are valid.