mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix PY-7018
GitOrigin-RevId: 56344326c46ce29b03fd3733cff0c989b357e594
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c48d303998
commit
e62d70bc56
+7
-1
@@ -247,6 +247,9 @@ public class PyKeywordCompletionContributor extends CompletionContributor {
|
||||
public static final PsiElementPattern.Capture<PsiElement> AFTER_QUALIFIER =
|
||||
psiElement().afterLeaf(psiElement().withText(".").inside(PyReferenceExpression.class));
|
||||
|
||||
public static final PsiElementPattern.Capture<PsiElement> TARGET_AFTER_QUALIFIER =
|
||||
psiElement().afterLeaf(psiElement().withText(".").inside(PyTargetExpression.class));
|
||||
|
||||
public static final FilterPattern FIRST_ON_LINE = new FilterPattern(new StartOfLineFilter());
|
||||
|
||||
private static final PsiElementPattern.Capture<PsiElement> IN_IMPORT_AFTER_REF =
|
||||
@@ -592,6 +595,7 @@ public class PyKeywordCompletionContributor extends CompletionContributor {
|
||||
.andNot(IN_PARAM_LIST)
|
||||
.andNot(IN_FUNCTION_HEADER)
|
||||
.andNot(AFTER_QUALIFIER).andNot(IN_STRING_LITERAL)
|
||||
.andNot(AFTER_QUALIFIER).andNot(IN_STRING_LITERAL).andNot(TARGET_AFTER_QUALIFIER)
|
||||
,
|
||||
new PyKeywordCompletionProvider(PyNames.NOT, PyNames.LAMBDA)
|
||||
);
|
||||
@@ -607,6 +611,7 @@ public class PyKeywordCompletionContributor extends CompletionContributor {
|
||||
.andNot(AFTER_QUALIFIER)
|
||||
.andNot(IN_FUNCTION_HEADER)
|
||||
.andNot(IN_STRING_LITERAL)
|
||||
.andNot(TARGET_AFTER_QUALIFIER)
|
||||
,
|
||||
new PyKeywordCompletionProvider(TailType.NONE, PyNames.TRUE, PyNames.FALSE, PyNames.NONE));
|
||||
extend(CompletionType.BASIC,
|
||||
@@ -617,7 +622,8 @@ public class PyKeywordCompletionContributor extends CompletionContributor {
|
||||
.andNot(IN_IMPORT_STMT)
|
||||
.andNot(IN_PARAM_LIST)
|
||||
.andNot(AFTER_QUALIFIER)
|
||||
.andNot(IN_STRING_LITERAL),
|
||||
.andNot(IN_STRING_LITERAL)
|
||||
.andNot(TARGET_AFTER_QUALIFIER),
|
||||
new PyKeywordCompletionProvider(PyNames.ASYNC));
|
||||
extend(CompletionType.BASIC,
|
||||
psiElement()
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class A:
|
||||
def __init__(self):
|
||||
self.dct1 = []
|
||||
self.dct1.<caret> = None #here "lambda" and "not" must not be in completion list
|
||||
@@ -236,6 +236,11 @@ public class PythonKeywordCompletionTest extends PyTestCase {
|
||||
myFixture.checkResult("from ... import ");
|
||||
}
|
||||
|
||||
// PY-7018
|
||||
public void testNoNotAndLambdaAfterTargetQualifier() {
|
||||
assertDoesntContain(doTestByTestName(), "not", "lambda");
|
||||
}
|
||||
|
||||
// PY-13111
|
||||
public void testNoForAndYieldInCommentContext() {
|
||||
assertDoesntContain(doTestByTestName(), "for", "yield");
|
||||
|
||||
Reference in New Issue
Block a user