[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-tree-sitter and Emacs
From: |
Stephen Leake |
Subject: |
Re: emacs-tree-sitter and Emacs |
Date: |
Thu, 02 Apr 2020 18:16:48 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt) |
Yuan Fu <address@hidden> writes:
>> you have two windows displaying a large buffer, one display near the end,
>> and the other near the beginning, and you make changes at the beginning
>> of the buffer. I haven't seen any performance bug-reports or complaints
>> about it, so it appears that those circumstances are very rare.
>
> Or you open a buffer and jumps to point-max, which I assume isn’t that
> rare. OTOH if the whole buffer has been parsed, this two-window setup
> shouldn’t be slow when making changes because incremental parsing is
> fast, and we don’t need to re-parse the whole buffer.
That assumes that changes in syntax before (or after) a point don't
affect fontification at that point.
That depends on the language being fontified.
As has been mentioned several times, inserting a block comment start
violates that assumption (if the language has those; Ada doesn't), as
does inserting an open string quote (if the string is not closed by line
end; it is in Ada, but that's not supported in Emacs).
There are smaller cases; in ada-mode, a name like Package_1.Function_1 has
different faces for the parts before and after the dot. So the
fontification of "Package" depends on the presence of ".", which comes
after.
I assume tree-sitter gets this right; it should parse from the inserted
block comment start to the end of the file, even though the text change
message did not include all of that.
--
-- Stephe
- Re: emacs-tree-sitter and Emacs, (continued)
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Michael Welsh Duggan, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Michael Welsh Duggan, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Michael Welsh Duggan, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Yuan Fu, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Stefan Monnier, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Yuan Fu, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Stefan Monnier, 2020/04/02
- Re: emacs-tree-sitter and Emacs,
Stephen Leake <=
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Michael Welsh Duggan, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/02
- Re: emacs-tree-sitter and Emacs, 조성빈, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/03
- Re: emacs-tree-sitter and Emacs, Stephen Leake, 2020/04/03
- Re: emacs-tree-sitter and Emacs, Stefan Monnier, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Stephen Leake, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/03