From 9eae0b418567c3a15a81ad71694c658d254a8d1c Mon Sep 17 00:00:00 2001 From: Linus Eriksson Date: Fri, 23 Nov 2018 20:51:32 +0100 Subject: [PATCH 01/37] Add more scopes to the tree sitter grammar Exceptions -> support.type.exception integer&float -> numeric add @ and @= operator --- grammars/tree-sitter-python.cson | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index 46a4e37..1afdc38 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -74,6 +74,11 @@ scopes: ] 'call > attribute > identifier:nth-child(2)': 'entity.name.function' + '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'} + 'attribute > identifier:nth-child(2)': 'variable.other.object.property' 'decorator': 'entity.name.function.decorator' @@ -81,8 +86,8 @@ scopes: 'none': 'constant.language' 'true': 'constant.language' 'false': 'constant.language' - 'integer': 'constant.language' - 'float': 'constant.language' + 'integer': 'constant.numeric' + 'float': 'constant.numeric' 'type > identifier': 'support.storage.type' @@ -149,6 +154,8 @@ scopes: '"~"': 'keyword.operator' '"<<"': 'keyword.operator' '">>"': 'keyword.operator' + 'binary_operator > "@"': 'keyword.operator' + 'binary_operator > "@="': 'keyword.operator' '"in"': 'keyword.operator.logical.python' '"and"': 'keyword.operator.logical.python' '"or"': 'keyword.operator.logical.python' From 50f0fd087c78874ca60edc3c738d3ae2297fc33d Mon Sep 17 00:00:00 2001 From: Caleb Evans Date: Sat, 6 Apr 2019 12:32:54 -0700 Subject: [PATCH 02/37] Add support for python2/3 shebangs in tree-sitter grammar --- grammars/tree-sitter-python.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index ff31929..e95ceb7 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -5,7 +5,7 @@ parser: 'tree-sitter-python' firstLineRegex: [ # shebang line - '^#!.*\\b(python)\\r?\\n' + '^#![ \\t]*/.*\\bpython[\\d\\.]*\\b' # vim modeline 'vim\\b.*\\bset\\b.*\\b(filetype|ft|syntax)=python' From 7159e8b5b1092d73844bd69ee14434be82629f77 Mon Sep 17 00:00:00 2001 From: Caleb Evans Date: Sat, 6 Apr 2019 13:39:11 -0700 Subject: [PATCH 03/37] Tokenize formal function parameters in tree-sitter grammar --- grammars/tree-sitter-python.cson | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index ff31929..0560c96 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -99,6 +99,8 @@ scopes: '"global"': 'storage.modifier.global' '"nonlocal"': 'storage.modifier.nonlocal' + 'parameters > identifier': 'variable.parameter.function' + 'default_parameter > identifier:nth-child(0)': 'variable.parameter.function' 'keyword_argument > identifier:nth-child(0)': 'variable.parameter.function' '"if"': 'keyword.control' From c8283a90ffb4896000df053bd27ef0fee6611a2a Mon Sep 17 00:00:00 2001 From: Caleb Evans Date: Sat, 6 Apr 2019 14:04:33 -0700 Subject: [PATCH 04/37] Tokenize subclass list names in tree-sitter grammar --- grammars/tree-sitter-python.cson | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index ff31929..a99a177 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -92,6 +92,11 @@ scopes: 'type > identifier': 'support.storage.type' + 'class_definition > argument_list > attribute': 'entity.other.inherited-class' + 'class_definition > argument_list > identifier': 'entity.other.inherited-class' + 'class_definition > argument_list > keyword_argument > attribute': 'entity.other.inherited-class' + 'class_definition > argument_list > keyword_argument > identifier:nth-child(2)': 'entity.other.inherited-class' + '"class"': 'storage.type.class' '"def"': 'storage.type.function' '"lambda"': 'storage.type.function' From 177fda9ea6ef02692cf430ac202bef24dbebec50 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 7 Apr 2019 14:30:09 -0700 Subject: [PATCH 05/37] :arrow_up: tree-sitter-python --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 743c8e3..c678365 100644 --- a/package-lock.json +++ b/package-lock.json @@ -123,9 +123,9 @@ "dev": true }, "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" }, "once": { "version": "1.4.0", @@ -165,9 +165,9 @@ "dev": true }, "tree-sitter-python": { - "version": "0.13.6", - "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.13.6.tgz", - "integrity": "sha512-QGc7dNObFv5+kCIvknO+Jv9eHusgamlcxZpLkDioAK6/dZ/f+3vbn3KQ2y4PpS1qiAHaaxh2V4XgMyv6k/rS9g==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.14.0.tgz", + "integrity": "sha512-Kcj5AUdeI4/c/JLsQV8OFI0zLrwcQ1nKoqCRr+W73Tp5SIK+Dd1ILNC5TFHPw1IqOGstcg8AH0XTeU0uq3boZg==", "requires": { "nan": "^2.4.0" } diff --git a/package.json b/package.json index b1bab16..1da205e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "atom-grammar-test": "^0.6.4", - "tree-sitter-python": "^0.13.6" + "tree-sitter-python": "^0.14.0" }, "devDependencies": { "coffeelint": "^1.10.1" From a6a1abef1c558d162b5b9b26bafbc36a3ba81396 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 7 Apr 2019 14:30:31 -0700 Subject: [PATCH 06/37] Prepare 0.51.10 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c678365..62134ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.51.9", + "version": "0.51.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1da205e..60e923e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.51.9", + "version": "0.51.10", "engines": { "atom": "*", "node": "*" From 591fc791290a9aa42b3432ddc1142c89233e59da Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 10 Apr 2019 15:34:05 -0600 Subject: [PATCH 07/37] Prepare 0.52.0 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 62134ae..6e6c485 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.51.10", + "version": "0.52.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 60e923e..0281087 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.51.10", + "version": "0.52.0", "engines": { "atom": "*", "node": "*" From b5011ef56dc4ac01a578f3e620b357ef8ae4c9a0 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 10 Apr 2019 15:49:38 -0600 Subject: [PATCH 08/37] Prepare 0.53.0 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e6c485..5237194 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.52.0", + "version": "0.53.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0281087..51b59a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.52.0", + "version": "0.53.0", "engines": { "atom": "*", "node": "*" From 4d55d0ecbe93ba03a74a28896c921b82cb6bd50b Mon Sep 17 00:00:00 2001 From: Linus Eriksson Date: Thu, 11 Apr 2019 19:36:33 +0200 Subject: [PATCH 09/37] Allow folding if statement without elif or else --- grammars/tree-sitter-python.cson | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index ac1404f..ec0138a 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -25,8 +25,14 @@ fileTypes: [ ] folds: [ + { + type: ['if_statement'] + start: {type: ':'} + end: {type: ['elif_clause', 'else_clause']} + }, { type: [ + 'if_statement' 'elif_clause' 'else_clause' 'for_statement' @@ -39,11 +45,6 @@ folds: [ ] start: {type: ':'} }, - { - type: ['if_statement'] - start: {type: ':'} - end: {type: ['elif_clause', 'else_clause']} - } { start: {type: '(', index: 0} end: {type: ')', index: -1} From be7347256f501028d01621fc1125f0535c6132e3 Mon Sep 17 00:00:00 2001 From: Linus Eriksson Date: Thu, 18 Apr 2019 23:52:31 +0200 Subject: [PATCH 10/37] Prepare 0.53.1 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5237194..6d5e76c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.0", + "version": "0.53.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 51b59a7..9ce904c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.0", + "version": "0.53.1", "engines": { "atom": "*", "node": "*" From 878f3509636237fe7bbfe2c5f06b59229e93fa93 Mon Sep 17 00:00:00 2001 From: Caleb Evans Date: Sun, 12 May 2019 16:09:16 -0700 Subject: [PATCH 11/37] Tokenize *args and **kwargs the same as other parameters These changes are specifically for the Python tree-sitter grammar. --- grammars/tree-sitter-python.cson | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index ec0138a..4951b02 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -111,6 +111,8 @@ scopes: '"nonlocal"': 'storage.modifier.nonlocal' 'parameters > identifier': 'variable.parameter.function' + 'parameters > list_splat > identifier': 'variable.parameter.function' + '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' From a7b054915d438eaefb897817895f8a0d6c365ef5 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Fri, 24 May 2019 09:49:20 -0400 Subject: [PATCH 12/37] Prepare 0.53.2 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6d5e76c..c33183d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.1", + "version": "0.53.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9ce904c..5c46fe7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.1", + "version": "0.53.2", "engines": { "atom": "*", "node": "*" From 110b32ce00a0b2965283bc49e710f0ada4efa0f5 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 18 Jun 2019 16:57:49 -0700 Subject: [PATCH 13/37] :arrow_up: tree-sitter-python --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index c33183d..ac2549a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -123,9 +123,9 @@ "dev": true }, "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" }, "once": { "version": "1.4.0", @@ -165,9 +165,9 @@ "dev": true }, "tree-sitter-python": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.14.0.tgz", - "integrity": "sha512-Kcj5AUdeI4/c/JLsQV8OFI0zLrwcQ1nKoqCRr+W73Tp5SIK+Dd1ILNC5TFHPw1IqOGstcg8AH0XTeU0uq3boZg==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.15.0.tgz", + "integrity": "sha512-lOV84DUTsyab8xRfU0o8pBQOKAZPjIJsGL7q0buuORHQvvwnvy3iwF/83OGSyiNYRJzPz6gW+E1N/VgNNavMHA==", "requires": { "nan": "^2.4.0" } diff --git a/package.json b/package.json index 5c46fe7..35d00e7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "atom-grammar-test": "^0.6.4", - "tree-sitter-python": "^0.14.0" + "tree-sitter-python": "^0.15.0" }, "devDependencies": { "coffeelint": "^1.10.1" From 90e245936e6aa1961ccc611c86706c13600e744f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 18 Jun 2019 16:58:05 -0700 Subject: [PATCH 14/37] Prepare 0.53.3 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ac2549a..4a6760d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.2", + "version": "0.53.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 35d00e7..9c08d52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.2", + "version": "0.53.3", "engines": { "atom": "*", "node": "*" From b11c80cca7dab85f652b021dd175ecea49f648ef Mon Sep 17 00:00:00 2001 From: Darangi Date: Thu, 5 Dec 2019 16:42:24 +0100 Subject: [PATCH 15/37] :arrow_up:tree-sitter-python@0.15.1 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4a6760d..bcf60ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -165,9 +165,9 @@ "dev": true }, "tree-sitter-python": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.15.0.tgz", - "integrity": "sha512-lOV84DUTsyab8xRfU0o8pBQOKAZPjIJsGL7q0buuORHQvvwnvy3iwF/83OGSyiNYRJzPz6gW+E1N/VgNNavMHA==", + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.15.1.tgz", + "integrity": "sha512-v8HUvx6JnaRNiLM2ur+T5dVEoUKanXYv8vqHWGNzjiyt+vluHKySGR7fWeQVcaotDSulDJfil4Zbye2qIPVKSA==", "requires": { "nan": "^2.4.0" } diff --git a/package.json b/package.json index 9c08d52..567cab2 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "atom-grammar-test": "^0.6.4", - "tree-sitter-python": "^0.15.0" + "tree-sitter-python": "^0.15.1" }, "devDependencies": { "coffeelint": "^1.10.1" From d4a8e73a4ce35aa6aa877044c508899621adf040 Mon Sep 17 00:00:00 2001 From: Darangi Date: Thu, 5 Dec 2019 16:43:11 +0100 Subject: [PATCH 16/37] Prepare v0.53.4 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index bcf60ea..800fb4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.3", + "version": "0.53.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 567cab2..693e98d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.3", + "version": "0.53.4", "engines": { "atom": "*", "node": "*" From 3f8fa33ce8f54564576dc1db2017a7bd5327f433 Mon Sep 17 00:00:00 2001 From: illright Date: Sun, 29 Dec 2019 19:34:50 +0500 Subject: [PATCH 17/37] Add a lookahead for DELETE to avoid mistaking HTTP strings for SQL --- grammars/python.cson | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grammars/python.cson b/grammars/python.cson index dc84094..39318ef 100644 --- a/grammars/python.cson +++ b/grammars/python.cson @@ -1643,7 +1643,7 @@ 'name': 'string.quoted.double.block.python' 'patterns': [ { - 'begin': '(?=\\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|WITH))' + 'begin': '(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! \/)|CREATE|REPLACE|ALTER|WITH))' 'name': 'meta.embedded.sql' 'end': '(?=\\s*""")' 'patterns': [ @@ -1655,7 +1655,7 @@ ] } { - 'begin': '(")(?=\\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|WITH))' + 'begin': '(")(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! \/)|CREATE|REPLACE|ALTER|WITH))' 'beginCaptures': '1': 'name': 'punctuation.definition.string.begin.python' @@ -2214,7 +2214,7 @@ 'name': 'string.quoted.single.block.python' 'patterns': [ { - 'begin': '(?=\\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|WITH))' + 'begin': '(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! \/)|CREATE|REPLACE|ALTER|WITH))' 'end': '(?=\\s*\'\'\')' 'name': 'meta.embedded.sql' 'patterns': [ @@ -2226,7 +2226,7 @@ ] } { - 'begin': '(\')(?=\\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|WITH))' + 'begin': '(\')(?=\\s*(SELECT|INSERT|UPDATE|DELETE(?! \/)|CREATE|REPLACE|ALTER|WITH))' 'beginCaptures': '1': 'name': 'punctuation.definition.string.begin.python' From 681aba31aa2679e563b2a287769a367957d4479f Mon Sep 17 00:00:00 2001 From: ThatXliner <66848002+ThatXliner@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:47:41 -0700 Subject: [PATCH 18/37] Added async (line 851) Added keyword async: ``` 'illegal_names': 'match': '\\b(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield|await|async)\\b' 'name': 'invalid.illegal.name.python' ``` --- grammars/python.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammars/python.cson b/grammars/python.cson index dc84094..6102851 100644 --- a/grammars/python.cson +++ b/grammars/python.cson @@ -848,7 +848,7 @@ 'generic_names': 'match': '[A-Za-z_][A-Za-z0-9_]*' 'illegal_names': - 'match': '\\b(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield|await)\\b' + 'match': '\\b(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield|await|async)\\b' 'name': 'invalid.illegal.name.python' 'keyword_arguments': 'begin': '\\b([a-zA-Z_][a-zA-Z_0-9]*)\\s*(=)(?!=)' From df7643256348c80d9cbc7438f99d5d8af82a7b23 Mon Sep 17 00:00:00 2001 From: sadick254 Date: Wed, 19 Aug 2020 20:39:56 +0300 Subject: [PATCH 19/37] Prepare v0.53.5 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 800fb4a..6b7f3c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.4", + "version": "0.53.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 693e98d..930febc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.4", + "version": "0.53.5", "engines": { "atom": "*", "node": "*" From faf1e57ccbddbf7f7378bd085e5bff77090403cb Mon Sep 17 00:00:00 2001 From: aminya Date: Wed, 28 Oct 2020 18:17:41 -0500 Subject: [PATCH 20/37] :arrow_up: Update tree-sitter-python --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6b7f3c4..06766ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -123,9 +123,9 @@ "dev": true }, "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" }, "once": { "version": "1.4.0", @@ -165,9 +165,9 @@ "dev": true }, "tree-sitter-python": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.15.1.tgz", - "integrity": "sha512-v8HUvx6JnaRNiLM2ur+T5dVEoUKanXYv8vqHWGNzjiyt+vluHKySGR7fWeQVcaotDSulDJfil4Zbye2qIPVKSA==", + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.16.1.tgz", + "integrity": "sha512-XUxJgecoSZwNYUD+Pfb16pjPmK16T+bqhNdGkX/pgXvaEniaeVLpZP0VSiRpBq7Dx5vaXQcTn1/2MhUxoVBCdg==", "requires": { "nan": "^2.4.0" } diff --git a/package.json b/package.json index 930febc..e7f0cb8 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "atom-grammar-test": "^0.6.4", - "tree-sitter-python": "^0.15.1" + "tree-sitter-python": "^0.16.1" }, "devDependencies": { "coffeelint": "^1.10.1" From ad4b9807280c9f38cb537539c43890b143188012 Mon Sep 17 00:00:00 2001 From: aminya Date: Wed, 28 Oct 2020 21:25:48 -0500 Subject: [PATCH 21/37] Update Travis linux distro --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 47ee9a1..eb88ec4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ git: sudo: false -dist: trusty +dist: bionic addons: apt: From 97d1eb6d7c1e39eb47717ee511412f26f077f644 Mon Sep 17 00:00:00 2001 From: aminya Date: Thu, 12 Nov 2020 08:18:44 -0600 Subject: [PATCH 22/37] GitHub Actions --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 41 -------------------------------- README.md | 3 +-- appveyor.yml | 31 ++++-------------------- 4 files changed, 56 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..16f1825 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: ci +on: + - pull_request + - push + +jobs: + Test: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + atom_channel: + - stable + - nightly + steps: + - uses: actions/checkout@v2 + - name: Cache + uses: actions/cache@v2 + with: + path: | + 'node_modules' + 'C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140' + key: ${{ runner.os }}-${{ matrix.atom_channel }}-${{ hashFiles('package.json') }} + + - uses: UziTech/action-setup-atom@v1 + with: + channel: ${{ matrix.atom_channel }} + + - name: Install Visual Studio 2015 on Windows + if: ${{ contains(matrix.os, 'windows') }} + run: | + choco install visualcpp-build-tools --version=14.0.25420.1 --ignore-dependencies -y --params "'/IncludeRequired'" + echo ::set-env name=VCTargetsPath::'C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140' + + - name: Install dependencies + run: apm install + + - name: Run tests + run: apm test + + Skip: + if: contains(github.event.head_commit.message, '[skip ci]') + runs-on: ubuntu-latest + steps: + - name: Skip CI 🚫 + run: echo skip ci diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 47ee9a1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -### Project specific config ### -language: generic - -env: - global: - - APM_TEST_PACKAGES="" - - ATOM_LINT_WITH_BUNDLED_NODE="true" - - matrix: - - ATOM_CHANNEL=stable - - ATOM_CHANNEL=beta - -### Generic setup follows ### -script: - - curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh - - chmod u+x build-package.sh - - ./build-package.sh - -notifications: - email: - on_success: never - on_failure: change - -branches: - only: - - master - -git: - depth: 10 - -sudo: false - -dist: trusty - -addons: - apt: - packages: - - build-essential - - fakeroot - - git - - libsecret-1-dev diff --git a/README.md b/README.md index e646780..9ef6e6d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Python language support in Atom -[![macOS Build Status](https://travis-ci.org/atom/language-python.svg?branch=master)](https://travis-ci.org/atom/language-python) -[![Windows Build Status](https://ci.appveyor.com/api/projects/status/hmxrb9jttjh41es9/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/language-python/branch/master) +![ci](https://github.com/atom/language-python/workflows/ci/badge.svg) [![Dependency Status](https://david-dm.org/atom/language-python.svg)](https://david-dm.org/atom/language-python) Adds syntax highlighting and snippets to Python files in Atom. diff --git a/appveyor.yml b/appveyor.yml index 7d07d05..795da41 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,29 +1,6 @@ -version: "{build}" - -image: Visual Studio 2015 - -platform: x64 +# empty appveyor +build: off branches: - only: - - master - -clone_depth: 10 - -skip_tags: true - -environment: - APM_TEST_PACKAGES: - - matrix: - - ATOM_CHANNEL: stable - - ATOM_CHANNEL: beta - -install: - - ps: Install-Product node 4 - -build_script: - - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/atom/ci/master/build-package.ps1')) - -test: off -deploy: off + only: + - non-existing From 870467c070fb4eb072e2320b726fc69142882b64 Mon Sep 17 00:00:00 2001 From: Lev Chelyadinov Date: Fri, 4 Dec 2020 10:28:26 +0300 Subject: [PATCH 23/37] Add a test --- spec/python-spec.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/python-spec.coffee b/spec/python-spec.coffee index c1851d0..6ef1fba 100644 --- a/spec/python-spec.coffee +++ b/spec/python-spec.coffee @@ -750,3 +750,10 @@ describe "Python grammar", -> expect(tokens[13]).toEqual value: ')', scopes: ['source.python', 'string.quoted.double.single-line.sql.python', 'meta.embedded.sql', 'punctuation.definition.section.bracket.round.end.sql'] expect(tokens[15]).toEqual value: '"', scopes: ['source.python', 'string.quoted.double.single-line.sql.python', 'punctuation.definition.string.end.python'] expect(tokens[17]).toEqual value: '%', scopes: ['source.python', 'keyword.operator.arithmetic.python'] + + it "recognizes DELETE as an HTTP method", -> + {tokens} = grammar.tokenizeLine('"DELETE /api/v1/endpoint"') + + expect(tokens[0]).toEqual value: '"', scopes: ['source.python', 'string.quoted.single.single-line.python', 'punctuation.definition.string.begin.python'] + expect(tokens[1]).toEqual value: 'DELETE /api/v1/endpoint', scopes: ['source.python', 'string.quoted.single.single-line.python'] + expect(tokens[2]).toEqual value: '"', scopes: ['source.python', 'string.quoted.single.single-line.python', 'punctuation.definition.string.end.python'] From 64010bfc83b2d6b0824e39c87d3b0cf72a3c7650 Mon Sep 17 00:00:00 2001 From: Lev Chelyadinov Date: Fri, 4 Dec 2020 10:31:49 +0300 Subject: [PATCH 24/37] Fix the test that failed the build --- spec/python-spec.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/python-spec.coffee b/spec/python-spec.coffee index 6ef1fba..423f8c1 100644 --- a/spec/python-spec.coffee +++ b/spec/python-spec.coffee @@ -754,6 +754,6 @@ describe "Python grammar", -> it "recognizes DELETE as an HTTP method", -> {tokens} = grammar.tokenizeLine('"DELETE /api/v1/endpoint"') - expect(tokens[0]).toEqual value: '"', scopes: ['source.python', 'string.quoted.single.single-line.python', 'punctuation.definition.string.begin.python'] - expect(tokens[1]).toEqual value: 'DELETE /api/v1/endpoint', scopes: ['source.python', 'string.quoted.single.single-line.python'] - expect(tokens[2]).toEqual value: '"', scopes: ['source.python', 'string.quoted.single.single-line.python', 'punctuation.definition.string.end.python'] + expect(tokens[0]).toEqual value: '"', scopes: ['source.python', 'string.quoted.double.single-line.python', 'punctuation.definition.string.begin.python'] + expect(tokens[1]).toEqual value: 'DELETE /api/v1/endpoint', scopes: ['source.python', 'string.quoted.double.single-line.python'] + expect(tokens[2]).toEqual value: '"', scopes: ['source.python', 'string.quoted.double.single-line.python', 'punctuation.definition.string.end.python'] From ebe88306700ef0face8c9a99b5fc2a1d4e059866 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 10:51:27 -0600 Subject: [PATCH 25/37] :arrow_up: bump tree-sitter-python to 0.17.0 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 06766ea..d6acf3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -165,9 +165,9 @@ "dev": true }, "tree-sitter-python": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.16.1.tgz", - "integrity": "sha512-XUxJgecoSZwNYUD+Pfb16pjPmK16T+bqhNdGkX/pgXvaEniaeVLpZP0VSiRpBq7Dx5vaXQcTn1/2MhUxoVBCdg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/tree-sitter-python/-/tree-sitter-python-0.17.0.tgz", + "integrity": "sha512-6HaqF/1GHB0/qrkcIxYqEELsQq6bXdQxx2KnGLZhoGn5ipbAibncSuQT9f8HYbmqLZ4dIGleQzsXreY1mx2lig==", "requires": { "nan": "^2.4.0" } diff --git a/package.json b/package.json index e7f0cb8..986bde6 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "atom-grammar-test": "^0.6.4", - "tree-sitter-python": "^0.16.1" + "tree-sitter-python": "^0.17.0" }, "devDependencies": { "coffeelint": "^1.10.1" From d989f9aee9638ba48e2018fa81dc9a9b1b200dda Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 11:59:34 -0600 Subject: [PATCH 26/37] Add keyword.control.return Co-Authored-By: Eric Shimizu Karbstein <17973728+GrayJack@users.noreply.github.com> --- grammars/tree-sitter-python.cson | 1 + 1 file changed, 1 insertion(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index 4951b02..cb1b6d1 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -177,3 +177,4 @@ scopes: '"or"': 'keyword.operator.logical.python' '"not"': 'keyword.operator.logical.python' '"is"': 'keyword.operator.logical.python' + '"->"': 'keyword.control.return' From c2b79f1aebf91c507a0b469e4d201a92c76ad95a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:00:27 -0600 Subject: [PATCH 27/37] Add punctuations Co-Authored-By: Eric Shimizu Karbstein <17973728+GrayJack@users.noreply.github.com> --- grammars/tree-sitter-python.cson | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index cb1b6d1..07d5562 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -178,3 +178,11 @@ scopes: '"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' From 6325ed1445d53c5519e37b0597d0ae608bdb0a84 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:01:25 -0600 Subject: [PATCH 28/37] Use function.def for function_definition Co-Authored-By: Eric Shimizu Karbstein <17973728+GrayJack@users.noreply.github.com> --- grammars/tree-sitter-python.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index 07d5562..3abe778 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -73,7 +73,7 @@ scopes: 'interpolation > "}"': 'punctuation.section.embedded' 'class_definition > identifier': 'entity.name.type.class' - 'function_definition > identifier': 'entity.name.function' + 'function_definition > identifier': 'entity.name.function.def' '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'}, From 89351c1a3acd79e77b00474da135d7ea9f4c2e1f Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:02:40 -0600 Subject: [PATCH 29/37] Use function.call for call Co-Authored-By: Eric Shimizu Karbstein <17973728+GrayJack@users.noreply.github.com> --- grammars/tree-sitter-python.cson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index 3abe778..bfed062 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -76,8 +76,8 @@ scopes: 'function_definition > identifier': 'entity.name.function.def' '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'}, + 'entity.name.function.call' ] 'call > attribute > identifier:nth-child(2)': 'entity.name.function' From b0a77d570ce7d39484b4b8d02963d618b0537585 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:03:16 -0600 Subject: [PATCH 30/37] Support constructor Co-Authored-By: Eric Shimizu Karbstein <17973728+GrayJack@users.noreply.github.com> --- grammars/tree-sitter-python.cson | 1 + 1 file changed, 1 insertion(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index bfed062..bbbcd80 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -77,6 +77,7 @@ scopes: '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.call'}, + {match: '^[A-Z]', scopes: 'support.type.contructor'} 'entity.name.function.call' ] 'call > attribute > identifier:nth-child(2)': 'entity.name.function' From 37c8e1d9e8bda4d875e2892d777e4b29f8218236 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:15:56 -0600 Subject: [PATCH 31/37] Support lambda parameters Co-Authored-By: Eric Shimizu Karbstein <17973728+GrayJack@users.noreply.github.com> --- grammars/tree-sitter-python.cson | 1 + 1 file changed, 1 insertion(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index bbbcd80..7067f19 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -116,6 +116,7 @@ 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' '"if"': 'keyword.control' '"else"': 'keyword.control' From 98cab1961c654b66ac60c5d57b57346983ce00fe Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:09:04 -0600 Subject: [PATCH 32/37] Support typed parameters Co-Authored-By: Eric Shimizu Karbstein <17973728+GrayJack@users.noreply.github.com> --- grammars/tree-sitter-python.cson | 1 + 1 file changed, 1 insertion(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index 7067f19..166d657 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -117,6 +117,7 @@ scopes: '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' '"if"': 'keyword.control' '"else"': 'keyword.control' From 6e5de571a361d82c7c9c2fa86f6295227820273f Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:13:29 -0600 Subject: [PATCH 33/37] Support self matching Co-Authored-By: Eric Shimizu Karbstein <17973728+GrayJack@users.noreply.github.com> --- grammars/tree-sitter-python.cson | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index 166d657..fa18df4 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -82,10 +82,12 @@ scopes: ] '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' From 4d966074bfb6267e09416b9004f2e5770c5b9dfb Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:53:27 -0600 Subject: [PATCH 34/37] Support argument list https://github.com/tree-sitter/tree-sitter-python/issues/96 --- grammars/tree-sitter-python.cson | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index fa18df4..f97ca81 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -121,6 +121,8 @@ scopes: 'lambda_parameters > identifier': 'variable.parameter.function' 'typed_parameter > identifier': 'variable.parameter.function' + 'argument_list': 'meta.method-call.python' + '"if"': 'keyword.control' '"else"': 'keyword.control' '"elif"': 'keyword.control' From 5d548707cec8c150f4844d9a1cd744dd9641c6ef Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 8 Jan 2021 12:57:51 -0600 Subject: [PATCH 35/37] use entity.name.function.definition --- grammars/tree-sitter-python.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammars/tree-sitter-python.cson b/grammars/tree-sitter-python.cson index f97ca81..4490d74 100644 --- a/grammars/tree-sitter-python.cson +++ b/grammars/tree-sitter-python.cson @@ -73,7 +73,7 @@ scopes: 'interpolation > "}"': 'punctuation.section.embedded' 'class_definition > identifier': 'entity.name.type.class' - 'function_definition > identifier': 'entity.name.function.def' + '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.call'}, From fd7182548b88405380ce05c1a52e712c20fabc47 Mon Sep 17 00:00:00 2001 From: darangi Date: Tue, 2 Feb 2021 12:15:40 +0100 Subject: [PATCH 36/37] Prepare v0.53.6 release --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d6acf3c..d77eb13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.5", + "version": "0.53.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 986bde6..6a079e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-python", - "version": "0.53.5", + "version": "0.53.6", "engines": { "atom": "*", "node": "*" From 2d97e4b7a278df8d334c4bed701fdd4562c937bb Mon Sep 17 00:00:00 2001 From: Musa Ibrahim Date: Wed, 28 Sep 2022 11:52:01 +0100 Subject: [PATCH 37/37] add sunset message --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ef6e6d..4def7c0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Python language support in Atom +##### Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our [official announcement](https://github.blog/2022-06-08-sunsetting-atom/) + # Python language support in Atom ![ci](https://github.com/atom/language-python/workflows/ci/badge.svg) [![Dependency Status](https://david-dm.org/atom/language-python.svg)](https://david-dm.org/atom/language-python)