mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 04:15:35 +02:00
Removed duplicate and empty names from the completion node.
This commit is contained in:
parent
c47e2bcfca
commit
1dbadaeb96
2 changed files with 3 additions and 5 deletions
|
@ -529,10 +529,7 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
|
||||||
expr.setName(exprName);
|
expr.setName(exprName);
|
||||||
exprName.setParent(expr);
|
exprName.setParent(expr);
|
||||||
exprName.setPropertyInParent(IASTIdExpression.ID_NAME);
|
exprName.setPropertyInParent(IASTIdExpression.ID_NAME);
|
||||||
|
|
||||||
createCompletionNode(token);
|
|
||||||
completionNode.addName(exprName);
|
|
||||||
|
|
||||||
// Now the declaration statement
|
// Now the declaration statement
|
||||||
IASTDeclarationStatement declStmt = createDeclarationStatement();
|
IASTDeclarationStatement declStmt = createDeclarationStatement();
|
||||||
declStmt.setParent(result);
|
declStmt.setParent(result);
|
||||||
|
@ -549,7 +546,6 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
|
||||||
declSpec.setName(declSpecName);
|
declSpec.setName(declSpecName);
|
||||||
declSpecName.setParent(declSpec);
|
declSpecName.setParent(declSpec);
|
||||||
declSpecName.setPropertyInParent(IASTNamedTypeSpecifier.NAME);
|
declSpecName.setPropertyInParent(IASTNamedTypeSpecifier.NAME);
|
||||||
completionNode.addName(declSpecName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4365,6 +4365,8 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
|
||||||
mostRelevantScopeNode = translationUnit;
|
mostRelevantScopeNode = translationUnit;
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
|
if (LT(1) == IToken.tEOC)
|
||||||
|
break;
|
||||||
int checkOffset = LA(1).hashCode();
|
int checkOffset = LA(1).hashCode();
|
||||||
IASTDeclaration declaration = declaration();
|
IASTDeclaration declaration = declaration();
|
||||||
translationUnit.addDeclaration(declaration);
|
translationUnit.addDeclaration(declaration);
|
||||||
|
|
Loading…
Add table
Reference in a new issue