2022-01-07 22:09:52 -05:00
|
|
|
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
2021-06-01 07:53:08 -04:00
|
|
|
|
|
|
|
use deno_core::serde::Deserialize;
|
|
|
|
use deno_core::serde::Serialize;
|
2022-04-03 00:17:30 -04:00
|
|
|
use tower_lsp::lsp_types as lsp;
|
2021-06-01 07:53:08 -04:00
|
|
|
|
|
|
|
pub const CACHE_REQUEST: &str = "deno/cache";
|
|
|
|
pub const PERFORMANCE_REQUEST: &str = "deno/performance";
|
2022-03-28 20:27:43 -04:00
|
|
|
pub const TASK_REQUEST: &str = "deno/task";
|
2021-06-01 07:53:08 -04:00
|
|
|
pub const RELOAD_IMPORT_REGISTRIES_REQUEST: &str =
|
|
|
|
"deno/reloadImportRegistries";
|
|
|
|
pub const VIRTUAL_TEXT_DOCUMENT: &str = "deno/virtualTextDocument";
|
|
|
|
|
2022-10-15 22:39:43 -04:00
|
|
|
// While lsp_types supports inlay hints currently, tower_lsp does not.
|
|
|
|
pub const INLAY_HINT: &str = "textDocument/inlayHint";
|
|
|
|
|
2021-06-01 07:53:08 -04:00
|
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct CacheParams {
|
|
|
|
/// The document currently open in the editor. If there are no `uris`
|
|
|
|
/// supplied, the referrer will be cached.
|
|
|
|
pub referrer: lsp::TextDocumentIdentifier,
|
|
|
|
/// Any documents that have been specifically asked to be cached via the
|
|
|
|
/// command.
|
|
|
|
pub uris: Vec<lsp::TextDocumentIdentifier>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
|
|
pub struct RegistryStateNotificationParams {
|
|
|
|
pub origin: String,
|
|
|
|
pub suggestions: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub enum RegistryStateNotification {}
|
|
|
|
|
|
|
|
impl lsp::notification::Notification for RegistryStateNotification {
|
|
|
|
type Params = RegistryStateNotificationParams;
|
|
|
|
|
|
|
|
const METHOD: &'static str = "deno/registryState";
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize, Serialize)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct VirtualTextDocumentParams {
|
|
|
|
pub text_document: lsp::TextDocumentIdentifier,
|
|
|
|
}
|