follow up to change in engine API in 7d82b1abee


Original commit: b395c7f6a4
This commit is contained in:
Michał Wawrzyniec Urbańczyk 2020-05-15 16:37:09 +02:00 committed by GitHub
parent 38ede38a66
commit d65e813541
2 changed files with 13 additions and 11 deletions

View File

@ -129,9 +129,9 @@ pub mod response {
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct OpenProject { pub struct OpenProject {
/// Address of the endpoint for JSON-RPC communication. /// Address of the endpoint for JSON-RPC communication.
pub language_server_rpc_address : IpWithSocket, pub language_server_json_address : IpWithSocket,
/// Address of the endpoint for binary FlatBuffers communication. /// Address of the endpoint for binary FlatBuffers communication.
pub language_server_data_address : IpWithSocket, pub language_server_binary_address : IpWithSocket,
} }
} }
@ -174,8 +174,8 @@ mod mock_client_tests {
let port = 30500; let port = 30500;
let language_server_address = IpWithSocket {host,port}; let language_server_address = IpWithSocket {host,port};
let expected_ip_with_socket = response::OpenProject { let expected_ip_with_socket = response::OpenProject {
language_server_rpc_address : language_server_address.clone(), language_server_json_address : language_server_address.clone(),
language_server_data_address : language_server_address, language_server_binary_address : language_server_address,
}; };
let open_result = Ok(expected_ip_with_socket.clone()); let open_result = Ok(expected_ip_with_socket.clone());
mock_client.set_create_project_result("HelloWorld".into(),Ok(creation_response)); mock_client.set_create_project_result("HelloWorld".into(),Ok(creation_response));
@ -311,16 +311,18 @@ mod remote_client_tests {
let create_project_response = response::CreateProject { project_id }; let create_project_response = response::CreateProject { project_id };
let project_id_json = json!({"projectId":"00000000-0000-0000-0000-000000000000"}); let project_id_json = json!({"projectId":"00000000-0000-0000-0000-000000000000"});
let language_server_rpc_address = IpWithSocket{host:"localhost".to_string(),port:27015}; let language_server_json_address = IpWithSocket{host:"localhost".to_string(),port:27015};
let language_server_data_address = IpWithSocket{host:"localhost".to_string(),port:27016}; let language_server_binary_address = IpWithSocket{host:"localhost".to_string(),port:27016};
let ip_with_address = response::OpenProject {language_server_rpc_address, let ip_with_address = response::OpenProject {
language_server_data_address}; language_server_json_address,
language_server_binary_address
};
let ip_with_address_json = json!({ let ip_with_address_json = json!({
"languageServerRpcAddress" : { "languageServerJsonAddress" : {
"host" : "localhost", "host" : "localhost",
"port" : 27015 "port" : 27015
}, },
"languageServerDataAddress" : { "languageServerBinaryAddress" : {
"host" : "localhost", "host" : "localhost",
"port" : 27016 "port" : 27016
} }

View File

@ -160,7 +160,7 @@ pub async fn open_most_recent_project_or_create_new
} else { } else {
project_manager.create_project(&DEFAULT_PROJECT_NAME.to_string()).await?.project_id project_manager.create_project(&DEFAULT_PROJECT_NAME.to_string()).await?.project_id
}; };
let address = project_manager.open_project(&project_id).await?.language_server_rpc_address; let address = project_manager.open_project(&project_id).await?.language_server_json_address;
open_project(address).await open_project(address).await
} }