This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
Update tree-sitter-python + Add missing tree-sitter scopes #325
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
faf1e57
:arrow_up: Update tree-sitter-python
aminya ad4b980
Update Travis linux distro
aminya ebe8830
:arrow_up: bump tree-sitter-python to 0.17.0
aminya d989f9a
Add keyword.control.return
aminya c2b79f1
Add punctuations
aminya 6325ed1
Use function.def for function_definition
aminya 89351c1
Use function.call for call
aminya b0a77d5
Support constructor
aminya 37c8e1d
Support lambda parameters
aminya 98cab19
Support typed parameters
aminya 6e5de57
Support self matching
aminya 4d96607
Support argument list
aminya 5d54870
use entity.name.function.definition
aminya 9314882
Merge remote-tracking branch 'upstream/master'
aminya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ git: | |
|
||
sudo: false | ||
|
||
dist: trusty | ||
dist: bionic | ||
|
||
addons: | ||
apt: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,18 +73,21 @@ scopes: | |
'interpolation > "}"': 'punctuation.section.embedded' | ||
|
||
'class_definition > identifier': 'entity.name.type.class' | ||
'function_definition > identifier': 'entity.name.function' | ||
'function_definition > identifier': 'entity.name.function.definition' | ||
'call > identifier:nth-child(0)': [ | ||
{match: '^(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes|callable|chr|classmethod|compile|complex|delattr|dict|dir|divmod|enumerate|eval|exec|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|isinstance|issubclass|iter|len|list|locals|map|max|memoryview|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip|__import__)$', | ||
scopes: 'support.function'}, | ||
'entity.name.function' | ||
scopes: 'support.function.call'}, | ||
{match: '^[A-Z]', scopes: 'support.type.contructor'} | ||
'entity.name.function.call' | ||
] | ||
'call > attribute > identifier:nth-child(2)': 'entity.name.function' | ||
|
||
'identifier': | ||
'identifier': [ | ||
{match: | ||
'^(BaseException|Exception|TypeError|StopAsyncIteration|StopIteration|ImportError|ModuleNotFoundError|OSError|ConnectionError|BrokenPipeError|ConnectionAbortedError|ConnectionRefusedError|ConnectionResetError|BlockingIOError|ChildProcessError|FileExistsError|FileNotFoundError|IsADirectoryError|NotADirectoryError|InterruptedError|PermissionError|ProcessLookupError|TimeoutError|EOFError|RuntimeError|RecursionError|NotImplementedError|NameError|UnboundLocalError|AttributeError|SyntaxError|IndentationError|TabError|LookupError|IndexError|KeyError|ValueError|UnicodeError|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|AssertionError|ArithmeticError|FloatingPointError|OverflowError|ZeroDivisionError|SystemError|ReferenceError|BufferError|MemoryError|Warning|UserWarning|DeprecationWarning|PendingDeprecationWarning|SyntaxWarning|RuntimeWarning|FutureWarning|ImportWarning|UnicodeWarning|BytesWarning|ResourceWarning|GeneratorExit|SystemExit|KeyboardInterrupt)$' | ||
scopes: 'support.type.exception'} | ||
scopes: 'support.type.exception'}, | ||
{match: '^(self)', scopes: 'entity.name.variable.self'} | ||
] | ||
|
||
'attribute > identifier:nth-child(2)': 'variable.other.object.property' | ||
|
||
|
@@ -115,6 +118,10 @@ scopes: | |
'parameters > dictionary_splat > identifier': 'variable.parameter.function' | ||
'default_parameter > identifier:nth-child(0)': 'variable.parameter.function' | ||
'keyword_argument > identifier:nth-child(0)': 'variable.parameter.function' | ||
'lambda_parameters > identifier': 'variable.parameter.function' | ||
'typed_parameter > identifier': 'variable.parameter.function' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why |
||
|
||
'argument_list': 'meta.method-call.python' | ||
|
||
'"if"': 'keyword.control' | ||
'"else"': 'keyword.control' | ||
|
@@ -177,3 +184,12 @@ scopes: | |
'"or"': 'keyword.operator.logical.python' | ||
'"not"': 'keyword.operator.logical.python' | ||
'"is"': 'keyword.operator.logical.python' | ||
'"->"': 'keyword.control.return' | ||
|
||
'"["': 'punctuation.definition.begin.bracket.square' | ||
'"]"': 'punctuation.definition.end.bracket.square' | ||
'","': 'punctuation.separator.delimiter' | ||
'"{"': 'punctuation.section.block.begin.bracket.curly' | ||
'"}"': 'punctuation.section.block.end.bracket.curly' | ||
'"("': 'punctuation.section.parens.begin.bracket.round' | ||
'")"': 'punctuation.section.parens.end.bracket.round' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs ^(self)\\b otherwise it'll match the self in
selfserve
and other things