Skip to content

Commit

Permalink
Merge pull request #1 from hgies/vscode
Browse files Browse the repository at this point in the history
Add support for VSCode
  • Loading branch information
anupdhml authored and GitHub Enterprise committed Nov 20, 2019
2 parents b24b4c1 + 6e02e13 commit db0caa0
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 db0caa0

Please sign in to comment.