Skip to content

Commit

Permalink
chore: improve popup syntax for "(class) ClassName"
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Oct 24, 2023
1 parent 5cb9cf5 commit a2b9ba1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions syntaxes/pyright.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ contexts:
###[ PYRIGHT TYPE TAGS ]######################################################

lsp-type:
# this happens when you hover on the "Foo" of "class Foo:"
- match: ^(\()(class)(\))\s+(.*)
captures:
1: punctuation.section.parens.begin.python
2: storage.type.python
3: punctuation.section.parens.end.python
4: entity.name.class.python # use a more specific scope to the class name
# consume the leading type. e.g., (function)
- match: ^\(
scope: punctuation.section.parens.begin.python
Expand Down
1 change: 1 addition & 0 deletions syntaxes/syntax_test.pyright-syntax-test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

(class) ClassName
# ^^^^ storage.type
# ^^^^^^^^^ entity.name.class

class ClassName(foo: int, /, *args: Any, **kwargs: Any)
# ^^^ keyword.declaration.class
Expand Down

0 comments on commit a2b9ba1

Please sign in to comment.