Tree-sitter parseTextBufferSync

parseTextBufferSync(editor.getBuffer(), tree)

throws an error Uncaught (in promise) TypeError: buffer.getSnapshot is not a function, which is odd, because editor.getBuffer() returns a TextBuffer object. :-/

The Atom TextBuffer object is a wrapper around the Superstring TextBuffer, which is stored as a property on the former.

1 Like

Got it: parseTextBufferSync(editor.getBuffer().buffer, tree) works… at least if tree is undefined. The second time around the call crashes Atom!