bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain ch


From: Dmitry Gutov
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Date: Thu, 23 Mar 2023 03:03:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 21/03/2023 16:00, Wilhelm Kirschbaum wrote:

With the following text in a buffer with elixir-ts-mode:

def foo() do
end

When I delete the `)` and re-insert it, the tree-sitter syntax tree does
not fully recover and the `do end` part is absent when observing using
treesit-explore-mode.

Before removing the `)`:

(source
(call target: (identifier)
  (arguments
   (call target: (identifier)
    (arguments ( ))))
  (do_block do end)))

after re-inserting `)`:

(source
(call target: (identifier)
  (arguments
   (call target: (identifier)
    (arguments ( ))))))

I can see the same behaviour using ruby-ts-mode when I remove the
following expression:

(setq-local syntax-propertize-function #'ruby-ts--syntax-propertize)

The ruby syntax I tested with:

def foo()
end

When I add a local `syntax-propertize-function' function to elixir-ts-mode
it also solves the problem of not fully recovering the tree-sitter
syntax tree.  It does not seem to matter what the function achieves
thought, so am a bit confused.

I can repro both scenarios. Except with ruby-ts-mode, the difference in printed AST is the added wrapping in (program ...). But the visible result is similar: "end" not being highlighted.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]