Skip to content

Commit ea2403d

Browse files
committed
Call do_sync in init
Signed-off-by: jdkato <joseph@jdkato.io>
1 parent 009f905 commit ea2403d

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/server.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl LanguageServer for Backend {
137137

138138
async fn execute_command(&self, params: ExecuteCommandParams) -> Result<Option<Value>> {
139139
match params.command.as_str() {
140-
"cli.sync" => self.do_sync(params.arguments).await,
140+
"cli.sync" => self.do_sync().await,
141141
"cli.compile" => self.do_compile(params.arguments).await,
142142
_ => {}
143143
};
@@ -425,19 +425,8 @@ impl Backend {
425425
}
426426
}
427427

428-
if self.should_sync() && cwd != "" {
429-
match self.cli.sync(self.config_path(), cwd) {
430-
Ok(_) => {
431-
self.client
432-
.log_message(MessageType::INFO, "Successfully synced Vale config.")
433-
.await;
434-
}
435-
Err(err) => {
436-
self.client
437-
.log_message(MessageType::ERROR, err.to_string())
438-
.await;
439-
}
440-
}
428+
if self.should_sync() {
429+
self.do_sync().await;
441430
}
442431
}
443432

@@ -513,7 +502,7 @@ impl Backend {
513502
"".to_string()
514503
}
515504

516-
async fn do_sync(&self, _: Vec<Value>) {
505+
async fn do_sync(&self) {
517506
match self.cli.sync(self.config_path(), self.root_path()) {
518507
Ok(_) => {
519508
self.client

0 commit comments

Comments
 (0)