[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tree-sitter indentation for js-mode & cc-mode
From: |
Theodor Thornhill |
Subject: |
Re: Tree-sitter indentation for js-mode & cc-mode |
Date: |
Fri, 28 Oct 2022 21:49:14 +0200 |
>>
>
> Ok, I’m fairly certain this is due to tree-sitter reparsing after we
> indenting each line: treesit-buffer-root-node asks for the root node
> of the parser, which triggers a reparse, because last indent modified
> the buffer. We are basically reparsing as many time as there are lines
> in the buffer.
>
> Indenting a similarly sized buffer where all indent are good is much
> faster, because there is no reparse due to change to the buffer.
Yeah, that's what I was seeing as well. I think this is correct.
>
> Tree-sitter indent should add an implementation for indent-for-region
> function which precomputes indent for each line and indent lines in
> batch. That ought to fix it. Added to TODO :-)
Hehe, sorry!
Theo
- Tree-sitter indentation for js-mode & cc-mode, Yuan Fu, 2022/10/26
- Re: Tree-sitter indentation for js-mode & cc-mode, Theodor Thornhill, 2022/10/27
- Re: Tree-sitter indentation for js-mode & cc-mode, Theodor Thornhill, 2022/10/27
- Re: Tree-sitter indentation for js-mode & cc-mode, Yuan Fu, 2022/10/27
- Re: Tree-sitter indentation for js-mode & cc-mode, Theodor Thornhill, 2022/10/27
- Re: Tree-sitter indentation for js-mode & cc-mode, Yuan Fu, 2022/10/28
- Re: Tree-sitter indentation for js-mode & cc-mode, Theodor Thornhill, 2022/10/28
- Re: Tree-sitter indentation for js-mode & cc-mode, Theodor Thornhill, 2022/10/28
- Re: Tree-sitter indentation for js-mode & cc-mode, Yuan Fu, 2022/10/28
- Re: Tree-sitter indentation for js-mode & cc-mode,
Theodor Thornhill <=
- Re: Tree-sitter indentation for js-mode & cc-mode, Yuan Fu, 2022/10/28
- Re: Tree-sitter indentation for js-mode & cc-mode, Eli Zaretskii, 2022/10/29
- Re: Tree-sitter indentation for js-mode & cc-mode, Yuan Fu, 2022/10/29