diff options
| author | Santos Gallegos <stsewd@protonmail.com> | 2022-05-13 16:46:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-13 21:46:06 +0000 |
| commit | f1373051e554cc4642cda719c8023e4e8508eb2d (patch) | |
| tree | 63ac107d0c18a24d43acdcba9e9e7c03d7c0f520 | |
| parent | 4d53ee5c052db67928f4433b2c2a641b1eb4d3b5 (diff) | |
Python: highlight future import (#2936)
* Python: highlight future import
* Use constant.builtin
| -rw-r--r-- | queries/python/highlights.scm | 1 | ||||
| -rw-r--r-- | tests/query/highlights/python/future_import.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm index 681b9e4d..18ed5162 100644 --- a/queries/python/highlights.scm +++ b/queries/python/highlights.scm @@ -224,6 +224,7 @@ ] @keyword.return (yield "from" @keyword.return) +(future_import_statement "from" @include "__future__" @constant.builtin) (import_from_statement "from" @include) "import" @include diff --git a/tests/query/highlights/python/future_import.py b/tests/query/highlights/python/future_import.py new file mode 100644 index 00000000..7495588a --- /dev/null +++ b/tests/query/highlights/python/future_import.py @@ -0,0 +1,4 @@ +from __future__ import print_function +# ^ @include +# ^ @constant.builtin +# ^ @include |
