Struct arret_lsp_server::model::document::Document [−][src]
Fields
version: i32text: Stringline_offsets: Vec<usize>Implementations
impl Document[src]
impl Document[src]pub fn new(version: i32, text: String) -> Document[src]
pub fn with_range_edit(
&self,
new_version: i32,
range: Range,
new_range_text: &str
) -> Result<Document, ()>[src]
&self,
new_version: i32,
range: Range,
new_range_text: &str
) -> Result<Document, ()>
Returns a new instance of the document with specified range replaced
pub fn version(&self) -> i32[src]
Returns the document version
pub fn text(&self) -> &str[src]
Returns the document text
pub fn span_to_range(&self, span: Span) -> Range[src]
Returns an LSP Range for the given arret-syntax Span
pub fn offset_to_position(&self, offset: usize) -> Position[src]
Returns the position for the given byte offset
fn position_to_offset(&self, position: Position) -> Option<usize>[src]
Returns the byte offset for the given position