Skip to content

Commit

Permalink
Add support for vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
Heinz Gies committed Nov 20, 2019
1 parent b24b4c1 commit 6e02e13
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,39 @@ impl LanguageServer for Backend {
fn initialize(&self, _: &Printer, _: InitializeParams) -> Result<InitializeResult> {
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),
),
}),
}),
},
})
}
Expand All @@ -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))
}

Expand Down

0 comments on commit 6e02e13

Please sign in to comment.