1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 440642 - [Content Assist] No Completion in Template Aliases

Fix for bug including test. This change will need to be adapted if Bug
440422 is submitted as currently proposed, because it replaces the
existing constants for selecting the comparison strategy with an enum.

Change-Id: I657c6f24217c5d1810a088080ee0ecadb3b83e9b
Signed-off-by: Thomas Corbat <tcorbat@hsr.ch>
Reviewed-on: https://git.eclipse.org/r/30661
Tested-by: Hudson CI
Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
Thomas Corbat 2014-07-29 14:49:29 +02:00
parent b149d46eb4
commit 312f6dc9ac
2 changed files with 9 additions and 2 deletions

View file

@ -2008,7 +2008,8 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
ICPPASTTypeId aliasedType = typeId(DeclarationOptions.TYPEID);
if (LT(1) != IToken.tSEMI){
final int nextToken = LT(1);
if (nextToken != IToken.tSEMI && nextToken != IToken.tEOC){
throw backtrack;
}
int endOffset = consume().getEndOffset();

View file

@ -1367,4 +1367,10 @@ public class CompletionTests extends AbstractContentAssistTest {
final String[] expected = { "Specialization<typename T1, typename T2>" };
assertContentAssistResults(fCursorOffset, expected, true, COMPARE_ID_STRINGS);
}
// using Alias = C/*cursor*/
public void testAliasDeclarationCompletion() throws Exception {
final String[] expectedID = { "C1", "C2", "C3" };
assertContentAssistResults(fCursorOffset, expectedID, true, COMPARE_ID_STRINGS);
}
}