diff --git a/build.helpers.psm1 b/build.helpers.psm1 index 419fde804..15cb368df 100644 --- a/build.helpers.psm1 +++ b/build.helpers.psm1 @@ -471,6 +471,19 @@ function Install-TreeSitter { [switch]$UseCFS ) + begin { + $arguments = @( + 'install', + 'tree-sitter-cli', + '--version', '0.25.10' + ) + + if ($UseCFS) { + $arguments += '--config' + $arguments += '.cargo/config.toml' + } + } + process { if (Test-CommandAvailable -Name 'tree-sitter') { Write-Verbose "tree-sitter already installed." @@ -478,11 +491,9 @@ function Install-TreeSitter { } Write-Verbose -Verbose "tree-sitter not found, installing..." - if ($UseCFS) { - cargo install tree-sitter-cli --config .cargo/config.toml - } else { - cargo install tree-sitter-cli - } + + cargo @arguments + if ($LASTEXITCODE -ne 0) { throw "Failed to install tree-sitter-cli" } diff --git a/lib/dsc-lib/src/dscerror.rs b/lib/dsc-lib/src/dscerror.rs index 02a482107..2e1488c77 100644 --- a/lib/dsc-lib/src/dscerror.rs +++ b/lib/dsc-lib/src/dscerror.rs @@ -6,7 +6,6 @@ use std::str::Utf8Error; use indicatif::style::TemplateError; use thiserror::Error; -use tracing::error; use tree_sitter::LanguageError; #[derive(Error, Debug)]