pub struct LuaDocument<'a> { /* private fields */ }Implementations§
Source§impl<'a> LuaDocument<'a>
impl<'a> LuaDocument<'a>
pub fn new( file_id: FileId, path: &'a PathBuf, text: &'a str, line_index: &'a LineIndex, ) -> Self
pub fn get_file_id(&self) -> FileId
pub fn get_file_name(&self) -> Option<String>
pub fn get_uri(&self) -> Uri
pub fn get_file_path(&self) -> &PathBuf
pub fn get_text(&self) -> &str
pub fn get_text_slice(&self, range: TextRange) -> &str
pub fn get_line_count(&self) -> usize
pub fn get_line(&self, offset: TextSize) -> Option<usize>
pub fn get_line_col(&self, offset: TextSize) -> Option<(usize, usize)>
pub fn get_col(&self, offset: TextSize) -> Option<usize>
pub fn get_offset(&self, line: usize, col: usize) -> Option<TextSize>
pub fn to_lsp_range(&self, range: TextRange) -> Option<Range>
pub fn to_lsp_location(&self, range: TextRange) -> Option<Location>
pub fn to_lsp_position(&self, offset: TextSize) -> Option<Position>
pub fn to_rowan_range(&self, range: Range) -> Option<TextRange>
pub fn get_document_lsp_range(&self) -> Range
pub fn get_range_span(&self, range: Range) -> Option<(usize, usize)>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LuaDocument<'a>
impl<'a> RefUnwindSafe for LuaDocument<'a>
impl<'a> Send for LuaDocument<'a>
impl<'a> Sync for LuaDocument<'a>
impl<'a> Unpin for LuaDocument<'a>
impl<'a> UnwindSafe for LuaDocument<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more