Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341450 - [ContentAssist] Don't propose subsequent tokens if current token is broken CrossReference
Summary: [ContentAssist] Don't propose subsequent tokens if current token is broken Cr...
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext Backlog (show other bugs)
Version: 2.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: 409580
  Show dependency tree
 
Reported: 2011-03-31 03:57 EDT by Sebastian Zarnekow CLA
Modified: 2013-05-31 08:43 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.