PY-73246 Automatically insert square brackets on completion of parameterized types

GitOrigin-RevId: 5e81bc984fa3c7b4f83c564c85d872c5a49cf391
This commit is contained in:
Mikhail Golubev
2024-06-12 12:24:16 +05:00
committed by intellij-monorepo-bot
parent 52850e21d8
commit 1a3e6c2a64
26 changed files with 141 additions and 9 deletions

View File

@@ -1,3 +1,3 @@
from typing import List
xs = [] # type: List
xs = [] # type: List[]

View File

@@ -2,4 +2,4 @@ from typing import Final
class C:
attr: Final(<caret>)
attr: Final[<caret>]

View File

@@ -1,3 +1,3 @@
from typing import Tuple
attr: Tuple<caret>
attr: Tuple[<caret>]

View File

@@ -0,0 +1,4 @@
from typing import TypeAlias
Alias: TypeAlias = list[<caret>]

View File

@@ -0,0 +1,4 @@
from typing import TypeAlias
Alias: TypeAlias = lis<caret>

View File

@@ -0,0 +1 @@
xs = [] # type: list[<caret>]

View File

@@ -0,0 +1 @@
xs = [] # type: lis<caret>

View File

@@ -0,0 +1,3 @@
from mod import UniqueBox
x: UniqueBox[<caret>]

View File

@@ -0,0 +1,2 @@
class UniqueBox[T]:
pass

View File

@@ -0,0 +1,5 @@
from typing import ClassVar
class C:
attr: ClassVar[<caret>]

View File

@@ -0,0 +1,3 @@
@_SpecialForm
def ClassVar(self, parameters):
...

View File

@@ -0,0 +1,3 @@
from mod import UniqueBox
x = UniqueBox<caret>

View File

@@ -0,0 +1,2 @@
class UniqueBox[T]:
pass