pub enum PositionEncoding {
Utf8,
Utf16,
Char,
}Expand description
How a position offset is encoded by the caller.
The LSP negotiates UTF-8 byte offsets or UTF-16 code units; the WASM
editor passes character (Unicode scalar value) offsets. All three map
to a byte offset via offset_to_byte.
Variants§
Utf8
UTF-8 byte offsets.
Utf16
UTF-16 code units (the LSP 3.17 default).
Char
Unicode scalar value (character) offsets — the WASM editor’s convention (see issue #1289).
Trait Implementations§
Source§impl Clone for PositionEncoding
impl Clone for PositionEncoding
Source§fn clone(&self) -> PositionEncoding
fn clone(&self) -> PositionEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PositionEncoding
Source§impl Debug for PositionEncoding
impl Debug for PositionEncoding
impl Eq for PositionEncoding
Source§impl PartialEq for PositionEncoding
impl PartialEq for PositionEncoding
Source§fn eq(&self, other: &PositionEncoding) -> bool
fn eq(&self, other: &PositionEncoding) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PositionEncoding
Auto Trait Implementations§
impl Freeze for PositionEncoding
impl RefUnwindSafe for PositionEncoding
impl Send for PositionEncoding
impl Sync for PositionEncoding
impl Unpin for PositionEncoding
impl UnsafeUnpin for PositionEncoding
impl UnwindSafe for PositionEncoding
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