Make fake language servers have full capabilities
This commit is contained in:
parent
9999862016
commit
78d96a05fc
2 changed files with 10 additions and 2 deletions
|
@ -574,7 +574,7 @@ impl LanguageServerConfig {
|
||||||
Self {
|
Self {
|
||||||
fake_config: Some(FakeLanguageServerConfig {
|
fake_config: Some(FakeLanguageServerConfig {
|
||||||
servers_tx,
|
servers_tx,
|
||||||
capabilities: Default::default(),
|
capabilities: lsp::LanguageServer::full_capabilities(),
|
||||||
initializer: None,
|
initializer: None,
|
||||||
}),
|
}),
|
||||||
disk_based_diagnostics_progress_token: Some("fakeServer/check".to_string()),
|
disk_based_diagnostics_progress_token: Some("fakeServer/check".to_string()),
|
||||||
|
|
|
@ -512,8 +512,16 @@ type FakeLanguageServerHandlers = Arc<
|
||||||
|
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
impl LanguageServer {
|
impl LanguageServer {
|
||||||
|
pub fn full_capabilities() -> ServerCapabilities {
|
||||||
|
ServerCapabilities {
|
||||||
|
document_highlight_provider: Some(OneOf::Left(true)),
|
||||||
|
code_action_provider: Some(CodeActionProviderCapability::Simple(true)),
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn fake(cx: &mut gpui::MutableAppContext) -> (Arc<Self>, FakeLanguageServer) {
|
pub fn fake(cx: &mut gpui::MutableAppContext) -> (Arc<Self>, FakeLanguageServer) {
|
||||||
Self::fake_with_capabilities(Default::default(), cx)
|
Self::fake_with_capabilities(Self::full_capabilities(), cx)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fake_with_capabilities(
|
pub fn fake_with_capabilities(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue