Bug 477359 - Completion node inside attribute specifier
authorNathan Ridge <zeratul976@hotmail.com>
Fri, 27 Nov 2015 07:33:54 +0000 (02:33 -0500)
committerSergey Prigogin <eclipse.sprigogin@gmail.com>
Thu, 24 Dec 2015 02:26:41 +0000 (18:26 -0800)
Change-Id: I54902dc41834943a3fcfcca60ebbc2944fa0a68a
Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/AbstractGNUSourceCodeParser.java
core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/contentassist2/CompletionTests.java

index b80bc3b..9ed31b0 100644 (file)
@@ -2462,6 +2462,11 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
                IToken t;
                while ((t = LA(1)).getType() != endType) {
                        t = consume();
+                       
+                       if (t.getType() == IToken.tCOMPLETION || t.getType() == IToken.tEOC) {
+                               break;
+                       }
+                       
                        result.addToken(createASTToken(t));
 
                        IASTToken token;
index 256bf40..7e61b42 100644 (file)
@@ -1722,4 +1722,10 @@ public class CompletionTests extends AbstractContentAssistTest {
                final String[] expected = { "A", "C", "foo(void)" };
                assertCompletionResults(fCursorOffset, expected, ID);
        }
+
+       //      int [[f(./*cursor*/)]] i;
+       public void testCompletionInsideAttribute_bug477359() throws Exception {
+               final String[] expected = {};
+               assertCompletionResults(fCursorOffset, expected, ID);
+       }
 }