pub struct SelectionRangesResult {
pub ranges: Vec<Range>,
pub truncated: bool,
pub positions_degraded: Option<PositionDegradation>,
}Expand description
Result of a selection range request: the ranges enclosing a position.
§Examples
use mcpls_core::bridge::{MAX_SELECTION_CHAIN, SelectionRangesResult};
let result: SelectionRangesResult = serde_json::from_value(serde_json::json!({
"ranges": [],
}))?;
assert!(result.ranges.is_empty() && !result.truncated);
assert_eq!(MAX_SELECTION_CHAIN, 32);Fields§
§ranges: Vec<Range>Ranges enclosing the position, innermost first, as the server reported them.
They are not merged, reordered or added to.
truncated: boolWhether the chain was longer than MAX_SELECTION_CHAIN and the
outermost ranges were dropped. Omitted when false.
positions_degraded: Option<PositionDegradation>Set only when the queried position or some character offsets are inexact (non-UTF-16).
Trait Implementations§
Source§impl Clone for SelectionRangesResult
impl Clone for SelectionRangesResult
Source§impl Debug for SelectionRangesResult
impl Debug for SelectionRangesResult
Source§impl<'de> Deserialize<'de> for SelectionRangesResult
impl<'de> Deserialize<'de> for SelectionRangesResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for SelectionRangesResult
impl JsonSchema for SelectionRangesResult
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for SelectionRangesResult
impl RefUnwindSafe for SelectionRangesResult
impl Send for SelectionRangesResult
impl Sync for SelectionRangesResult
impl Unpin for SelectionRangesResult
impl UnsafeUnpin for SelectionRangesResult
impl UnwindSafe for SelectionRangesResult
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