all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60656: 30.0.50; tree-sitter: editing a buffer invalidates visited node instances
@ 2023-01-08 11:08 Mickey Petersen
  2023-01-09  3:57 ` Yuan Fu
  2023-01-09 20:30 ` Yuan Fu
  0 siblings, 2 replies; 4+ messages in thread
From: Mickey Petersen @ 2023-01-08 11:08 UTC (permalink / raw)
  To: 60656


If you parse some text, retrieve a node -- using `treesit-node-at', for example -- and then edit the buffer, then the node you retrieved is marked outdated.

However, tree-sitter is capable of handling that, to a greater or lesser extent:

https://tree-sitter.github.io/tree-sitter/using-parsers#editing

It is therefore possible to refresh node instances that were created _before_ the edit. I suppose it could remain an explicit step that you must enter a special form and then Emacs will track node instances issued inside that form and refresh them when edits take place inside of it.

As it stands, it is very hard to edit and maintain a node registry at the same time. (I'm using markers and overlays as a crude hack to work around it.)




In GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version
 3.24.20, cairo version 1.16.0) of 2023-01-02 built on mickey-work
Repository revision: c209802f7b3721a1b95113290934a23fee88f678
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.3 LTS





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-09 20:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-08 11:08 bug#60656: 30.0.50; tree-sitter: editing a buffer invalidates visited node instances Mickey Petersen
2023-01-09  3:57 ` Yuan Fu
2023-01-09  8:56   ` Mickey Petersen
2023-01-09 20:30 ` Yuan Fu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.