aboutsummaryrefslogtreecommitdiffstats
path: root/queries/python/injections.scm
Commit message (Collapse)AuthorAgeFilesLines
* refactor(format): drop extra indentation for fieldPhạm Huy Hoàng2024-03-211-11/+8
|
* chore: query formattingPham Huy Hoang2024-01-191-7/+13
|
* feat(injections): add printf format stringsObserverOfTime2024-01-191-0/+5
|
* feat(python): `@string.regex` capture, injection improvements (#5697)Riley Bruins2023-11-211-3/+2
| | | | | | | | | | | | | | | * feat(python): `@string.regex` capture, injection improvements * fix(python): match regex only for first argument of re module * chore(python): remove unneeded capture Co-authored-by: Santos Gallegos <stsewd@proton.me> * fix(python): only highlight string content itself as regex --------- Co-authored-by: Santos Gallegos <stsewd@proton.me>
* fix(python): right content for regex injectionTheLeoP2023-08-161-6/+7
|
* chore(injections)!: update injection syntax to 0.9Pham Huy Hoang2023-08-121-3/+5
| | | | | | | | | Since 0.9, @lang syntax is still available as fallback but will soon be deprecated. Because of that, new syntax should be adopted once 0.9 becomes the baseline requirements for nvim-treesitter - update health check - update doc
* Remove Python docstring injectionsRafik Draoui2022-01-041-18/+0
| | | | | | | | | | | | | | | | 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
* Prefer lua-match over matchLewis Russell2021-11-231-1/+1
| | | | as string.find is much quicker than vim.regex:match*
* Revert "Comment: use `@combined` to create just one tree per buffer (#1252)"Santos Gallegos2021-05-071-1/+1
| | | | This reverts commit 4a7a713c527f57c355bc817f16fc6d955b8cce9b.
* Comment: use `@combined` to create just one tree per buffer (#1252)Santos Gallegos2021-04-281-1/+1
| | | | | | | | | | | | * 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
* Add comment parser to highlight comment tags (#893)Santos Gallegos2021-03-121-0/+2
| | | Closes #236
* Python: inject rst in docstrings (#917)Santos Gallegos2021-02-051-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Python highlights: Add regex injections: re.match(r"...")Stephan Seitz2021-01-031-0/+6