summaryrefslogtreecommitdiff
path: root/queries/python
AgeCommit message (Collapse)Author
2022-10-25highlights(python): add "except*"Stephan Seitz
Added in https://github.com/tree-sitter/tree-sitter-python/pull/176 About the feature https://realpython.com/python311-exception-groups/#exception-groups-and-except-in-python-311
2022-10-15highlights: use @preproc where appropriateObserverOfTime
2022-09-26feat(spell): support more languagesLewis Russell
2022-09-06feat(spell): upstream spell queries from spellsitterLewis Russell
2022-08-03Split func/method definition from calls in python highlighting querylfenzo
2022-06-14fix: keep cls variable highlighting consistent in class methodsRyan Barth
2022-05-15python(folds): fold whole functions not only bodyStephan Seitz
2022-05-13Python: highlight future import (#2936)Santos Gallegos
* Python: highlight future import * Use constant.builtin
2022-05-01Python: highlight raise from statementSantos Gallegos
2022-04-07fixup! highlights(python): highlight exception keywordsFerdinand Ratajczak
2022-04-07highlights(python): highlight exception keywordsFerdinand Ratajczak
2022-04-01highlights(python): "from" in yield should be `@keyword.return`Stephan Seitz
Fixes #2712
2022-02-07locals(python): adapt as_pattern to upstream changeStephan Seitz
2022-02-06fix: Allow re-parsing in Python, XFAIL `\` indentation testStephan Seitz
2022-02-05indents: allow aligned_indent for unfinished calls in C and PythonStephan Seitz
2022-01-28highlights(python): add support for pattern matchingStephan Seitz
Fixes #2080 Depends on https://github.com/tree-sitter/tree-sitter-python/pull/140
2022-01-21feat(indent): support `@aligned_indent` for pythonMunif Tanjim
2022-01-21feat: rewrite indent moduleMunif Tanjim
2022-01-04Remove Python docstring injectionsRafik Draoui
These injections lead to inconsistent highlighting since some edge cases aren't handled (as mentioned in the PR description that introduced the injections [0]). Besides, not all Python projects use reStructuredText syntax in docstrings. If someone still wants to use them, they can extend the base injection queries through `after/queries/` [1] or enable them with `vim.treesitter.set_query`. See also: https://github.com/nvim-treesitter/nvim-treesitter/pull/1204 [0]: https://github.com/nvim-treesitter/nvim-treesitter/pull/917 [1]: https://github.com/nvim-treesitter/nvim-treesitter/tree/ad69e2528ac382b7cbf28f1ac7ee450981734ab0#adding-queries
2021-12-22Update queriesSantos Gallegos
- Don't use the old form for predicates - Update some invalid queries
2021-12-18highlights(python): Improve self and cls highlight (#2134)Fabian
1. This function simplifies an unnecessary lua-match usage. 2. Fixes an accidental change, where "cls" was changed to "class" (fe4f320b66) 3. Match functions, which have have a decorator. 4. But exclude @staticmethod 5. Only highlight "cls" as @variable.builtin when the decorator is @classmethod This might be a bit to complicated and some of this not to useful, as this existing rule: ```scm ((identifier) @variable.builtin (#eq? @variable.builtin "self")) ``` overwrites the queries anyway.
2021-11-23Prefer lua-match over matchLewis Russell
as string.find is much quicker than vim.regex:match*
2021-11-12Python: highlight semicolonSantos Gallegos
2021-11-02chore: fix typosDundar Göc
2021-11-01Update queries/python/highlights.scmSantos Gallegos
2021-11-01Revert "feat: add `del` keyword for highlights"Santos Gallegos
This reverts commit 385193d41fe6b74fe0e3698588ae54545d1cd88b.
2021-11-01feat: add `del` keyword for highlightsAshish Panigrahi
2021-10-22Python: highlight interpolation escaped charsSantos Gallegos
Support for these was just added in the grammar.
2021-07-11Python: fix class highlights (#1548)Santos Gallegos
2021-07-06Highlights(python): Add `@keyword.function`Sergio Alejandro Vargas
Use `@keyword.function` for `def` and `lambda`
2021-07-04feat(keywords) merge return and yield into keyword.return groupantonk52
2021-07-04feat(keywords) add keyword.return & keyword.yieldantonk52
2021-07-01python(highlights): don't use type for APPStephan Seitz
2021-05-16highlights(python): use any-of?Stephan Seitz
2021-05-07Revert "Comment: use `@combined` to create just one tree per buffer (#1252)"Santos Gallegos
This reverts commit 4a7a713c527f57c355bc817f16fc6d955b8cce9b.
2021-04-28Comment: use `@combined` to create just one tree per buffer (#1252)Santos Gallegos
* Comment: use `@combined` to create just one tree per buffer There is no need to create a tree per line/block for comments. Should fix https://github.com/nvim-treesitter/nvim-treesitter/issues/1251 * Add injections for scss * Fix jsonc * Combine jsdoc
2021-03-12Add comment parser to highlight comment tags (#893)Santos Gallegos
Closes #236
2021-02-05Python: inject rst in docstrings (#917)Santos Gallegos
Since hasn't been much discussion around https://github.com/nvim-treesitter/nvim-treesitter/issues/806. I'm just porting the injection queries. I've been using this for a while now. Things I've noticed: - Due that rst uses indentation for its syntax, everything is treated as an block quote (but it looks good). This can be solved by having a predicate like `#dedent!`. - Looks like there is a bug in how the injected content is extracted ``` def foo(): """Foo bar""" ``` That would be parsed as a section title for some reason, but it's a paragraph. In rst it would be a title if the content was: ``` """ Foo bar """ ``` If the content is ``` """Foo bar""" ``` That's just a paragraph. I'll try to debug that from the neovim side next week or so.
2021-01-14indent: add Python @ignore queriesJędrzej Boczar
2021-01-14indent: add Python @return queriesJędrzej Boczar
2021-01-07Python highlights: update definition of decoratorStephan Seitz
2021-01-07Python locals: Add new node with_clauseStephan Seitz
2021-01-06Remove usages of `@embedded` in highlightsStephan Seitz
2021-01-03Python highlights: Add regex injections: re.match(r"...")Stephan Seitz
2021-01-02Python (folds): allow to fold stringsSantos Gallegos
Mostly useful for folding docstrings
2020-12-21Improve python/indents.scmJędrzej Boczar
2020-12-18Python: fix self highlighingSantos Gallegos
2020-12-18Update indents.scmEvan
2020-12-18Create indents.scm for pythonEvan
2020-11-30Update Python queriesStephan Seitz