From f7fe065f5f55c62f0457030e66ae3d33d4b8d685 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 09:20:30 -0400 Subject: [PATCH] Only apply host-side executable fix to binaries downloaded by the extension (cherry-pick #10318) (#10319) Cherry-picked Only apply host-side executable fix to binaries downloaded by the extension (#10318) This PR makes it so our temporary host-side workaround for setting certain language server binaries as executable only applies to binaries that are downloaded by the extension. Previously we would do this for any binary, including ones that could have been sourced from the $PATH. Release Notes: - Fixed a file permissions issue when trying to use a Zig language server (`zls`) present on the $PATH. Co-authored-by: Marshall Bowers --- crates/extension/src/extension_lsp_adapter.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/extension/src/extension_lsp_adapter.rs b/crates/extension/src/extension_lsp_adapter.rs index cb5d13135b348fa5e47269e78f2a1d026aa03e91..2c03a3df89fe6305565190e9e9434e7b7c716544 100644 --- a/crates/extension/src/extension_lsp_adapter.rs +++ b/crates/extension/src/extension_lsp_adapter.rs @@ -64,7 +64,9 @@ impl LspAdapter for ExtensionLspAdapter { // We can remove once the following extension versions no longer see any use: // - toml@0.0.2 // - zig@0.0.1 - if ["toml", "zig"].contains(&self.extension.manifest.id.as_ref()) { + if ["toml", "zig"].contains(&self.extension.manifest.id.as_ref()) + && path.starts_with(&self.host.work_dir) + { #[cfg(not(windows))] { use std::fs::{self, Permissions};