fix(lsp): close server on exit notification (#28232)

This commit is contained in:
Nayeem Rahman 2025-02-21 20:02:56 +00:00 committed by GitHub
parent a9f404e479
commit 876bac445a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 19 additions and 35 deletions

View file

@ -137,7 +137,6 @@ pub struct LanguageServer {
/// https://github.com/Microsoft/language-server-protocol/issues/567#issuecomment-2085131917
init_flag: AsyncFlag,
performance: Arc<Performance>,
shutdown_flag: AsyncFlag,
}
/// Snapshot of the state used by TSC.
@ -227,7 +226,7 @@ pub struct Inner {
}
impl LanguageServer {
pub fn new(client: Client, shutdown_flag: AsyncFlag) -> Self {
pub fn new(client: Client) -> Self {
let performance = Arc::new(Performance::default());
Self {
client: client.clone(),
@ -237,7 +236,6 @@ impl LanguageServer {
))),
init_flag: Default::default(),
performance,
shutdown_flag,
}
}
@ -3566,7 +3564,6 @@ impl tower_lsp::LanguageServer for LanguageServer {
}
async fn shutdown(&self) -> LspResult<()> {
self.shutdown_flag.raise();
Ok(())
}