rust-analyzer/crates/ra_lsp_server/src/caps.rs

51 lines
2.3 KiB
Rust
Raw Normal View History

2019-01-14 10:55:56 +00:00
use lsp_types::{
2019-01-11 20:16:55 +00:00
CodeActionProviderCapability, CodeLensOptions, CompletionOptions, DocumentOnTypeFormattingOptions,
2018-10-31 20:41:43 +00:00
ExecuteCommandOptions, FoldingRangeProviderCapability, RenameOptions, RenameProviderCapability,
ServerCapabilities, SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind,
TextDocumentSyncOptions, ImplementationProviderCapability,
2018-08-10 18:13:39 +00:00
};
2018-08-10 12:07:43 +00:00
2018-08-12 23:38:34 +00:00
pub fn server_capabilities() -> ServerCapabilities {
ServerCapabilities {
2019-02-08 11:49:43 +00:00
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,
})),
2018-11-05 21:37:27 +00:00
hover_provider: Some(true),
2018-08-26 09:51:45 +00:00
completion_provider: Some(CompletionOptions {
resolve_provider: None,
2018-12-25 14:20:37 +00:00
trigger_characters: Some(vec![":".to_string(), ".".to_string()]),
2018-08-26 09:51:45 +00:00
}),
signature_help_provider: Some(SignatureHelpOptions {
trigger_characters: Some(vec!["(".to_string(), ",".to_string(), ")".to_string()]),
}),
2018-08-13 13:35:17 +00:00
definition_provider: Some(true),
2018-08-12 23:38:34 +00:00
type_definition_provider: None,
implementation_provider: Some(ImplementationProviderCapability::Simple(true)),
references_provider: Some(true),
2018-12-31 11:08:44 +00:00
document_highlight_provider: Some(true),
2018-08-12 23:38:34 +00:00
document_symbol_provider: Some(true),
2018-08-13 12:35:53 +00:00
workspace_symbol_provider: Some(true),
2018-09-23 15:10:57 +00:00
code_action_provider: Some(CodeActionProviderCapability::Simple(true)),
2019-02-08 11:49:43 +00:00
code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }),
document_formatting_provider: Some(true),
2018-08-12 23:38:34 +00:00
document_range_formatting_provider: None,
2018-08-28 08:12:42 +00:00
document_on_type_formatting_provider: Some(DocumentOnTypeFormattingOptions {
first_trigger_character: "=".to_string(),
more_trigger_character: Some(vec![".".to_string()]),
2018-08-28 08:12:42 +00:00
}),
2018-09-23 15:10:57 +00:00
folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)),
2018-10-31 20:41:43 +00:00
rename_provider: Some(RenameProviderCapability::Options(RenameOptions {
prepare_provider: Some(true),
2018-10-18 21:56:22 +00:00
})),
2018-08-12 23:38:34 +00:00
color_provider: None,
execute_command_provider: Some(ExecuteCommandOptions {
commands: vec!["apply_code_action".to_string()],
}),
2018-09-23 15:10:57 +00:00
workspace: None,
2018-08-12 23:38:34 +00:00
}
}