mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Bug 509182 - Completion of class type in using-declaration
Change-Id: Iacd0ab4bfead2df31cddc78840853eb697139b02
This commit is contained in:
parent
b1d6194e14
commit
9e60a646fd
2 changed files with 15 additions and 2 deletions
|
@ -1481,7 +1481,16 @@ public class CompletionTests extends AbstractContentAssistTest {
|
||||||
final String[] expected= { "foo()" };
|
final String[] expected= { "foo()" };
|
||||||
assertCompletionResults(fCursorOffset, expected, REPLACEMENT);
|
assertCompletionResults(fCursorOffset, expected, REPLACEMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// namespace N {
|
||||||
|
// class waldo {};
|
||||||
|
// }
|
||||||
|
// using N::w/*cursor*/
|
||||||
|
public void testUsingDeclaration_509182() throws Exception {
|
||||||
|
final String[] expected = { "waldo;" };
|
||||||
|
assertCompletionResults(fCursorOffset, expected, REPLACEMENT);
|
||||||
|
}
|
||||||
|
|
||||||
// template <typen/*cursor*/
|
// template <typen/*cursor*/
|
||||||
public void testTemplateDeclaration_397288() throws Exception {
|
public void testTemplateDeclaration_397288() throws Exception {
|
||||||
final String[] expected= { "typename" };
|
final String[] expected= { "typename" };
|
||||||
|
|
|
@ -486,7 +486,11 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
|
||||||
getImage(classType), baseRelevance + relevance, cContext));
|
getImage(classType), baseRelevance + relevance, cContext));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proposals.add(createProposal(classType.getName(), classType.getName(), getImage(classType),
|
StringBuilder repStringBuff = new StringBuilder(classType.getName());
|
||||||
|
if (cContext.isInUsingDirective() && !cContext.isFollowedBySemicolon()) {
|
||||||
|
repStringBuff.append(';');
|
||||||
|
}
|
||||||
|
proposals.add(createProposal(repStringBuff.toString(), classType.getName(), getImage(classType),
|
||||||
baseRelevance + RelevanceConstants.CLASS_TYPE_RELEVANCE, cContext));
|
baseRelevance + RelevanceConstants.CLASS_TYPE_RELEVANCE, cContext));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue