Skip to content

Commit

Permalink
Reorder typeHierarchy/* requests after textDocument/*
Browse files Browse the repository at this point in the history
  • Loading branch information
ebkalderon committed Jan 22, 2023
1 parent a7d0791 commit d602cd1
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ macro_rules! lsp_request {
("callHierarchy/outgoingCalls") => {
$crate::request::CallHierarchyOutgoingCalls
};
("typeHierarchy/supertypes") => {
$crate::request::TypeHierarchySupertypes
};
("typeHierarchy/subtypes") => {
$crate::request::TypeHierarchySubtypes
};
("textDocument/moniker") => {
$crate::request::MonikerRequest
};
Expand Down Expand Up @@ -165,6 +159,12 @@ macro_rules! lsp_request {
("textDocument/inlineValue") => {
$crate::request::InlineValueRequest
};
("typeHierarchy/supertypes") => {
$crate::request::TypeHierarchySupertypes
};
("typeHierarchy/subtypes") => {
$crate::request::TypeHierarchySubtypes
};
("workspace/willCreateFiles") => {
$crate::request::WillCreateFiles
};
Expand Down Expand Up @@ -712,45 +712,6 @@ impl Request for CallHierarchyOutgoingCalls {
const METHOD: &'static str = "callHierarchy/outgoingCalls";
}

/// The type hierarchy request is sent from the client to the server to return a type hierarchy for
/// the language element of given text document positions. Will return null if the server couldn’t
/// infer a valid type from the position. The type hierarchy requests are executed in two steps:
///
/// 1. first a type hierarchy item is prepared for the given text document position.
/// 2. for a type hierarchy item the supertype or subtype type hierarchy items are resolved.
pub enum TypeHierarchyPrepare {}

impl Request for TypeHierarchyPrepare {
type Params = TypeHierarchyPrepareParams;
type Result = Option<Vec<TypeHierarchyItem>>;
const METHOD: &'static str = "textDocument/prepareTypeHierarchy";
}

/// The `typeHierarchy/supertypes` request is sent from the client to the server to resolve the
/// supertypes for a given type hierarchy item. Will return null if the server couldn’t infer a
/// valid type from item in the params. The request doesn’t define its own client and server
/// capabilities. It is only issued if a server registers for the
/// `textDocument/prepareTypeHierarchy` request.
pub enum TypeHierarchySupertypes {}

impl Request for TypeHierarchySupertypes {
type Params = TypeHierarchySupertypesParams;
type Result = Option<Vec<TypeHierarchyItem>>;
const METHOD: &'static str = "typeHierarchy/supertypes";
}

/// The `typeHierarchy/subtypes` request is sent from the client to the server to resolve the
/// subtypes for a given type hierarchy item. Will return null if the server couldn’t infer a valid
/// type from item in the params. The request doesn’t define its own client and server capabilities.
/// It is only issued if a server registers for the textDocument/prepareTypeHierarchy request.
pub enum TypeHierarchySubtypes {}

impl Request for TypeHierarchySubtypes {
type Params = TypeHierarchySubtypesParams;
type Result = Option<Vec<TypeHierarchyItem>>;
const METHOD: &'static str = "typeHierarchy/subtypes";
}

pub enum SemanticTokensFullRequest {}

impl Request for SemanticTokensFullRequest {
Expand Down Expand Up @@ -905,6 +866,45 @@ impl Request for InlineValueRefreshRequest {
const METHOD: &'static str = "workspace/inlineValue/refresh";
}

/// The type hierarchy request is sent from the client to the server to return a type hierarchy for
/// the language element of given text document positions. Will return null if the server couldn’t
/// infer a valid type from the position. The type hierarchy requests are executed in two steps:
///
/// 1. first a type hierarchy item is prepared for the given text document position.
/// 2. for a type hierarchy item the supertype or subtype type hierarchy items are resolved.
pub enum TypeHierarchyPrepare {}

impl Request for TypeHierarchyPrepare {
type Params = TypeHierarchyPrepareParams;
type Result = Option<Vec<TypeHierarchyItem>>;
const METHOD: &'static str = "textDocument/prepareTypeHierarchy";
}

/// The `typeHierarchy/supertypes` request is sent from the client to the server to resolve the
/// supertypes for a given type hierarchy item. Will return null if the server couldn’t infer a
/// valid type from item in the params. The request doesn’t define its own client and server
/// capabilities. It is only issued if a server registers for the
/// `textDocument/prepareTypeHierarchy` request.
pub enum TypeHierarchySupertypes {}

impl Request for TypeHierarchySupertypes {
type Params = TypeHierarchySupertypesParams;
type Result = Option<Vec<TypeHierarchyItem>>;
const METHOD: &'static str = "typeHierarchy/supertypes";
}

/// The `typeHierarchy/subtypes` request is sent from the client to the server to resolve the
/// subtypes for a given type hierarchy item. Will return null if the server couldn’t infer a valid
/// type from item in the params. The request doesn’t define its own client and server capabilities.
/// It is only issued if a server registers for the textDocument/prepareTypeHierarchy request.
pub enum TypeHierarchySubtypes {}

impl Request for TypeHierarchySubtypes {
type Params = TypeHierarchySubtypesParams;
type Result = Option<Vec<TypeHierarchyItem>>;
const METHOD: &'static str = "typeHierarchy/subtypes";
}

#[cfg(test)]
mod test {
use super::*;
Expand Down

0 comments on commit d602cd1

Please sign in to comment.