rust/crates/ra_lsp_server/src/caps.rs

57 lines
2.0 KiB
Rust
Raw Normal View History

2018-08-10 13:13:39 -05:00
use languageserver_types::{
ServerCapabilities,
2018-09-23 10:10:57 -05:00
CodeActionProviderCapability,
FoldingRangeProviderCapability,
2018-08-10 13:13:39 -05:00
TextDocumentSyncCapability,
TextDocumentSyncOptions,
TextDocumentSyncKind,
2018-08-12 18:38:34 -05:00
ExecuteCommandOptions,
2018-08-26 04:51:45 -05:00
CompletionOptions,
SignatureHelpOptions,
2018-08-28 03:12:42 -05:00
DocumentOnTypeFormattingOptions,
2018-08-10 13:13:39 -05:00
};
2018-08-10 07:07:43 -05:00
2018-08-12 18:38:34 -05:00
pub fn server_capabilities() -> ServerCapabilities {
ServerCapabilities {
text_document_sync: Some(TextDocumentSyncCapability::Options(
TextDocumentSyncOptions {
open_close: Some(true),
change: Some(TextDocumentSyncKind::Full),
will_save: None,
will_save_wait_until: None,
save: None,
}
)),
hover_provider: None,
2018-08-26 04:51:45 -05:00
completion_provider: Some(CompletionOptions {
resolve_provider: None,
trigger_characters: None,
}),
signature_help_provider: Some(SignatureHelpOptions {
trigger_characters: Some(vec!["(".to_string(), ",".to_string()])
}),
2018-08-13 08:35:17 -05:00
definition_provider: Some(true),
2018-08-12 18:38:34 -05:00
type_definition_provider: None,
implementation_provider: None,
references_provider: None,
document_highlight_provider: None,
document_symbol_provider: Some(true),
2018-08-13 07:35:53 -05:00
workspace_symbol_provider: Some(true),
2018-09-23 10:10:57 -05:00
code_action_provider: Some(CodeActionProviderCapability::Simple(true)),
2018-08-12 18:38:34 -05:00
code_lens_provider: None,
document_formatting_provider: None,
document_range_formatting_provider: None,
2018-08-28 03:12:42 -05:00
document_on_type_formatting_provider: Some(DocumentOnTypeFormattingOptions {
first_trigger_character: "=".to_string(),
more_trigger_character: None,
}),
2018-09-23 10:10:57 -05:00
folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)),
2018-08-12 18:38:34 -05:00
rename_provider: None,
color_provider: None,
execute_command_provider: Some(ExecuteCommandOptions {
commands: vec!["apply_code_action".to_string()],
}),
2018-09-23 10:10:57 -05:00
workspace: None,
2018-08-12 18:38:34 -05:00
}
}