Skip to content

Commit

Permalink
stop lsp client only if still running
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger committed Oct 4, 2024
1 parent 237a1a2 commit e8ea497
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ export const createSession = async (
};

export const destroySession = async (session: Session) => {
// Stop the LSP session
await session.client.stop();
// Stop the LSP client if it is still running
if (session.client.needsStop()) {
await session.client.stop();
}
};

/**
Expand Down

0 comments on commit e8ea497

Please sign in to comment.