summaryrefslogtreecommitdiff
path: root/cli/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp')
-rw-r--r--cli/lsp/capabilities.rs3
-rw-r--r--cli/lsp/language_server.rs18
-rw-r--r--cli/lsp/lsp_custom.rs3
-rw-r--r--cli/lsp/mod.rs5
-rw-r--r--cli/lsp/tsc.rs1
5 files changed, 17 insertions, 13 deletions
diff --git a/cli/lsp/capabilities.rs b/cli/lsp/capabilities.rs
index f342b41b0..8b624eafc 100644
--- a/cli/lsp/capabilities.rs
+++ b/cli/lsp/capabilities.rs
@@ -153,5 +153,8 @@ pub fn server_capabilities(
})),
inlay_hint_provider: Some(OneOf::Left(true)),
position_encoding: None,
+ // TODO(nayeemrmn): Support pull-based diagnostics.
+ diagnostic_provider: None,
+ inline_value_provider: None,
}
}
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs
index c72239aa7..ad0da1c57 100644
--- a/cli/lsp/language_server.rs
+++ b/cli/lsp/language_server.rs
@@ -381,13 +381,6 @@ impl LanguageServer {
}
}
- pub async fn inlay_hint(
- &self,
- params: InlayHintParams,
- ) -> LspResult<Option<Vec<InlayHint>>> {
- self.0.read().await.inlay_hint(params).await
- }
-
pub async fn virtual_text_document(
&self,
params: Option<Value>,
@@ -3156,7 +3149,9 @@ impl tower_lsp::LanguageServer for LanguageServer {
// are interested in.
let options = DidChangeWatchedFilesRegistrationOptions {
watchers: vec![FileSystemWatcher {
- glob_pattern: "**/*.{json,jsonc,lock}".to_string(),
+ glob_pattern: GlobPattern::String(
+ "**/*.{json,jsonc,lock}".to_string(),
+ ),
kind: None,
}],
};
@@ -3417,6 +3412,13 @@ impl tower_lsp::LanguageServer for LanguageServer {
self.0.read().await.hover(params).await
}
+ async fn inlay_hint(
+ &self,
+ params: InlayHintParams,
+ ) -> LspResult<Option<Vec<InlayHint>>> {
+ self.0.read().await.inlay_hint(params).await
+ }
+
async fn code_action(
&self,
params: CodeActionParams,
diff --git a/cli/lsp/lsp_custom.rs b/cli/lsp/lsp_custom.rs
index 24c4bc131..d9dbae8a4 100644
--- a/cli/lsp/lsp_custom.rs
+++ b/cli/lsp/lsp_custom.rs
@@ -13,9 +13,6 @@ pub const VIRTUAL_TEXT_DOCUMENT: &str = "deno/virtualTextDocument";
pub const LATEST_DIAGNOSTIC_BATCH_INDEX: &str =
"deno/internalLatestDiagnosticBatchIndex";
-// While lsp_types supports inlay hints currently, tower_lsp does not.
-pub const INLAY_HINT: &str = "textDocument/inlayHint";
-
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CacheParams {
diff --git a/cli/lsp/mod.rs b/cli/lsp/mod.rs
index ed3971dc8..3ef19173b 100644
--- a/cli/lsp/mod.rs
+++ b/cli/lsp/mod.rs
@@ -42,6 +42,8 @@ pub async fn start() -> Result<(), AnyError> {
let builder = LspService::build(|client| {
language_server::LanguageServer::new(client::Client::from_tower(client))
})
+ // TODO(nayeemrmn): The extension has replaced this with the `deno.cache`
+ // command as of vscode_deno 3.21.0 / 2023.09.05. Remove this eventually.
.custom_method(lsp_custom::CACHE_REQUEST, LanguageServer::cache_request)
.custom_method(
lsp_custom::PERFORMANCE_REQUEST,
@@ -60,8 +62,7 @@ pub async fn start() -> Result<(), AnyError> {
.custom_method(
lsp_custom::VIRTUAL_TEXT_DOCUMENT,
LanguageServer::virtual_text_document,
- )
- .custom_method(lsp_custom::INLAY_HINT, LanguageServer::inlay_hint);
+ );
let builder = if should_send_diagnostic_batch_index_notifications() {
builder.custom_method(
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index f2b9f5634..9a33ff5f9 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -2993,6 +2993,7 @@ impl OutliningSpan {
Some(range.end.character)
},
kind: self.get_folding_range_kind(&self.kind),
+ collapsed_text: None,
}
}