Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

684 B
Raw Blame
//! Project HTTP routes for Search Everywhere and the HTTP client.
use crate::{Error, Invocation, Location};

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Endpoint {
    /// `None` accepts any HTTP method.
    pub method: Option<String>,
    pub path: String,
    pub framework: String,
    pub handler: Option<String>,
    /// Declaration range, with zero-based lines and UTF-16 columns.
    pub location: Location,
}

/// Register with `register_plugin!(MyPlugin, endpoints)` and declare
/// `[[contributes.endpoints]] files = ["config/routes.rb"]` in the manifest.
pub trait EndpointsProvider {
    fn endpoints(&mut self, ctx: &Invocation) -> Result<Vec<Endpoint>, Error>;
}