Remove unused cyclic dependency from copilot crate
Move notification handling earlier so that there are less copilot messages in the log
This commit is contained in:
parent
6ee0d104d6
commit
39512655aa
4 changed files with 9 additions and 10 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1358,7 +1358,6 @@ dependencies = [
|
||||||
"smol",
|
"smol",
|
||||||
"theme",
|
"theme",
|
||||||
"util",
|
"util",
|
||||||
"workspace",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -47,4 +47,3 @@ lsp = { path = "../lsp", features = ["test-support"] }
|
||||||
rpc = { path = "../rpc", features = ["test-support"] }
|
rpc = { path = "../rpc", features = ["test-support"] }
|
||||||
settings = { path = "../settings", features = ["test-support"] }
|
settings = { path = "../settings", features = ["test-support"] }
|
||||||
util = { path = "../util", features = ["test-support"] }
|
util = { path = "../util", features = ["test-support"] }
|
||||||
workspace = { path = "../workspace", features = ["test-support"] }
|
|
||||||
|
|
|
@ -378,13 +378,6 @@ impl Copilot {
|
||||||
cx.clone(),
|
cx.clone(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let server = server.initialize(Default::default()).await?;
|
|
||||||
let status = server
|
|
||||||
.request::<request::CheckStatus>(request::CheckStatusParams {
|
|
||||||
local_checks_only: false,
|
|
||||||
})
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
server
|
server
|
||||||
.on_notification::<LogMessage, _>(|params, _cx| {
|
.on_notification::<LogMessage, _>(|params, _cx| {
|
||||||
match params.level {
|
match params.level {
|
||||||
|
@ -405,6 +398,14 @@ impl Copilot {
|
||||||
)
|
)
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
|
let server = server.initialize(Default::default()).await?;
|
||||||
|
|
||||||
|
let status = server
|
||||||
|
.request::<request::CheckStatus>(request::CheckStatusParams {
|
||||||
|
local_checks_only: false,
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
|
||||||
server
|
server
|
||||||
.request::<request::SetEditorInfo>(request::SetEditorInfoParams {
|
.request::<request::SetEditorInfo>(request::SetEditorInfoParams {
|
||||||
editor_info: request::EditorInfo {
|
editor_info: request::EditorInfo {
|
||||||
|
|
|
@ -143,8 +143,8 @@ pub enum LogMessage {}
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct LogMessageParams {
|
pub struct LogMessageParams {
|
||||||
pub message: String,
|
|
||||||
pub level: u8,
|
pub level: u8,
|
||||||
|
pub message: String,
|
||||||
pub metadata_str: String,
|
pub metadata_str: String,
|
||||||
pub extra: Vec<String>,
|
pub extra: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue