Improve detection of Rust in languages input

This commit is contained in:
Henry Mercer
2025-08-05 11:43:04 +01:00
parent cfb8d07200
commit 83e92edc4b
6 changed files with 39 additions and 16 deletions
+10 -2
View File
@@ -362,8 +362,16 @@ async function run() {
}
core.endGroup();
// Set CODEQL_ENABLE_EXPERIMENTAL_FEATURES for rust
if (getOptionalInput("languages")?.includes(KnownLanguage.rust)) {
// Set CODEQL_ENABLE_EXPERIMENTAL_FEATURES for Rust. We need to set this environment
// variable before initializing the config, otherwise Rust analysis will not be
// enabled.
if (
// Only enable Rust analysis if the user has explicitly requested it - don't
// enable it via language autodetection.
configUtils
.getRawLanguagesNoAutodetect(getOptionalInput("languages"))
.includes(KnownLanguage.rust)
) {
const feat = Feature.RustAnalysis;
const minVer = featureConfig[feat].minimumVersion as string;
const envVar = "CODEQL_ENABLE_EXPERIMENTAL_FEATURES";