abstract class TreeSitter::Editor

Overview

Edit the syntax tree to keep it in sync with source code that has been edited.

You must provide a callback to transform Point coordinates into byte offsets and byte offsets into Point.

Direct Known Subclasses

Defined in:

tree_sitter/editor.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(point_to_offset_callback : Int32, Int32 -> UInt32, offset_to_point_callback : UInt32 -> TreeSitter::Point) #

[View source]

Instance Method Detail

def delete(line : Int32, column : Int32, n_bytes : Int32) #

Edit the syntax tree at line and column, removing n_bytes.


[View source]
def insert(line : Int32, column : Int32, n_bytes : Int32) #

Edit the syntax tree at line and column, adding n_bytes.


[View source]