2019-01-14 04:55:56 -06:00
|
|
|
use lsp_types::{
|
2019-07-04 15:05:17 -05:00
|
|
|
CodeActionProviderCapability, CodeLensOptions, CompletionOptions,
|
2019-07-11 00:49:29 -05:00
|
|
|
DocumentOnTypeFormattingOptions, FoldingRangeProviderCapability, GenericCapability,
|
|
|
|
ImplementationProviderCapability, RenameOptions, RenameProviderCapability, ServerCapabilities,
|
|
|
|
SignatureHelpOptions, TextDocumentSyncCapability, TextDocumentSyncKind,
|
2019-07-04 15:05:17 -05:00
|
|
|
TextDocumentSyncOptions, TypeDefinitionProviderCapability,
|
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 {
|
2019-02-08 05:49:43 -06: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 15:37:27 -06:00
|
|
|
hover_provider: Some(true),
|
2018-08-26 04:51:45 -05:00
|
|
|
completion_provider: Some(CompletionOptions {
|
|
|
|
resolve_provider: None,
|
2018-12-25 08:20:37 -06:00
|
|
|
trigger_characters: Some(vec![":".to_string(), ".".to_string()]),
|
2018-08-26 04:51:45 -05:00
|
|
|
}),
|
2018-10-09 09:08:17 -05:00
|
|
|
signature_help_provider: Some(SignatureHelpOptions {
|
2018-11-05 16:13:56 -06:00
|
|
|
trigger_characters: Some(vec!["(".to_string(), ",".to_string(), ")".to_string()]),
|
2018-10-09 09:08:17 -05:00
|
|
|
}),
|
2018-08-13 08:35:17 -05:00
|
|
|
definition_provider: Some(true),
|
2019-04-23 13:11:27 -05:00
|
|
|
type_definition_provider: Some(TypeDefinitionProviderCapability::Simple(true)),
|
2019-01-28 08:26:32 -06:00
|
|
|
implementation_provider: Some(ImplementationProviderCapability::Simple(true)),
|
2018-10-18 12:40:12 -05:00
|
|
|
references_provider: Some(true),
|
2018-12-31 05:08:44 -06:00
|
|
|
document_highlight_provider: Some(true),
|
2018-08-12 18:38:34 -05:00
|
|
|
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)),
|
2019-02-08 05:49:43 -06:00
|
|
|
code_lens_provider: Some(CodeLensOptions { resolve_provider: Some(true) }),
|
2018-12-29 13:09:42 -06:00
|
|
|
document_formatting_provider: Some(true),
|
2018-08-12 18:38:34 -05:00
|
|
|
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(),
|
2019-01-06 02:56:00 -06:00
|
|
|
more_trigger_character: Some(vec![".".to_string()]),
|
2018-08-28 03:12:42 -05:00
|
|
|
}),
|
2019-04-21 04:13:48 -05:00
|
|
|
selection_range_provider: Some(GenericCapability::default()),
|
2018-09-23 10:10:57 -05:00
|
|
|
folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)),
|
2018-10-31 15:41:43 -05:00
|
|
|
rename_provider: Some(RenameProviderCapability::Options(RenameOptions {
|
|
|
|
prepare_provider: Some(true),
|
2018-10-18 16:56:22 -05:00
|
|
|
})),
|
2018-08-12 18:38:34 -05:00
|
|
|
color_provider: None,
|
2019-07-11 00:49:29 -05:00
|
|
|
execute_command_provider: None,
|
2018-09-23 10:10:57 -05:00
|
|
|
workspace: None,
|
2018-08-12 18:38:34 -05:00
|
|
|
}
|
|
|
|
}
|