mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
PY-48012 Resolve and complete attributes in PEP 634 class patterns
Both are implemented other the type of the corresponding class. References resolve to any readable attribute of a class, however some obviously wrong variants such as special "dunder" attributes and methods are intentionally excluded from completion suggestions. GitOrigin-RevId: 5edac14f47cba39840b15b0dd7f21e2e46077261
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d15bf8a552
commit
1421975c96
@@ -1,5 +1,10 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.python.psi;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface PyClassPattern extends PyPattern {
|
||||
@NotNull PyReferenceExpression getClassNameReference();
|
||||
|
||||
@NotNull PyPatternArgumentList getArgumentList();
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ public abstract class PyElementGenerator {
|
||||
|
||||
@NotNull
|
||||
public abstract PyExpression createExpressionFromText(@NotNull LanguageLevel languageLevel, @NotNull String text) throws IncorrectOperationException;
|
||||
|
||||
@NotNull
|
||||
public abstract PyPattern createPatternFromText(@NotNull LanguageLevel languageLevel, @NotNull String text) throws IncorrectOperationException;
|
||||
|
||||
/**
|
||||
* Adds elements to list inserting required commas.
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.jetbrains.python.psi;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface PyKeywordPattern extends PyPattern {
|
||||
@NotNull String getKeyword();
|
||||
|
||||
@NotNull PsiElement getKeywordElement();
|
||||
|
||||
@Nullable PyPattern getValuePattern();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user