From 6e02e1378d721ca5fdffbee69dcd861907a87c4c Mon Sep 17 00:00:00 2001 From: Heinz Gies Date: Wed, 20 Nov 2019 13:57:06 +0100 Subject: [PATCH] Add support for vscode --- src/backend.rs | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/backend.rs b/src/backend.rs index 42a8376..9e1464d 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -57,8 +57,39 @@ impl LanguageServer for Backend { fn initialize(&self, _: &Printer, _: InitializeParams) -> Result { Ok(InitializeResult { capabilities: ServerCapabilities { + code_action_provider: None, + code_lens_provider: None, /*Some(CodeLensOptions { + resolve_provider: None, + }),*/ + color_provider: None, + completion_provider: None, + definition_provider: None, + document_formatting_provider: None, + document_highlight_provider: None, + document_link_provider: None, + document_on_type_formatting_provider: None, + document_range_formatting_provider: None, + document_symbol_provider: None, + execute_command_provider: None, + folding_range_provider: None, hover_provider: Some(true), - ..ServerCapabilities::default() + implementation_provider: None, + references_provider: None, + rename_provider: None, + signature_help_provider: None, + text_document_sync: Some(TextDocumentSyncCapability::Kind( + TextDocumentSyncKind::Full, + )), + type_definition_provider: None, + workspace_symbol_provider: None, + workspace: Some(WorkspaceCapability { + workspace_folders: Some(WorkspaceFolderCapability { + supported: Some(true), + change_notifications: Some( + WorkspaceFolderCapabilityChangeNotifications::Bool(true), + ), + }), + }), }, }) } @@ -71,18 +102,23 @@ impl LanguageServer for Backend { } fn shutdown(&self) -> Self::ShutdownFuture { + file_dbg("shutdown", "shutdown"); Box::new(future::ok(())) } fn symbol(&self, _: WorkspaceSymbolParams) -> Self::SymbolFuture { + file_dbg("symbol", "symbol"); Box::new(future::ok(None)) } - fn execute_command(&self, _: &Printer, _: ExecuteCommandParams) -> Self::ExecuteFuture { + fn execute_command(&self, printer: &Printer, _: ExecuteCommandParams) -> Self::ExecuteFuture { + file_dbg("execute", "execute"); + printer.log_message(MessageType::Info, "executing command!"); Box::new(future::ok(None)) } fn completion(&self, _: CompletionParams) -> Self::CompletionFuture { + file_dbg("completion", "completion"); Box::new(future::ok(None)) }