don't suggest 'this' keyword in java comments

This commit is contained in:
peter.gromov
2010-11-18 16:07:47 +03:00
parent ab668b6179
commit 264b830a24
3 changed files with 12 additions and 0 deletions

View File

@@ -551,6 +551,10 @@ public class JavaCompletionData extends JavaAwareCompletionData{
@Override
public void fillCompletions(CompletionParameters parameters, CompletionResultSet result) {
final PsiElement position = parameters.getPosition();
if (PsiTreeUtil.getParentOfType(position, PsiComment.class, false) != null) {
return;
}
if (SUPER_OR_THIS_PATTERN.accepts(position)) {
if (AFTER_DOT.accepts(position) && !isInsideQualifierClass(position)) return;

View File

@@ -0,0 +1,6 @@
class Foo {
{
int[] x = new int[]{ // th<caret>
}
}
}

View File

@@ -355,6 +355,8 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
doTest();
}
public void testNoThisInComment() throws Throwable { doAntiTest() }
public void testLastExpressionInFor() throws Throwable { doTest(); }
public void testUndoCommonPrefixOnHide() throws Throwable {//actually don't undo