forked from argotorg/fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcapabilities.rs
More file actions
101 lines (99 loc) · 5.31 KB
/
Copy pathcapabilities.rs
File metadata and controls
101 lines (99 loc) · 5.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
use async_lsp::lsp_types::{HoverProviderCapability, ServerCapabilities};
#[cfg(target_arch = "wasm32")]
use crate::util::DummyFilePathConversion;
pub(crate) fn server_capabilities() -> ServerCapabilities {
ServerCapabilities {
hover_provider: Some(HoverProviderCapability::Simple(true)),
// full sync mode for now
text_document_sync: Some(async_lsp::lsp_types::TextDocumentSyncCapability::Kind(
async_lsp::lsp_types::TextDocumentSyncKind::FULL,
)),
// goto definition
definition_provider: Some(async_lsp::lsp_types::OneOf::Left(true)),
// support for workspace add/remove changes
workspace: Some(async_lsp::lsp_types::WorkspaceServerCapabilities {
workspace_folders: Some(async_lsp::lsp_types::WorkspaceFoldersServerCapabilities {
supported: Some(true),
change_notifications: Some(async_lsp::lsp_types::OneOf::Left(true)),
}),
file_operations: Some(
async_lsp::lsp_types::WorkspaceFileOperationsServerCapabilities {
did_create: Some(async_lsp::lsp_types::FileOperationRegistrationOptions {
filters: vec![async_lsp::lsp_types::FileOperationFilter {
scheme: Some(String::from("file")),
pattern: async_lsp::lsp_types::FileOperationPattern {
glob: String::from("**/*"),
options: None,
// options: Some(async_lsp::lsp_types::FileOperationPatternOptions {
// ignore_case: Some(true),
// }),
matches: None,
},
}],
}),
did_rename: Some(async_lsp::lsp_types::FileOperationRegistrationOptions {
filters: vec![async_lsp::lsp_types::FileOperationFilter {
scheme: Some(String::from("file")),
pattern: async_lsp::lsp_types::FileOperationPattern {
glob: String::from("**/*"),
options: None,
// options: Some(async_lsp::lsp_types::FileOperationPatternOptions {
// ignore_case: Some(true),
// }),
matches: None,
},
}],
}),
did_delete: Some(async_lsp::lsp_types::FileOperationRegistrationOptions {
filters: vec![async_lsp::lsp_types::FileOperationFilter {
scheme: Some(String::from("file")),
pattern: async_lsp::lsp_types::FileOperationPattern {
glob: String::from("**/*"),
options: None,
// options: Some(async_lsp::lsp_types::FileOperationPatternOptions {
// ignore_case: Some(true),
// }),
matches: None,
},
}],
}),
will_create: None,
will_rename: None,
will_delete: None,
// TODO: implement file operation refactors and workspace cache updates
// will_create: Some(async_lsp::lsp_types::FileOperationRegistrationOptions {
// filters: vec![async_lsp::lsp_types::FileOperationFilter {
// scheme: Some(String::from("file")),
// pattern: async_lsp::lsp_types::FileOperationPattern {
// glob: String::from("**/*"),
// options: None,
// matches: None,
// },
// }],
// }),
// will_rename: Some(async_lsp::lsp_types::FileOperationRegistrationOptions {
// filters: vec![async_lsp::lsp_types::FileOperationFilter {
// scheme: Some(String::from("file")),
// pattern: async_lsp::lsp_types::FileOperationPattern {
// glob: String::from("**/*"),
// options: None,
// matches: None,
// },
// }],
// }),
// will_delete: Some(async_lsp::lsp_types::FileOperationRegistrationOptions {
// filters: vec![async_lsp::lsp_types::FileOperationFilter {
// scheme: Some(String::from("file")),
// pattern: async_lsp::lsp_types::FileOperationPattern {
// glob: String::from("**/*"),
// options: None,
// matches: None,
// },
// }],
// }),
},
),
}),
..Default::default()
}
}