diff --git a/posh-cargo.psm1 b/posh-cargo.psm1 index 4473e13..5821d60 100644 --- a/posh-cargo.psm1 +++ b/posh-cargo.psm1 @@ -80,6 +80,25 @@ function get_available_target_triples($toolchain) { return $targets | Where-Object { $_ -match $pattern } | ForEach-Object { $_ -replace $pattern, '' } } +function get_toolchain_path($toolchain) { + $rustc_path = '' + if ($toolchain) { + $rustc_path = $(rustup run $toolchain rustup which rustc) + } + else { + $rustc_path = $(rustup which rustc) + } + return Resolve-Path ((Split-Path $rustc_path) + '\..') +} + +function get_rustc_errorcode_list($toolchain) { + $toolchain_path = (get_toolchain_path $toolchain) + $doc_path = Join-Path $toolchain_path 'share\doc\rust\html\error-index.html' + Get-Content $doc_path | Where-Object { + $_ -match 'error-described error-used\">
')
+ }
+ }
+ }
}
}