* Various small fixes for 0.2.1

* Some tuning of showing/hiding output channel.
This commit is contained in:
Andreea Isac 2021-04-28 11:01:46 -07:00 коммит произвёл GitHub
Родитель 4a02fb0df3
Коммит a157d1aae0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 28 добавлений и 8 удалений

Просмотреть файл

@ -493,7 +493,7 @@ export function getCommandForConfiguration(configuration: string | undefined): v
let makefileUsed: string | undefined = makefileConfiguration?.makefilePath || makefilePath;
if (makefileUsed) {
configurationMakeArgs.push("-f");
configurationMakeArgs.push(makefileUsed);
configurationMakeArgs.push(`"${makefileUsed}"`);
// Need to rethink this (GitHub 59).
// Some repos don't work when we automatically add -C, others don't work when we don't.
// configurationMakeArgs.push("-C");

Просмотреть файл

@ -36,6 +36,7 @@ export class CppConfigurationProvider implements cpp.CustomConfigurationProvider
if (!sourceFileConfiguration) {
logger.message(`Configuration for file ${norm_path} was not found. CppTools will set a default configuration.`);
logger.showOutputChannel();
}
return sourceFileConfiguration;

Просмотреть файл

@ -293,6 +293,11 @@ export async function buildTarget(triggeredBy: TriggeredBy, target: string, clea
telemetry.logEvent("build", telemetryProperties, telemetryMeasures);
cancelBuild = false;
if (retc !== ConfigureBuildReturnCodeTypes.success) {
logger.showOutputChannel();
}
return retc;
},
);
@ -525,8 +530,6 @@ export async function preConfigure(triggeredBy: TriggeredBy): Promise<number> {
return ConfigureBuildReturnCodeTypes.blocked;
}
logger.showOutputChannel();
let preConfigureStartTime: number = Date.now();
let scriptFile: string | undefined = configuration.getPreConfigureScript();
@ -588,6 +591,11 @@ export async function preConfigure(triggeredBy: TriggeredBy): Promise<number> {
telemetry.logEvent("preConfigure", telemetryProperties, telemetryMeasures);
cancelPreConfigure = false;
if (retc !== ConfigureBuildReturnCodeTypes.success) {
logger.showOutputChannel();
}
return retc;
},
);
@ -637,11 +645,11 @@ export async function runPreConfigureScript(progress: vscode.Progress<{}>, scrip
if (process.platform === 'win32') {
runCommand = "cmd";
scriptArgs.push("/c");
scriptArgs.push(wrapScriptFile);
scriptArgs.push(`"${wrapScriptFile}"`);
} else {
runCommand = "/bin/bash";
scriptArgs.push("-c");
scriptArgs.push(`"source ${wrapScriptFile}"`);
scriptArgs.push(`"source '${wrapScriptFile}"'`);
}
try {
@ -811,8 +819,6 @@ export async function configure(triggeredBy: TriggeredBy, updateTargets: boolean
return ConfigureBuildReturnCodeTypes.saveFailed;
}
logger.showOutputChannel();
// Same start time for configure and an eventual pre-configure.
let configureStartTime: number = Date.now();
@ -991,6 +997,10 @@ export async function configure(triggeredBy: TriggeredBy, updateTargets: boolean
if (retc !== ConfigureBuildReturnCodeTypes.cancelled) {
extension.setCompletedConfigureInSession(true);
}
if (retc !== ConfigureBuildReturnCodeTypes.success) {
logger.showOutputChannel();
}
}
}

Просмотреть файл

@ -353,7 +353,8 @@ async function parseLineAsTool(
}
return {
pathInMakefile: toolPathInMakefile,
// don't use join and neither paths/filenames processed above if we want to keep the exact text in the makefile
pathInMakefile: match[1] + match[2],
fullPath: toolFullPath,
arguments: match[match.length - 1],
found: toolFound
@ -875,6 +876,14 @@ export async function parseCustomConfigProvider(cancel: vscode.CancellationToken
currentPath = currentPathHistory[currentPathHistory.length - 1];
let compilerTool: ToolInvocation | undefined = await parseLineAsTool(line, compilers, currentPath);
// If ccache wraps the compiler, parse again the remaining command line and we should obtain
// the real compiler name.
if (compilerTool && path.parse(compilerTool.pathInMakefile).name.endsWith("ccache")) {
line = line.replace(`${compilerTool.pathInMakefile}`, "");
compilerTool = await parseLineAsTool(line, compilers, currentPath);
}
if (compilerTool) {
logger.message("Found compiler command: " + line, "Verbose");