| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
update CONTRIBUTING.md
adjust indents for bass
fix doc capture comment
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
indents now use @indent.X style captures, and indent.PROP for properties to set on those captures, as documented in the help.
Captures are:
indent.auto
indent.begin
indent.end
indent.dedent
indent.branch
indent.ignore
indent.align
indent.zero
Properties are:
indent.immediate
indent.start_at_same_line
indent.open_delimiter
indent.close_delimiter
indent.increment
indent.avoid_last_matching_next
Multiple opening delims on one line and multiple closing on a line are collapsed so as not to over indent,
The final line of @indent.align blocks which must in some cases be treated specially to avoid clashing with the next line is treated the same regardless of whether the @indent.align capture actually uses aligned indentation or just normal indentation. The indent.avoid_last_matching_next property controls this.
Adjust python to use these.
List, set, dict and tuple all use @indent.align which permits both hanging and aligned styles.
Finally, try: on it’s own will indent when typing live but make no guaranteeds about whole-file formatting.
Includes lucario387:fix-align-indent
|
| | |
|
| |
|
|
|
|
| |
`return ...` is usually the last line of a
function/statement, so mark some possible patterns of `return` with
`@indent_end` to dedent the line after it
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
| |
Added new keywords "is not" and "not in"
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
* Python: highlight future import
* Use constant.builtin
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Fixes #2712
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Fixes #2080
Depends on https://github.com/tree-sitter/tree-sitter-python/pull/140
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
- Don't use the old form for predicates
- Update some invalid queries
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
as string.find is much quicker than vim.regex:match*
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This reverts commit 385193d41fe6b74fe0e3698588ae54545d1cd88b.
|
| | |
|
| |
|
|
| |
Support for these was just added in the grammar.
|
| | |
|
| |
|
|
| |
Use `@keyword.function` for `def` and `lambda`
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This reverts commit 4a7a713c527f57c355bc817f16fc6d955b8cce9b.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
Closes #236
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|