[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-tree-sitter and Emacs
From: |
Eli Zaretskii |
Subject: |
Re: emacs-tree-sitter and Emacs |
Date: |
Thu, 02 Apr 2020 22:03:19 +0300 |
> From: Michael Welsh Duggan <address@hidden>
> Cc: <address@hidden>, <address@hidden>, <address@hidden>
> Date: Thu, 02 Apr 2020 14:50:18 -0400
>
> If this is correct, I also think we could avoid (1) as an optimization.
> In this case we only send the text from (save-restriction (widen)
> (point-min)) to (window-end) to the parser as soon as the buffer is
> visible. Then treat scrolling down as a change that adds text to the
> buffer (from the parser's point of view). This may not produce correct
> semantic information in all cases, but it is probably a reasonable first
> approximation in the event that we want to avoid (1).
Yes, with one correction: ideally, it should be unnecessary to start
from point-min (which could be a long way away). Most languages
should do well enough with starting from the beginning of the
outermost function or class that affects the displayed text. IOW,
start from window-start, then go back until you find the top-level
syntactic construct; then parse from there.
- 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, 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, 2020/04/02
- 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 <=
- 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
- Re: emacs-tree-sitter and Emacs, Stephen Leake, 2020/04/03
- Re: emacs-tree-sitter and Emacs, Eli Zaretskii, 2020/04/03
- Re: emacs-tree-sitter and Emacs, martin rudalics, 2020/04/02
- Re: emacs-tree-sitter and Emacs, Stephen Leake, 2020/04/02