Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJohn Camelon2004-03-30 07:47:04 -0500
committerJohn Camelon2004-03-30 07:47:04 -0500
commit8fda490dee74966147c0057a26bb4865d31738ab (patch)
treeadee633ec14b44abd6a057022b3a38b4926ddacc /core
parentf76fe15b92b4ccd8b33d06dfaa2149caf59d45b8 (diff)
downloadorg.eclipse.cdt-8fda490dee74966147c0057a26bb4865d31738ab.tar.gz
org.eclipse.cdt-8fda490dee74966147c0057a26bb4865d31738ab.tar.xz
org.eclipse.cdt-8fda490dee74966147c0057a26bb4865d31738ab.zip
Partial fix for Bug 56614 - Content Assist] Global variables do not appear in a global completion list
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/ChangeLog-parser3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java11
2 files changed, 13 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog-parser b/core/org.eclipse.cdt.core/parser/ChangeLog-parser
index ae7c7468e4..c4a27947c0 100644
--- a/core/org.eclipse.cdt.core/parser/ChangeLog-parser
+++ b/core/org.eclipse.cdt.core/parser/ChangeLog-parser
@@ -1,3 +1,6 @@
+2004-03-30 John Camelon
+ Partial fix for Bug 56614 - Content Assist] Global variables do not appear in a global completion list
+
2004-03-29 Andrew Niefer
fixed bug 56620 - Outline view stops on error on last line of block
(errorHandling() goes to far)
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java
index f027042304..acb06e57a7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java
@@ -1746,11 +1746,14 @@ public abstract class Parser extends ExpressionParser implements IParser
{
// handle initializer
final IASTScope scope = d.getDeclarationWrapper().getScope();
+ setCompletionValues(scope,CompletionKind.NO_SUCH_KIND,Key.EMPTY);
if (LT(1) == IToken.tASSIGN)
{
consume(IToken.tASSIGN);
+ setCompletionValues(scope,CompletionKind.SINGLE_NAME_REFERENCE,Key.EMPTY);
IASTInitializerClause clause = initializerClause(scope);
d.setInitializerClause(clause);
+ setCompletionValues(scope,CompletionKind.NO_SUCH_KIND,Key.EMPTY);
}
else if (LT(1) == IToken.tLPAREN )
{
@@ -1759,8 +1762,10 @@ public abstract class Parser extends ExpressionParser implements IParser
try
{
consume(IToken.tLPAREN); // EAT IT!
+ setCompletionValues(scope,CompletionKind.SINGLE_NAME_REFERENCE,Key.EMPTY);
IASTExpression astExpression = null;
astExpression = expression(scope);
+ setCompletionValues(scope,CompletionKind.NO_SUCH_KIND,Key.EMPTY);
consume(IToken.tRPAREN);
d.setConstructorExpression(astExpression);
} catch( BacktrackException bt )
@@ -1773,10 +1778,14 @@ public abstract class Parser extends ExpressionParser implements IParser
protected void optionalCInitializer( Declarator d ) throws EndOfFileException, BacktrackException
{
+ final IASTScope scope = d.getDeclarationWrapper().getScope();
+ setCompletionValues(scope,CompletionKind.NO_SUCH_KIND,Key.EMPTY);
if( LT(1) == IToken.tASSIGN )
{
consume( IToken.tASSIGN );
- d.setInitializerClause( cInitializerClause(d.getDeclarationWrapper().getScope(), EMPTY_LIST ) );
+ setCompletionValues(scope,CompletionKind.SINGLE_NAME_REFERENCE,Key.EMPTY);
+ d.setInitializerClause( cInitializerClause(scope, EMPTY_LIST ) );
+ setCompletionValues(scope,CompletionKind.NO_SUCH_KIND,Key.EMPTY);
}
}
/**

Back to the top