History

Enable `yaml-language-server` lookup in PATH (#22036)

Release Notes: - Added support for checking for `yaml-language-server` on the`$PATH`.

Henry Chu committed 1 year ago

Commit b2eceeb1 parent d3eae021 file · +16 −0Browse files

Unified · Split

crates/languages/src/yaml.rs+16−0
@@ -54,6 +54,22 @@ impl LspAdapter for YamlLspAdapter { · 53 unmodified lines
5454 ) as Box<_>)
5555 }
5656
57+ async fn check_if_user_installed(
58+ &self,
59+ delegate: &dyn LspAdapterDelegate,
60+ _: Arc<dyn LanguageToolchainStore>,
61+ _: &AsyncAppContext,
62+ ) -> Option<LanguageServerBinary> {
63+ let path = delegate.which(Self::SERVER_NAME.as_ref()).await?;
64+ let env = delegate.shell_env().await;
65+
66+ Some(LanguageServerBinary {
67+ path,
68+ env: Some(env),
69+ arguments: vec!["--stdio".into()],
70+ })
71+ }
72+
5773 async fn fetch_server_binary(
5874 &self,
5975 latest_version: Box<dyn 'static + Send + Any>,