1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

feat(lsp): add a message when someone runs 'deno lsp' manually (#26051)

This commit is contained in:
Bartek Iwańczuk 2024-10-07 17:45:50 +01:00 committed by GitHub
parent fc293c68b5
commit 719b8dcfde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,6 +57,7 @@ use standalone::MODULE_NOT_FOUND;
use standalone::UNSUPPORTED_SCHEME; use standalone::UNSUPPORTED_SCHEME;
use std::env; use std::env;
use std::future::Future; use std::future::Future;
use std::io::IsTerminal;
use std::ops::Deref; use std::ops::Deref;
use std::path::PathBuf; use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
@ -161,7 +162,19 @@ async fn run_subcommand(flags: Arc<Flags>) -> Result<i32, AnyError> {
DenoSubcommand::Uninstall(uninstall_flags) => spawn_subcommand(async { DenoSubcommand::Uninstall(uninstall_flags) => spawn_subcommand(async {
tools::installer::uninstall(flags, uninstall_flags).await tools::installer::uninstall(flags, uninstall_flags).await
}), }),
DenoSubcommand::Lsp => spawn_subcommand(async { lsp::start().await }), DenoSubcommand::Lsp => spawn_subcommand(async {
if std::io::stderr().is_terminal() {
log::warn!(
"{} command is intended to be run by text editors and IDEs and shouldn't be run manually.
Visit https://docs.deno.com/runtime/getting_started/setup_your_environment/ for instruction
how to setup your favorite text editor.
Press Ctrl+C to exit.
", colors::cyan("deno lsp"));
}
lsp::start().await
}),
DenoSubcommand::Lint(lint_flags) => spawn_subcommand(async { DenoSubcommand::Lint(lint_flags) => spawn_subcommand(async {
if lint_flags.rules { if lint_flags.rules {
tools::lint::print_rules_list( tools::lint::print_rules_list(