<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nvim-treesitter/tests/indent/python, branch main</title>
<subtitle>[no description]</subtitle>
<id>http://git.sudomsg.com/mirror/nvim-treesitter/atom?h=main</id>
<link rel='self' href='http://git.sudomsg.com/mirror/nvim-treesitter/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/'/>
<updated>2024-07-16T11:13:41Z</updated>
<entry>
<title>feat(python): Improved python indentation (#6859)</title>
<updated>2024-07-16T11:13:41Z</updated>
<author>
<name>Grace Petryk</name>
<email>gracepetryk99@gmail.com</email>
</author>
<published>2024-07-16T11:13:41Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=f16a77583047d6d3ea684092c679bbe88398cb01'/>
<id>urn:sha1:f16a77583047d6d3ea684092c679bbe88398cb01</id>
<content type='text'>
* feat: improve python indentation

* use lua-match

* revert concatenated_string changes, handle function def hanging indents

* lint

* add delimiters to param query

* add test cases</content>
</entry>
<entry>
<title>fix(python): better try-except indentation (#6097)</title>
<updated>2024-02-14T17:39:59Z</updated>
<author>
<name>Riley Bruins</name>
<email>ribru17@hotmail.com</email>
</author>
<published>2024-02-14T17:39:59Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=d96bf9d522369eaf4ad57e607f134e51084ee1ad'/>
<id>urn:sha1:d96bf9d522369eaf4ad57e607f134e51084ee1ad</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add Python else elif dedent (#4618)</title>
<updated>2023-04-29T08:35:35Z</updated>
<author>
<name>Pham Huy Hoang</name>
<email>hoangtun0810@gmail.com</email>
</author>
<published>2023-04-29T08:35:35Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=1ca9b938c1c3d8b2c64a168f6a5419b8f3870410'/>
<id>urn:sha1:1ca9b938c1c3d8b2c64a168f6a5419b8f3870410</id>
<content type='text'>
* feat(python): add interactive else/elif dedent

* fixup

* add test</content>
</entry>
<entry>
<title>feat(python): add break/continue dedent</title>
<updated>2023-03-25T04:31:57Z</updated>
<author>
<name>Pham Huy Hoang</name>
<email>hoangtun0810@gmail.com</email>
</author>
<published>2023-03-25T00:51:41Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=c9ef5e58f7d59aba875324825ff47900d0be61f2'/>
<id>urn:sha1:c9ef5e58f7d59aba875324825ff47900d0be61f2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat(python): add match-case indents</title>
<updated>2023-03-25T04:31:57Z</updated>
<author>
<name>Pham Huy Hoang</name>
<email>hoangtun0810@gmail.com</email>
</author>
<published>2023-03-25T00:29:32Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=1ffa01985651f6a5ba88d01e56f09cb76ff6e79a'/>
<id>urn:sha1:1ffa01985651f6a5ba88d01e56f09cb76ff6e79a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>refactor(indent)!: Rework indent, aligned indent</title>
<updated>2023-03-24T17:07:53Z</updated>
<author>
<name>George Harker</name>
<email>george@george-graphics.co.uk</email>
</author>
<published>2023-03-20T01:09:18Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=d1333dd7e51729a581fed3e429fa035bff77a3db'/>
<id>urn:sha1:d1333dd7e51729a581fed3e429fa035bff77a3db</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>feat(python): add "return" patterns to @indent_end</title>
<updated>2023-03-16T12:41:19Z</updated>
<author>
<name>Pham Huy Hoang</name>
<email>hoangtun0810@gmail.com</email>
</author>
<published>2023-03-16T10:04:17Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=01e8a5145160620140c3c57d285ccb2cfe067540'/>
<id>urn:sha1:01e8a5145160620140c3c57d285ccb2cfe067540</id>
<content type='text'>
`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
</content>
</entry>
<entry>
<title>fix(python): add missing @indent_end</title>
<updated>2023-03-16T07:46:01Z</updated>
<author>
<name>Pham Huy Hoang</name>
<email>hoangtun0810@gmail.com</email>
</author>
<published>2023-03-15T23:39:58Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=f5ddd8f92e0222f96b88c6012453eee33e02728a'/>
<id>urn:sha1:f5ddd8f92e0222f96b88c6012453eee33e02728a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: change folding algorithm to fix Python indents</title>
<updated>2023-03-15T21:44:59Z</updated>
<author>
<name>George Harker</name>
<email>george@george-graphics.co.uk</email>
</author>
<published>2023-03-14T19:25:38Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=fa0644667ea7ee7a72efdb69c471de4953a11019'/>
<id>urn:sha1:fa0644667ea7ee7a72efdb69c471de4953a11019</id>
<content type='text'>
</content>
</entry>
<entry>
<title>indents(python): remove branches.py from expected failures</title>
<updated>2022-02-05T17:54:55Z</updated>
<author>
<name>Stephan Seitz</name>
<email>stephan.seitz@fau.de</email>
</author>
<published>2022-01-23T14:50:21Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=d615497e7ef6765eb4ba37bd122c0cd7c77447f8'/>
<id>urn:sha1:d615497e7ef6765eb4ba37bd122c0cd7c77447f8</id>
<content type='text'>
The previous indentation actually causes a linter warning when using
pep8
</content>
</entry>
<entry>
<title>indents: allow aligned_indent for unfinished calls in C and Python</title>
<updated>2022-02-05T17:54:55Z</updated>
<author>
<name>Stephan Seitz</name>
<email>stephan.seitz@fau.de</email>
</author>
<published>2022-01-22T13:50:51Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=059fbc487c62a5e109143254b720a5dc33201a34'/>
<id>urn:sha1:059fbc487c62a5e109143254b720a5dc33201a34</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat(indent): support `@aligned_indent` for python</title>
<updated>2022-01-21T09:51:51Z</updated>
<author>
<name>Munif Tanjim</name>
<email>hello@muniftanjim.dev</email>
</author>
<published>2022-01-18T21:06:06Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=bb60706433e593f976fb6cfee3b3a6910ce5bd2c'/>
<id>urn:sha1:bb60706433e593f976fb6cfee3b3a6910ce5bd2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>move all tests to top-level tests/ directory</title>
<updated>2021-04-23T19:21:38Z</updated>
<author>
<name>Jędrzej Boczar</name>
<email>yendreij@gmail.com</email>
</author>
<published>2021-04-22T18:53:30Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/nvim-treesitter/commit/?id=63a88c873f3643aad9208488765dc53618edd40e'/>
<id>urn:sha1:63a88c873f3643aad9208488765dc53618edd40e</id>
<content type='text'>
</content>
</entry>
</feed>
