Skip to content

Commit

Permalink
fix: restore full python syntax support (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe authored Jun 28, 2023
1 parent 3fba0fc commit 2d8e803
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
12 changes: 1 addition & 11 deletions syntaxes/pyright.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ file_extensions:
contexts:
main:
- include: lsp-type
- include: class-definitions
- include: function-definitions
- include: assignment-statements
- include: qualified-name
- include: comments
- include: statements

###[ PYTHON TYPE ANNOTATIONS ]################################################

Expand Down Expand Up @@ -230,9 +226,3 @@ contexts:
- meta_content_scope: meta.function.signature.python meta.type.python
- include: lsp-type-function-return-type-end
- include: type-hint-expressions

###[ PROTOTYPES ]#############################################################

eol-pop:
- match: $
pop: 1
8 changes: 3 additions & 5 deletions syntaxes/syntax_test.pyright-syntax-test
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,9 @@ class ClassName(foo: int, /, *args: Any, **kwargs: Any)
# ^^^ support.type.python
# ^^ punctuation.section.brackets.end.python

# ```py
# import os, tempfile
# if os.name != "nt":
# f = tempfile.NamedTemporaryFile("w")
# ```
import os, tempfile
if os.name != "nt":
f = tempfile.NamedTemporaryFile("w")
# The following case comes the above code when running under Windows and hover on "NamedTemporaryFile".
# Notice that it has no leading type information, e.g., "(variable)".
NamedTemporaryFile: Overload[() -> None, () -> None, (mode: Literal['r', 'w'] = ..., size: int = ...) -> None]
Expand Down

0 comments on commit 2d8e803

Please sign in to comment.