summaryrefslogtreecommitdiff
path: root/cli/lsp/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2021-06-17 19:57:58 -0400
committerGitHub <noreply@github.com>2021-06-17 19:57:58 -0400
commitaecf989d432793b108df01c5d5f31adfca19de61 (patch)
tree7b51deb92f3e47f4aa11cb126c7b4c559b70b501 /cli/lsp/mod.rs
parent8031644e65647bdc3a6a0561ad31da9228e9723d (diff)
chore(lsp): add `--parent-pid <pid>` flag (#11023)
This commit adds a new `--parent-pid <pid>` flag to `deno lsp` that when provided starts a task that checks for the existence of the provided process id (ex. vscode's) every 30 seconds. If the process doesn't exist (meaning the deno process has nothing interacting with it), then it terminates itself.
Diffstat (limited to 'cli/lsp/mod.rs')
-rw-r--r--cli/lsp/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/lsp/mod.rs b/cli/lsp/mod.rs
index 367257911..4723f8b56 100644
--- a/cli/lsp/mod.rs
+++ b/cli/lsp/mod.rs
@@ -13,6 +13,7 @@ mod diagnostics;
mod documents;
pub(crate) mod language_server;
mod lsp_custom;
+mod parent_process_checker;
mod path_to_regex;
mod performance;
mod registries;
@@ -22,10 +23,14 @@ mod text;
mod tsc;
mod urls;
-pub async fn start() -> Result<(), AnyError> {
+pub async fn start(parent_pid: Option<u32>) -> Result<(), AnyError> {
let stdin = tokio::io::stdin();
let stdout = tokio::io::stdout();
+ if let Some(parent_pid) = parent_pid {
+ parent_process_checker::start(parent_pid);
+ }
+
let (service, messages) =
LspService::new(language_server::LanguageServer::new);
Server::new(stdin, stdout)