Skip to content

Commit d5be718

Browse files
committed
Add few more tests for PEP 484 typehinting comments
1 parent 15f8127 commit d5be718

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

test/comments/typing1.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# type: ignore # test
22
# type: ignore
33
# type:ignore
4+
#type:ignore
45
# type: ignore 1
56
# type: 1 ignore
67
# type : ignore
@@ -24,6 +25,9 @@
2425
type: : comment.line.number-sign.python, comment.typehint.directive.notation.python, meta.typehint.comment.python, source.python
2526
ignore : comment.line.number-sign.python, comment.typehint.ignore.notation.python, meta.typehint.comment.python, source.python
2627
# : comment.line.number-sign.python, meta.typehint.comment.python, source.python
28+
type: : comment.line.number-sign.python, comment.typehint.directive.notation.python, meta.typehint.comment.python, source.python
29+
ignore : comment.line.number-sign.python, comment.typehint.ignore.notation.python, meta.typehint.comment.python, source.python
30+
# : comment.line.number-sign.python, meta.typehint.comment.python, source.python
2731
type: : comment.line.number-sign.python, comment.typehint.directive.notation.python, meta.typehint.comment.python, source.python
2832
: comment.line.number-sign.python, meta.typehint.comment.python, source.python
2933
ignore : comment.line.number-sign.python, comment.typehint.variable.notation.python, meta.typehint.comment.python, source.python

test/comments/typing6.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
a=1#type:int
2+
a=1#type:int#int
3+
4+
5+
6+
a : source.python
7+
= : keyword.operator.assignment.python, source.python
8+
1 : constant.numeric.dec.python, source.python
9+
# : comment.line.number-sign.python, meta.typehint.comment.python, source.python
10+
type: : comment.line.number-sign.python, comment.typehint.directive.notation.python, meta.typehint.comment.python, source.python
11+
int : comment.line.number-sign.python, comment.typehint.type.notation.python, meta.typehint.comment.python, source.python
12+
a : source.python
13+
= : keyword.operator.assignment.python, source.python
14+
1 : constant.numeric.dec.python, source.python
15+
# : comment.line.number-sign.python, meta.typehint.comment.python, source.python
16+
type: : comment.line.number-sign.python, comment.typehint.directive.notation.python, meta.typehint.comment.python, source.python
17+
int : comment.line.number-sign.python, comment.typehint.type.notation.python, meta.typehint.comment.python, source.python
18+
# : comment.line.number-sign.python, punctuation.definition.comment.python, source.python
19+
int : comment.line.number-sign.python, source.python

0 commit comments

Comments
 (0)