Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various quick fixes #256

Merged
merged 5 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,17 @@
"severity": 4,
"message": 5
}
}
},
{
"name": "msvc",
"source": "msvc",
"owner": "makefile-tools",
"base": "$msCompile",
"fileLocation": [
"autoDetect",
"${command:makefile.getLaunchTargetDirectory}"
]
}
],
"configuration": {
"type": "object",
Expand Down Expand Up @@ -255,7 +265,7 @@
"items": {
"type": "string"
},
"default": [],
"default": ["$gcc", "$msvc"],
"description": "Problem matcher names to use when building the current target"
},
"buildLog": {
Expand Down
3 changes: 3 additions & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,9 @@ export function getCommandForConfiguration(configuration: string | undefined): v
} else {
vscode.commands.executeCommand('setContext', "makefile:fullFeatureSet", true);
}
} else {
// If we have a build log, then we want Makefile Tools to be fully active and the UI visible.
vscode.commands.executeCommand('setContext', "makefile:fullFeatureSet", true);
}
}

Expand Down
16 changes: 10 additions & 6 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import * as vscode from 'vscode';
// that would make parseLineAsTool to not match the regular expression,
// therefore wrongly skipping over compilation lines?
const compilers: string[] = ["ccache", "clang\\+\\+", "clang-cl", "clang-cpp", "clang", "gcc", "gpp", "cpp", "icc", "cc", "icl", "cl", "g\\+\\+", "c\\+\\+"];
const linkers: string[] = ["ccache", "ilink", "link", "ld", "gcc", "clang\\+\\+", "clang", "cc", "g\\+\\+", "c\\+\\+"];
const linkers: string[] = ["ccache", "ilink", "link", "ld", "ccld", "gcc", "clang\\+\\+", "clang", "cc", "g\\+\\+", "c\\+\\+"];
const sourceFileExtensions: string[] = ["cpp", "cc", "cxx", "c"];

const chunkSize: number = 100;
Expand Down Expand Up @@ -280,11 +280,15 @@ async function parseLineAsTool(
});

// Add any additional tools specified by the user
configuration.getAdditionalCompilerNames()?.forEach(compiler => {
if (!toolNames.includes(compiler)) {
versionedToolNames.push(`${prefixRegex}${compiler}${suffixRegex}`);
}
});
// when we are looking at compilers or linkers,
// not when we parse for binary targets.
if (isCompilerOrLinker) {
configuration.getAdditionalCompilerNames()?.forEach(compiler => {
if (!toolNames.includes(compiler)) {
versionedToolNames.push(`${prefixRegex}${compiler}${suffixRegex}`);
}
});
}

// - any spaces/tabs before the tool invocation
// - with or without path (relative -to the makefile location- or full)
Expand Down
3 changes: 2 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ export function spawnChildProcess(
let shellType: string | undefined;
let shellPlatform: string = (process.platform === "win32") ? "windows" : (process.platform === "linux") ? "linux" : "osx";
let workspaceConfiguration: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("terminal");
shellType = workspaceConfiguration.get<string>(`integrated.automationShell.${shellPlatform}`);
shellType = workspaceConfiguration.get<string>(`integrated.automationProfile.${shellPlatform}`) || // automationShell is deprecated
workspaceConfiguration.get<string>(`integrated.automationShell.${shellPlatform}`); // and replaced with automationProfile

// Final quoting decisions for process name and args before being executed.
let qProcessName: string = ensureQuoted ? quoteStringIfNeeded(processName) : processName;
Expand Down