mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
bug 52948 - Content Assist -typedef'd types do not appear in the completion list
This commit is contained in:
parent
2805a77fe0
commit
9ba01d10c4
2 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2004-03-09 Andrew Niefer
|
||||||
|
Added CompletionParseTest.testBug52948
|
||||||
|
|
||||||
2004-03-09 Bogdan Gheorghe
|
2004-03-09 Bogdan Gheorghe
|
||||||
Workaround to get DependencyTests working on integration builds.
|
Workaround to get DependencyTests working on integration builds.
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.cdt.core.parser.ast.IASTFunction;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTMethod;
|
import org.eclipse.cdt.core.parser.ast.IASTMethod;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTNode;
|
import org.eclipse.cdt.core.parser.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
|
import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration;
|
||||||
|
import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
import org.eclipse.cdt.core.parser.ast.IASTVariable;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTNode.ILookupResult;
|
import org.eclipse.cdt.core.parser.ast.IASTNode.ILookupResult;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind;
|
import org.eclipse.cdt.core.parser.ast.IASTNode.LookupKind;
|
||||||
|
@ -639,4 +640,26 @@ public class CompletionParseTest extends CompleteParseBaseTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug52948() throws Exception{
|
||||||
|
StringWriter writer = new StringWriter();
|
||||||
|
writer.write( "typedef int Int; ");
|
||||||
|
writer.write( "InSP" );
|
||||||
|
|
||||||
|
String code = writer.toString();
|
||||||
|
int index = code.indexOf( "SP" );
|
||||||
|
|
||||||
|
IASTCompletionNode node = parse( code, index );
|
||||||
|
ILookupResult result = node.getCompletionScope().lookup( node.getCompletionPrefix(),
|
||||||
|
new IASTNode.LookupKind[]{ IASTNode.LookupKind.TYPEDEFS },
|
||||||
|
node.getCompletionContext() );
|
||||||
|
|
||||||
|
assertEquals( result.getResultsSize(), 1 );
|
||||||
|
|
||||||
|
Iterator iter = result.getNodes();
|
||||||
|
IASTTypedefDeclaration typeDef = (IASTTypedefDeclaration) iter.next();
|
||||||
|
|
||||||
|
assertEquals( typeDef.getName(), "Int" );
|
||||||
|
assertFalse( iter.hasNext() );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue