Localize our output logging (#617)
* localized launch and util * localize cpptools * loc output for parser.ts * localized make.ts * localize configuration.ts * fix some loc pipelines * fix loc * fix loc error * make sure localization is initialized * remove space * fix test strings * fix test issues * fix loc testing * still working on test strings * modify * fix tests * more fixing * fix references * hopefully last test fix
This commit is contained in:
Родитель
299c05efb1
Коммит
962a3d05b2
|
@ -93,12 +93,19 @@ export function readCurrentMakefileConfiguration(): void {
|
|||
extension.getState().buildConfiguration;
|
||||
if (!buildConfiguration) {
|
||||
logger.message(
|
||||
"No current configuration is defined in the workspace state. Assuming 'Default'."
|
||||
localize(
|
||||
"no.current.configuration.defined.workspace.state",
|
||||
"No current configuration is defined in the workspace state. Assuming 'Default'."
|
||||
)
|
||||
);
|
||||
currentMakefileConfiguration = "Default";
|
||||
} else {
|
||||
logger.message(
|
||||
`Reading current configuration "${buildConfiguration}" from the workspace state.`
|
||||
localize(
|
||||
"reading.current.configuration.workspace.state",
|
||||
'Reading current configuration "{0}" from the workspace state.',
|
||||
buildConfiguration
|
||||
)
|
||||
);
|
||||
currentMakefileConfiguration = buildConfiguration;
|
||||
}
|
||||
|
@ -229,7 +236,12 @@ export function setMakePath(path: string): void {
|
|||
async function readMakePath(): Promise<void> {
|
||||
makePath = await util.getExpandedSetting<string>("makePath");
|
||||
if (!makePath) {
|
||||
logger.message("No path to the make tool is defined in the settings file.");
|
||||
logger.message(
|
||||
localize(
|
||||
"no.make.tool.defined",
|
||||
"No path to the make tool is defined in the settings file."
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -247,7 +259,12 @@ export function setMakefilePath(path: string): void {
|
|||
async function readMakefilePath(): Promise<void> {
|
||||
makefilePath = await util.getExpandedSetting<string>("makefilePath");
|
||||
if (!makefilePath) {
|
||||
logger.message("No path to the makefile is defined in the settings file.");
|
||||
logger.message(
|
||||
localize(
|
||||
"no.makefile.defined.in.settings",
|
||||
"No path to the makefile is defined in the settings file."
|
||||
)
|
||||
);
|
||||
} else {
|
||||
makefilePath = util.resolvePathToRoot(makefilePath);
|
||||
}
|
||||
|
@ -268,7 +285,10 @@ async function readMakeDirectory(): Promise<void> {
|
|||
makeDirectory = await util.getExpandedSetting<string>("makeDirectory");
|
||||
if (!makeDirectory) {
|
||||
logger.message(
|
||||
"No folder path to the makefile is defined in the settings file."
|
||||
localize(
|
||||
"no.folder.path.defined.in.settings",
|
||||
"No folder path to the makefile is defined in the settings file."
|
||||
)
|
||||
);
|
||||
} else {
|
||||
makeDirectory = util.resolvePathToRoot(makeDirectory);
|
||||
|
@ -333,9 +353,13 @@ export async function readBuildLog(): Promise<boolean> {
|
|||
buildLog = await util.getExpandedSetting<string>("buildLog");
|
||||
if (buildLog) {
|
||||
buildLog = util.resolvePathToRoot(buildLog);
|
||||
logger.message(`Build log defined at "${buildLog}"`);
|
||||
logger.message(
|
||||
localize("build.log.defined.at", 'Build log defined at "{0}"', buildLog)
|
||||
);
|
||||
if (!util.checkFileExistsSync(buildLog)) {
|
||||
logger.message("Build log not found on disk.");
|
||||
logger.message(
|
||||
localize("build.log.not.found.disk", "Build log not found on disk.")
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -354,7 +378,7 @@ export function setLoggingLevel(logLevel: string): void {
|
|||
export async function readLoggingLevel(): Promise<void> {
|
||||
loggingLevel =
|
||||
(await util.getExpandedSetting<string>("loggingLevel")) || "Normal";
|
||||
logger.message(`Logging level: ${loggingLevel}`);
|
||||
logger.message(localize("logging.level", "Logging level: {0}", loggingLevel));
|
||||
}
|
||||
|
||||
let extensionOutputFolder: string | undefined;
|
||||
|
@ -384,16 +408,28 @@ export async function readExtensionOutputFolder(): Promise<void> {
|
|||
if (!util.createDirectorySync(extensionOutputFolder)) {
|
||||
extensionOutputFolder = extension.extensionContext.storagePath;
|
||||
logger.message(
|
||||
`Extension output folder does not exist and could not be created: ${extensionOutputFolder}.`
|
||||
localize(
|
||||
"extension.output.folder.does.not.exist.no.creation",
|
||||
"Extension output folder does not exist and could not be created: {0}.",
|
||||
extensionOutputFolder
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
`Reverting to '${extensionOutputFolder}' default for extension output folder.`
|
||||
localize(
|
||||
"reverting.to.default.output.folder",
|
||||
"Reverting to '{0}' default for extension output folder.",
|
||||
extensionOutputFolder
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
logger.message(
|
||||
`Dropping various extension output files at ${extensionOutputFolder}`
|
||||
localize(
|
||||
"dropping.various.extension.output.files",
|
||||
"Dropping various extension output files at {0}",
|
||||
extensionOutputFolder
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -426,7 +462,13 @@ export async function readExtensionLog(): Promise<void> {
|
|||
extensionLog = util.resolvePathToRoot(extensionLog);
|
||||
}
|
||||
|
||||
logger.message(`Writing extension log at ${extensionLog}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"writing.extension.log",
|
||||
"Writing extension log at {0}",
|
||||
extensionLog
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -471,10 +513,19 @@ export async function readPreConfigureScript(): Promise<void> {
|
|||
if (preConfigureScript) {
|
||||
preConfigureScript = util.resolvePathToRoot(preConfigureScript);
|
||||
logger.message(
|
||||
`Found pre-configure script defined as ${preConfigureScript}`
|
||||
localize(
|
||||
"found.preconfigure.script",
|
||||
"Found pre-configure script defined as {0}",
|
||||
preConfigureScript
|
||||
)
|
||||
);
|
||||
if (!util.checkFileExistsSync(preConfigureScript)) {
|
||||
logger.message("Pre-configure script not found on disk.");
|
||||
logger.message(
|
||||
localize(
|
||||
"preconfigure.script.not.found.on.disk",
|
||||
"Pre-configure script not found on disk."
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -484,7 +535,11 @@ export async function readPreConfigureArgs(): Promise<void> {
|
|||
(await util.getExpandedSetting<string[]>("preConfigureArgs")) ?? [];
|
||||
if (preConfigureArgs && preConfigureArgs.length > 0) {
|
||||
logger.message(
|
||||
`Pre-configure arguments: '${preConfigureArgs.join("', '")}'`
|
||||
localize(
|
||||
"preconfigure.arguments",
|
||||
"Pre-configure arguments: '{0}'",
|
||||
preConfigureArgs.join("', '")
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -496,10 +551,19 @@ export async function readPostConfigureScript(): Promise<void> {
|
|||
if (postConfigureScript) {
|
||||
postConfigureScript = util.resolvePathToRoot(postConfigureScript);
|
||||
logger.message(
|
||||
`Found post-configure script defined as ${postConfigureScript}`
|
||||
localize(
|
||||
"post.configure.script.defined.as",
|
||||
"Found post-configure script defined as {0}",
|
||||
postConfigureScript
|
||||
)
|
||||
);
|
||||
if (!util.checkFileExistsSync(postConfigureScript)) {
|
||||
logger.message("Post-configure script not found on disk");
|
||||
logger.message(
|
||||
localize(
|
||||
"post.configure.not.found.on.disk",
|
||||
"Post-configure script not found on disk"
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -509,7 +573,11 @@ export async function readPostConfigureArgs(): Promise<void> {
|
|||
(await util.getExpandedSetting<string[]>("postConfigureArgs")) ?? [];
|
||||
if (postConfigureArgs && postConfigureArgs.length > 0) {
|
||||
logger.message(
|
||||
`Post-configure arguments: '${postConfigureArgs.join("', '")}'`
|
||||
localize(
|
||||
"post.configure.arguments.listed",
|
||||
"Post-configure arguments: '{0}'",
|
||||
postConfigureArgs.join("', '")
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -536,14 +604,26 @@ export async function readAlwaysPreConfigure(): Promise<void> {
|
|||
alwaysPreConfigure = await util.getExpandedSetting<boolean>(
|
||||
"alwaysPreConfigure"
|
||||
);
|
||||
logger.message(`Always pre-configure: ${alwaysPreConfigure}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"always.pre.configure",
|
||||
"Always pre-configure: {0}",
|
||||
alwaysPreConfigure
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export async function readAlwaysPostConfigure(): Promise<void> {
|
||||
alwaysPostConfigure = await util.getExpandedSetting<boolean>(
|
||||
"alwaysPostConfigure"
|
||||
);
|
||||
logger.message(`Always post-configure: ${alwaysPostConfigure}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"always.post.configure",
|
||||
"Always post-configure: {0}",
|
||||
alwaysPostConfigure
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
let configurationCachePath: string | undefined;
|
||||
|
@ -583,7 +663,13 @@ export async function readConfigurationCachePath(): Promise<void> {
|
|||
}
|
||||
|
||||
if (oldConfigurationCachePath !== configurationCachePath) {
|
||||
logger.message(`Configurations cached at ${configurationCachePath}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"configurations.cached",
|
||||
"Configurations cached at {0}",
|
||||
configurationCachePath
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -603,7 +689,13 @@ export async function readCompileCommandsPath(): Promise<void> {
|
|||
compileCommandsPath = util.resolvePathToRoot(compileCommandsPath);
|
||||
}
|
||||
|
||||
logger.message(`compile_commands.json path: ${compileCommandsPath}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"compile.commands.json.path",
|
||||
"compile_commands.json path: {0}",
|
||||
compileCommandsPath
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
let additionalCompilerNames: string[] | undefined;
|
||||
|
@ -619,7 +711,11 @@ export async function readAdditionalCompilerNames(): Promise<void> {
|
|||
);
|
||||
if (additionalCompilerNames && additionalCompilerNames.length > 0) {
|
||||
logger.message(
|
||||
`Additional compiler names: '${additionalCompilerNames?.join("', '")}'`
|
||||
localize(
|
||||
"additional.compiler.names",
|
||||
"Additional compiler names: '{0}'",
|
||||
additionalCompilerNames?.join("', '")
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -637,7 +733,11 @@ export async function readExcludeCompilerNames(): Promise<void> {
|
|||
);
|
||||
if (excludeCompilerNames && excludeCompilerNames.length > 0) {
|
||||
logger.message(
|
||||
`Exclude compiler names: '${excludeCompilerNames?.join("', '")}'`
|
||||
localize(
|
||||
"exclude.compiler.names",
|
||||
"Exclude compiler names: '{0}'",
|
||||
excludeCompilerNames?.join("', '")
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -661,7 +761,13 @@ export function setDryrunSwitches(switches: string[]): void {
|
|||
export async function readDryrunSwitches(): Promise<void> {
|
||||
dryrunSwitches = await util.getExpandedSetting<string[]>("dryrunSwitches");
|
||||
if (dryrunSwitches && dryrunSwitches.length > 0) {
|
||||
logger.message(`Dry-run switches: '${dryrunSwitches?.join("', '")}'`);
|
||||
logger.message(
|
||||
localize(
|
||||
"dry.run.switches",
|
||||
"Dry-run switches: '{0}'",
|
||||
dryrunSwitches?.join("', '")
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -790,7 +896,11 @@ async function readCurrentLaunchConfiguration(): Promise<void> {
|
|||
if (currentLaunchConfiguration) {
|
||||
launchConfigStr = launchConfigurationToString(currentLaunchConfiguration);
|
||||
logger.message(
|
||||
`Reading current launch configuration "${launchConfigStr}" from the workspace state.`
|
||||
localize(
|
||||
"reading.current.launch.configuration",
|
||||
'Reading current launch configuration "{0}" from the workspace state.',
|
||||
launchConfigStr
|
||||
)
|
||||
);
|
||||
} else {
|
||||
// A null launch configuration after a non empty launch configuration string name
|
||||
|
@ -803,12 +913,19 @@ async function readCurrentLaunchConfiguration(): Promise<void> {
|
|||
currentLaunchConfigurationName !== ""
|
||||
) {
|
||||
logger.message(
|
||||
`Launch configuration "${currentLaunchConfigurationName}" is no longer defined in settings "makefile.launchConfigurations".`
|
||||
localize(
|
||||
"launch.configuration.no.longer.defined.settings",
|
||||
'Launch configuration "{0}" is no longer defined in settings "makefile.launchConfigurations".',
|
||||
currentLaunchConfigurationName
|
||||
)
|
||||
);
|
||||
await setLaunchConfigurationByName("");
|
||||
} else {
|
||||
logger.message(
|
||||
"No current launch configuration is set in the workspace state."
|
||||
localize(
|
||||
"no.current.launch.configurations.in.state",
|
||||
"No current launch configuration is set in the workspace state."
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -837,10 +954,16 @@ export async function readDefaultLaunchConfiguration(): Promise<void> {
|
|||
await util.getExpandedSetting<DefaultLaunchConfiguration>(
|
||||
"defaultLaunchConfiguration"
|
||||
);
|
||||
logger.message(`Default launch configuration: MIMode = ${defaultLaunchConfiguration?.MIMode},
|
||||
miDebuggerPath = ${defaultLaunchConfiguration?.miDebuggerPath},
|
||||
stopAtEntry = ${defaultLaunchConfiguration?.stopAtEntry},
|
||||
symbolSearchPath = ${defaultLaunchConfiguration?.symbolSearchPath}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"default.launch.configuration",
|
||||
"Default launch configuration: MIMode = {0},\n miDebuggerPath = {1},\n stopAtEntry = {2},\n symbolSearchPath = {3}",
|
||||
defaultLaunchConfiguration?.MIMode,
|
||||
defaultLaunchConfiguration?.miDebuggerPath,
|
||||
defaultLaunchConfiguration?.stopAtEntry,
|
||||
defaultLaunchConfiguration?.symbolSearchPath
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Command name and args are used when building from within the VS Code Makefile Tools Extension,
|
||||
|
@ -1040,9 +1163,12 @@ export async function getCommandForConfiguration(
|
|||
|
||||
if (configurationMakeCommand) {
|
||||
logger.message(
|
||||
`Deduced command '${configurationMakeCommand} ${configurationMakeArgs.join(
|
||||
" "
|
||||
)}' for configuration "${configuration}"`
|
||||
localize(
|
||||
"deduced.command.configuration",
|
||||
"Deduced command '{0}' for configuration \"{1}\"",
|
||||
`${configurationMakeCommand} ${configurationMakeArgs.join(" ")}`,
|
||||
configuration
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1079,7 +1205,10 @@ export async function getCommandForConfiguration(
|
|||
makeParsedPathConfigurations.name === "")
|
||||
) {
|
||||
logger.message(
|
||||
"Could not find any make tool file name in makefile.configurations.makePath, nor in makefile.makePath. Assuming make."
|
||||
localize(
|
||||
"could.not.find.make.file.tools.name",
|
||||
"Could not find any make tool file name in makefile.configurations.makePath, nor in makefile.makePath. Assuming make."
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1088,7 +1217,10 @@ export async function getCommandForConfiguration(
|
|||
if (configurationCommandPath !== "") {
|
||||
if (!util.checkFileExistsSync(configurationMakeCommand)) {
|
||||
logger.message(
|
||||
"Make was not found on disk at the location provided via makefile.makePath or makefile.configurations[].makePath."
|
||||
localize(
|
||||
"make.was.not.found.on.disk",
|
||||
"Make was not found on disk at the location provided via makefile.makePath or makefile.configurations[].makePath."
|
||||
)
|
||||
);
|
||||
|
||||
// How often location settings don't work (maybe because not yet expanding variables)?
|
||||
|
@ -1103,7 +1235,10 @@ export async function getCommandForConfiguration(
|
|||
util.toolPathInEnv(makeBaseName);
|
||||
if (!makePathInEnv) {
|
||||
logger.message(
|
||||
"Make was not given any path in settings and is also not found on the environment path."
|
||||
localize(
|
||||
"make.was.not.found.in.settings.not.environment",
|
||||
"Make was not given any path in settings and is also not found on the environment path."
|
||||
)
|
||||
);
|
||||
|
||||
// Do the users need an environment automatically set by the extension?
|
||||
|
@ -1117,10 +1252,10 @@ export async function getCommandForConfiguration(
|
|||
|
||||
if (!util.checkFileExistsSync(configurationMakefile)) {
|
||||
logger.message(
|
||||
"The makefile entry point was not found. " +
|
||||
"Make sure it exists at the location defined by makefile.makefilePath, makefile.configurations[].makefilePath, " +
|
||||
"makefile.makeDirectory, makefile.configurations[].makeDirectory" +
|
||||
"or in the root of the workspace."
|
||||
localize(
|
||||
"makefile.entry.point.not.found",
|
||||
"The makefile entry point was not found. Make sure it exists at the location defined by makefile.makefilePath, makefile.configurations[].makefilePath, makefile makefile.makeDirectory, makefile.configurations[].makeDirectory or in the root of the workspace."
|
||||
)
|
||||
);
|
||||
|
||||
// we may need more advanced ability to process settings
|
||||
|
@ -1175,7 +1310,12 @@ export function getBuildLogForConfiguration(
|
|||
|
||||
if (configurationBuildLog) {
|
||||
logger.message(
|
||||
`Found build log path setting "${configurationBuildLog}" defined for configuration "${configuration}"`
|
||||
localize(
|
||||
"found.build.log.path.in.setting",
|
||||
'Found build log path setting "{0}" defined for configuration "{1}"',
|
||||
configurationBuildLog,
|
||||
configuration
|
||||
)
|
||||
);
|
||||
|
||||
if (!path.isAbsolute(configurationBuildLog)) {
|
||||
|
@ -1183,12 +1323,21 @@ export function getBuildLogForConfiguration(
|
|||
util.getWorkspaceRoot(),
|
||||
configurationBuildLog
|
||||
);
|
||||
logger.message(`Resolving build log path to "${configurationBuildLog}"`);
|
||||
logger.message(
|
||||
localize(
|
||||
"resolving.build.log.path.to",
|
||||
'Resolving build log path to "{0}"',
|
||||
configurationBuildLog
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (!util.checkFileExistsSync(configurationBuildLog)) {
|
||||
logger.message(
|
||||
"Build log not found. Remove the build log setting or provide a build log file on disk at the given location."
|
||||
localize(
|
||||
"build.log.not.found.remove.setting",
|
||||
"Build log not found. Remove the build log setting or provide a build log file on disk at the given location."
|
||||
)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -1272,13 +1421,23 @@ export async function readMakefileConfigurations(): Promise<void> {
|
|||
|
||||
element.name = autoGeneratedName;
|
||||
logger.message(
|
||||
`Defining name ${autoGeneratedName} for unnamed configuration ${element}.`
|
||||
localize(
|
||||
"defining.name.for.unnamed",
|
||||
"Defining name {0} for unnamed configuration {1}.",
|
||||
autoGeneratedName,
|
||||
element.name
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
if (detectedUnnamedConfigurations) {
|
||||
logger.message("Updating makefile configurations in settings.");
|
||||
logger.message(
|
||||
localize(
|
||||
"updating.makefile.configurations.settings",
|
||||
"Updating makefile configurations in settings."
|
||||
)
|
||||
);
|
||||
await workspaceConfiguration.update(
|
||||
"configurations",
|
||||
makefileConfigurations
|
||||
|
@ -1299,8 +1458,11 @@ export async function readMakefileConfigurations(): Promise<void> {
|
|||
);
|
||||
if (makefileConfigurationNames.length > 0) {
|
||||
logger.message(
|
||||
"Found the following configurations defined in makefile.configurations setting: " +
|
||||
localize(
|
||||
"found.following.configurations.defined.setting",
|
||||
"Found the following configurations defined in makefile.configurations setting: {0}",
|
||||
makefileConfigurationNames.join(";")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1314,8 +1476,11 @@ export async function readMakefileConfigurations(): Promise<void> {
|
|||
!makefileConfigurationNames.includes(currentMakefileConfiguration)
|
||||
) {
|
||||
logger.message(
|
||||
`Current makefile configuration ${currentMakefileConfiguration} is no longer present in the available list.` +
|
||||
` Re-setting the current makefile configuration to default.`
|
||||
localize(
|
||||
"current.makefile.configuration.not.present",
|
||||
"Current makefile configuration ${currentMakefileConfiguration} is no longer present in the available list. Re-setting the current makefile configuration to default.",
|
||||
currentMakefileConfiguration
|
||||
)
|
||||
);
|
||||
await setConfigurationByName("Default");
|
||||
}
|
||||
|
@ -1337,7 +1502,10 @@ function readCurrentTarget(): void {
|
|||
let buildTarget: string | undefined = extension.getState().buildTarget;
|
||||
if (!buildTarget) {
|
||||
logger.message(
|
||||
"No target defined in the workspace state. Assuming 'Default'."
|
||||
localize(
|
||||
"no.target.defined.assuming.default",
|
||||
"No target defined in the workspace state. Assuming 'Default'."
|
||||
)
|
||||
);
|
||||
statusBar.setTarget("Default");
|
||||
// If no particular target is defined in settings, use 'Default' for the button
|
||||
|
@ -1346,7 +1514,11 @@ function readCurrentTarget(): void {
|
|||
} else {
|
||||
currentTarget = buildTarget;
|
||||
logger.message(
|
||||
`Reading current build target "${currentTarget}" from the workspace state.`
|
||||
localize(
|
||||
"reading.current.build.target.from.state",
|
||||
'Reading current build target "{0}" from the workspace state.',
|
||||
currentTarget
|
||||
)
|
||||
);
|
||||
statusBar.setTarget(currentTarget);
|
||||
}
|
||||
|
@ -1361,7 +1533,9 @@ export function setConfigureOnOpen(configure: boolean): void {
|
|||
}
|
||||
export async function readConfigureOnOpen(): Promise<void> {
|
||||
configureOnOpen = await util.getExpandedSetting<boolean>("configureOnOpen");
|
||||
logger.message(`Configure on open: ${configureOnOpen}`);
|
||||
logger.message(
|
||||
localize("configuring.on.open", "Configure on open: {0}", configureOnOpen)
|
||||
);
|
||||
}
|
||||
|
||||
let configureOnEdit: boolean | undefined;
|
||||
|
@ -1373,7 +1547,9 @@ export function setConfigureOnEdit(configure: boolean): void {
|
|||
}
|
||||
export async function readConfigureOnEdit(): Promise<void> {
|
||||
configureOnEdit = await util.getExpandedSetting<boolean>("configureOnEdit");
|
||||
logger.message(`Configure on edit: ${configureOnEdit}`);
|
||||
logger.message(
|
||||
localize("configure.on.edit", "Configure on edit: {0}", configureOnEdit)
|
||||
);
|
||||
}
|
||||
|
||||
let configureAfterCommand: boolean | undefined;
|
||||
|
@ -1387,7 +1563,13 @@ export async function readConfigureAfterCommand(): Promise<void> {
|
|||
configureAfterCommand = await util.getExpandedSetting<boolean>(
|
||||
"configureAfterCommand"
|
||||
);
|
||||
logger.message(`Configure after command: ${configureAfterCommand}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"configure.after.command",
|
||||
"Configure after command: {0}",
|
||||
configureAfterCommand
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
let phonyOnlyTargets: boolean | undefined;
|
||||
|
@ -1399,7 +1581,9 @@ export function setPhonyOnlyTargets(phony: boolean): void {
|
|||
}
|
||||
export async function readPhonyOnlyTargets(): Promise<void> {
|
||||
phonyOnlyTargets = await util.getExpandedSetting<boolean>("phonyOnlyTargets");
|
||||
logger.message(`Only .PHONY targets: ${phonyOnlyTargets}`);
|
||||
logger.message(
|
||||
localize("only.phony.targets", "Only .PHONY targets: {0}", phonyOnlyTargets)
|
||||
);
|
||||
}
|
||||
|
||||
let saveBeforeBuildOrConfigure: boolean | undefined;
|
||||
|
@ -1414,7 +1598,11 @@ export async function readSaveBeforeBuildOrConfigure(): Promise<void> {
|
|||
"saveBeforeBuildOrConfigure"
|
||||
);
|
||||
logger.message(
|
||||
`Save before build or configure: ${saveBeforeBuildOrConfigure}`
|
||||
localize(
|
||||
"save.before.build.or.configure",
|
||||
"Save before build or configure: {0}",
|
||||
saveBeforeBuildOrConfigure
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1429,7 +1617,13 @@ export async function readBuildBeforeLaunch(): Promise<void> {
|
|||
buildBeforeLaunch = await util.getExpandedSetting<boolean>(
|
||||
"buildBeforeLaunch"
|
||||
);
|
||||
logger.message(`Build before launch: ${buildBeforeLaunch}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"build.before.launch",
|
||||
"Build before launch: {0}",
|
||||
buildBeforeLaunch
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
let clearOutputBeforeBuild: boolean | undefined;
|
||||
|
@ -1443,7 +1637,13 @@ export async function readClearOutputBeforeBuild(): Promise<void> {
|
|||
clearOutputBeforeBuild = await util.getExpandedSetting<boolean>(
|
||||
"clearOutputBeforeBuild"
|
||||
);
|
||||
logger.message(`Clear output before build: ${clearOutputBeforeBuild}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"clear.output.before.build",
|
||||
"Clear output before build: {0}",
|
||||
clearOutputBeforeBuild
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// This setting is useful for some repos where directory changing commands (cd, push, pop)
|
||||
|
@ -1463,7 +1663,13 @@ export async function readIgnoreDirectoryCommands(): Promise<void> {
|
|||
ignoreDirectoryCommands = await util.getExpandedSetting<boolean>(
|
||||
"ignoreDirectoryCommands"
|
||||
);
|
||||
logger.message(`Ignore directory commands: ${ignoreDirectoryCommands}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"ignore.directory.commands",
|
||||
"Ignore directory commands: {0}",
|
||||
ignoreDirectoryCommands
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Initialization from the state of the workspace.
|
||||
|
@ -1581,7 +1787,12 @@ export async function initFromSettings(
|
|||
extension.getCompletedConfigureInSession() &&
|
||||
!make.blockedByOp(make.Operations.configure, false)
|
||||
) {
|
||||
logger.message("Configuring after settings or makefile changes...");
|
||||
logger.message(
|
||||
localize(
|
||||
"configurating.after.settings.or.makefile.changes",
|
||||
"Configuring after settings or makefile changes..."
|
||||
)
|
||||
);
|
||||
await make.configure(
|
||||
make.TriggeredBy.configureAfterEditorFocusChange
|
||||
); // this sets configureDirty back to false if it succeeds
|
||||
|
@ -2014,7 +2225,10 @@ export async function initFromSettings(
|
|||
// information from all the array yet.
|
||||
updatedSettingsSubkeys.forEach(async (subKey) => {
|
||||
let key: string = keyRoot + "." + subKey;
|
||||
logger.message(`${key} setting changed.`, "Verbose");
|
||||
logger.message(
|
||||
localize("key.setting.changed", "{0} setting changed.", key),
|
||||
"Verbose"
|
||||
);
|
||||
try {
|
||||
// For settings that use "." in their name, make sure we send the right object
|
||||
// to the telemetry function. Currently, the schema for such a setting
|
||||
|
@ -2057,8 +2271,19 @@ export async function setConfigurationByName(
|
|||
configurationName: string
|
||||
): Promise<void> {
|
||||
extension.getState().buildConfiguration = configurationName;
|
||||
logger.message(`Setting configuration - ${configurationName}`);
|
||||
logger.message("Re-reading settings after configuration change.");
|
||||
logger.message(
|
||||
localize(
|
||||
"setting.configuration",
|
||||
"Setting configuration - {0}",
|
||||
configurationName
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
localize(
|
||||
"re.reading.settings.after.configuration.change",
|
||||
"Re-reading settings after configuration change."
|
||||
)
|
||||
);
|
||||
await setCurrentMakefileConfiguration(configurationName);
|
||||
// Refresh settings, they may reference variables or commands reading state configuration var (${configuration}).
|
||||
await initFromSettings();
|
||||
|
@ -2111,7 +2336,10 @@ export async function setNewConfiguration(): Promise<void> {
|
|||
|
||||
if (configureAfterCommand) {
|
||||
logger.message(
|
||||
"Automatically reconfiguring the project after a makefile configuration change."
|
||||
localize(
|
||||
"automatically.reconfiguring.project.after.change",
|
||||
"Automatically reconfiguring the project after a makefile configuration change."
|
||||
)
|
||||
);
|
||||
await make.cleanConfigure(
|
||||
make.TriggeredBy.configureAfterConfigurationChange
|
||||
|
@ -2158,8 +2386,15 @@ export async function setTargetByName(targetName: string): Promise<void> {
|
|||
currentTarget = targetName;
|
||||
let displayTarget: string = targetName ? currentTarget : "Default";
|
||||
statusBar.setTarget(displayTarget);
|
||||
logger.message(`Setting target ${displayTarget}`);
|
||||
logger.message("Re-reading settings after target change.");
|
||||
logger.message(
|
||||
localize("setting.target", "Setting target {0}", displayTarget)
|
||||
);
|
||||
logger.message(
|
||||
localize(
|
||||
"rereading.settings.after.target.change",
|
||||
"Re-reading settings after target change."
|
||||
)
|
||||
);
|
||||
// Refresh settings, they may reference variables or commands reading state target var (${buildTarget}).
|
||||
extension.getState().buildTarget = currentTarget;
|
||||
await initFromSettings();
|
||||
|
@ -2183,7 +2418,10 @@ export async function selectTarget(): Promise<void> {
|
|||
(configureOnOpen === false && !extension.getCompletedConfigureInSession())
|
||||
) {
|
||||
logger.message(
|
||||
"The project needs a configure to populate the build targets correctly."
|
||||
localize(
|
||||
"project.needs.configure.to.populate",
|
||||
"The project needs a configure to populate the build targets correctly."
|
||||
)
|
||||
);
|
||||
if (configureAfterCommand) {
|
||||
let retc: number = await make.configure(
|
||||
|
@ -2191,7 +2429,10 @@ export async function selectTarget(): Promise<void> {
|
|||
);
|
||||
if (retc !== make.ConfigureBuildReturnCodeTypes.success) {
|
||||
logger.message(
|
||||
"The build targets list may not be accurate because configure failed."
|
||||
localize(
|
||||
"build.targets.list.may.not.be.accurate",
|
||||
"The build targets list may not be accurate because configure failed."
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2232,7 +2473,10 @@ export async function selectTarget(): Promise<void> {
|
|||
if (configureAfterCommand) {
|
||||
// The set of build targets remains the same even if the current target has changed
|
||||
logger.message(
|
||||
"Automatically reconfiguring the project after a build target change."
|
||||
localize(
|
||||
"automatically.reconfiguring.after.build.target.change",
|
||||
"Automatically reconfiguring the project after a build target change."
|
||||
)
|
||||
);
|
||||
await make.cleanConfigure(
|
||||
make.TriggeredBy.configureAfterTargetChange,
|
||||
|
@ -2277,24 +2521,40 @@ export async function setLaunchConfigurationByName(
|
|||
launchConfigAsInSettings
|
||||
);
|
||||
logger.message(
|
||||
`Inserting a new entry for ${launchConfigurationName} in the array of makefile.launchConfigurations. ` +
|
||||
"You may define any additional debug properties for it in settings."
|
||||
localize(
|
||||
"inserting.new.entry.for.launch.configurations",
|
||||
"Inserting a new entry for {0} in the array of makefile.launchConfigurations. You may define any additional debug properties for it in settings.",
|
||||
launchConfigurationName
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentLaunchConfiguration) {
|
||||
logger.message(
|
||||
`Setting current launch target "${launchConfigurationName}"`
|
||||
localize(
|
||||
"setting.current.launch.target",
|
||||
'Setting current launch target "{0}"',
|
||||
launchConfigurationName
|
||||
)
|
||||
);
|
||||
extension.getState().launchConfiguration = launchConfigurationName;
|
||||
statusBar.setLaunchConfiguration(launchConfigurationName);
|
||||
} else {
|
||||
if (launchConfigurationName === "") {
|
||||
logger.message("Unsetting the current launch configuration.");
|
||||
logger.message(
|
||||
localize(
|
||||
"unsetting.current.launch.configuration",
|
||||
"Unsetting the current launch configuration."
|
||||
)
|
||||
);
|
||||
} else {
|
||||
logger.message(
|
||||
`A problem occured while analyzing launch configuration name ${launchConfigurationName}. Current launch configuration is unset.`
|
||||
localize(
|
||||
"problem.occured.while.analyzing.launch.configuration",
|
||||
"A problem occured while analyzing launch configuration name {0}. Current launch configuration is unset.",
|
||||
launchConfigurationName
|
||||
)
|
||||
);
|
||||
}
|
||||
extension.getState().launchConfiguration = undefined;
|
||||
|
@ -2302,7 +2562,12 @@ export async function setLaunchConfigurationByName(
|
|||
}
|
||||
|
||||
// Refresh settings, they may reference variables or commands reading launch targets commands: ${command:makefile.getLaunchTargetPath} and others...
|
||||
logger.message("Re-reading settings after launch target change.");
|
||||
logger.message(
|
||||
localize(
|
||||
"re.reading.settings.after.launch.target.changed",
|
||||
"Re-reading settings after launch target change."
|
||||
)
|
||||
);
|
||||
await initFromSettings();
|
||||
await extension._projectOutlineProvider.updateLaunchTarget(
|
||||
launchConfigurationName
|
||||
|
@ -2326,7 +2591,10 @@ export async function selectLaunchConfiguration(): Promise<void> {
|
|||
(configureOnOpen === false && !extension.getCompletedConfigureInSession())
|
||||
) {
|
||||
logger.message(
|
||||
"The project needs a configure to populate the launch targets correctly."
|
||||
localize(
|
||||
"project.needs.configure.to.populate",
|
||||
"The project needs a configure to populate the launch targets correctly."
|
||||
)
|
||||
);
|
||||
if (configureAfterCommand) {
|
||||
let retc: number = await make.configure(
|
||||
|
@ -2334,7 +2602,10 @@ export async function selectLaunchConfiguration(): Promise<void> {
|
|||
);
|
||||
if (retc !== make.ConfigureBuildReturnCodeTypes.success) {
|
||||
logger.message(
|
||||
"The launch targets list may not be accurate because configure failed."
|
||||
localize(
|
||||
"launch.targets.list.may.be.innacurate",
|
||||
"The launch targets list may not be accurate because configure failed."
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
130
src/cpptools.ts
130
src/cpptools.ts
|
@ -12,6 +12,13 @@ import * as util from "./util";
|
|||
import * as vscode from "vscode";
|
||||
import * as cpp from "vscode-cpptools";
|
||||
|
||||
import * as nls from "vscode-nls";
|
||||
nls.config({
|
||||
messageFormat: nls.MessageFormat.bundle,
|
||||
bundleFormat: nls.BundleFormat.standalone,
|
||||
})();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
export interface SourceFileConfigurationItem
|
||||
extends cpp.SourceFileConfigurationItem {
|
||||
readonly compileCommand: parser.CompileCommand;
|
||||
|
@ -50,13 +57,21 @@ export class CppConfigurationProvider
|
|||
.getDeltaCustomConfigurationProvider()
|
||||
.fileIndex.get(norm_path);
|
||||
logger.message(
|
||||
`Configuration for file ${norm_path} was not found. Searching in the current configure temporary file index.`
|
||||
localize(
|
||||
"configuration.for.file.not.found",
|
||||
"Configuration for file {0} was not found. Searching in the current configure temporary file index.",
|
||||
norm_path
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (!sourceFileConfiguration) {
|
||||
logger.message(
|
||||
`Configuration for file ${norm_path} was not found. CppTools will set a default configuration.`
|
||||
localize(
|
||||
"configuration.for.file.not.found.default",
|
||||
"Configuration for file {0} was not found. CppTools will set a default configuration",
|
||||
norm_path
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -139,7 +154,12 @@ export class CppConfigurationProvider
|
|||
_uri: vscode.Uri
|
||||
): Promise<cpp.WorkspaceBrowseConfiguration> {
|
||||
if (_uri.fsPath !== util.getWorkspaceRoot()) {
|
||||
logger.message("Makefile Tools supports single root for now.");
|
||||
logger.message(
|
||||
localize(
|
||||
"support.only.single.root",
|
||||
"Makefile Tools supports single root for now."
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return this.workspaceBrowseConfiguration;
|
||||
|
@ -160,25 +180,42 @@ export class CppConfigurationProvider
|
|||
|
||||
public logConfigurationProviderBrowse(): void {
|
||||
logger.message(
|
||||
"Sending Workspace Browse Configuration: -----------------------------------",
|
||||
localize(
|
||||
"sending.workspace.browse.configuration",
|
||||
"Sending Workspace Browse Configuration: -----------------------------------"
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
logger.message(
|
||||
" Browse Path: " +
|
||||
this.workspaceBrowseConfiguration.browsePath.join(";"),
|
||||
localize(
|
||||
"browse.path",
|
||||
" Browse Path: {0}",
|
||||
this.workspaceBrowseConfiguration.browsePath.join(";")
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
logger.message(
|
||||
" Standard: " + this.workspaceBrowseConfiguration.standard,
|
||||
localize(
|
||||
"standard",
|
||||
" Standard: {0}",
|
||||
this.workspaceBrowseConfiguration.standard
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
logger.message(
|
||||
" Compiler Path: " + this.workspaceBrowseConfiguration.compilerPath,
|
||||
localize(
|
||||
"compiler.path",
|
||||
" Compiler Path: {0}",
|
||||
this.workspaceBrowseConfiguration.compilerPath
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
logger.message(
|
||||
" Compiler Arguments: " +
|
||||
this.workspaceBrowseConfiguration.compilerArgs?.join(";"),
|
||||
localize(
|
||||
"compiler.arguments",
|
||||
" Compiler Arguments: {0}",
|
||||
this.workspaceBrowseConfiguration.compilerArgs?.join(";")
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
if (
|
||||
|
@ -186,8 +223,11 @@ export class CppConfigurationProvider
|
|||
this.workspaceBrowseConfiguration.windowsSdkVersion
|
||||
) {
|
||||
logger.message(
|
||||
" Windows SDK Version: " +
|
||||
this.workspaceBrowseConfiguration.windowsSdkVersion,
|
||||
localize(
|
||||
"windows.sdk.version",
|
||||
" Windows SDK Version: {0}",
|
||||
this.workspaceBrowseConfiguration.windowsSdkVersion
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
}
|
||||
|
@ -202,43 +242,73 @@ export class CppConfigurationProvider
|
|||
fromCache: boolean = false
|
||||
): void {
|
||||
let uriObj: vscode.Uri = <vscode.Uri>filePath.uri;
|
||||
logger.message(
|
||||
"Sending configuration " +
|
||||
(fromCache ? "(from cache) " : "") +
|
||||
"for file " +
|
||||
uriObj.fsPath +
|
||||
" -----------------------------------",
|
||||
"Normal"
|
||||
const fromCacheString = localize(
|
||||
"sending.configuration.from.cache",
|
||||
"Sending configuration (from cache) for file {0} -----------------------------------",
|
||||
uriObj.fsPath
|
||||
);
|
||||
const notFromCacheString = localize(
|
||||
"sending.configuration.for.file",
|
||||
"Sending configuration for file {0} -----------------------------------",
|
||||
uriObj.fsPath
|
||||
);
|
||||
logger.message(fromCache ? fromCacheString : notFromCacheString, "Normal");
|
||||
logger.message(
|
||||
" Defines: " + filePath.configuration.defines.join(";"),
|
||||
localize(
|
||||
"defines",
|
||||
" Defines: {0}",
|
||||
filePath.configuration.defines.join(";")
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
logger.message(
|
||||
" Includes: " + filePath.configuration.includePath.join(";"),
|
||||
localize(
|
||||
"include.path",
|
||||
" Includes: {0}",
|
||||
filePath.configuration.includePath.join(";")
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
if (filePath.configuration.forcedInclude) {
|
||||
logger.message(
|
||||
" Force Includes: " + filePath.configuration.forcedInclude.join(";"),
|
||||
localize(
|
||||
"force.includes",
|
||||
" Force Includes: {0}",
|
||||
filePath.configuration.forcedInclude.join(";")
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
}
|
||||
logger.message(
|
||||
" Standard: " + filePath.configuration.standard,
|
||||
localize(
|
||||
"standard.2",
|
||||
" Standard: {0}",
|
||||
filePath.configuration.standard
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
logger.message(
|
||||
" IntelliSense Mode: " + filePath.configuration.intelliSenseMode,
|
||||
localize(
|
||||
"intellisense.mode",
|
||||
" IntelliSense Mode: {0}",
|
||||
filePath.configuration.intelliSenseMode
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
logger.message(
|
||||
" Compiler Path: " + filePath.configuration.compilerPath,
|
||||
localize(
|
||||
"compiler.path",
|
||||
" Compiler Path: {0}",
|
||||
filePath.configuration.compilerPath
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
logger.message(
|
||||
" Compiler Arguments: " +
|
||||
filePath.configuration.compilerArgs?.join(";"),
|
||||
localize(
|
||||
"compiler.args.2",
|
||||
" Compiler Arguments: {0}",
|
||||
filePath.configuration.compilerArgs?.join(";")
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
if (
|
||||
|
@ -246,7 +316,11 @@ export class CppConfigurationProvider
|
|||
filePath.configuration.windowsSdkVersion
|
||||
) {
|
||||
logger.message(
|
||||
" Windows SDK Version: " + filePath.configuration.windowsSdkVersion,
|
||||
localize(
|
||||
"windows.sdk.version.2",
|
||||
" Windows SDK Version: {0}",
|
||||
filePath.configuration.windowsSdkVersion
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
}
|
||||
|
|
|
@ -245,28 +245,20 @@ export class Launcher implements vscode.Disposable {
|
|||
};
|
||||
|
||||
logger.message(
|
||||
"Created the following debug config:\n type = " +
|
||||
debugConfig.type +
|
||||
"\n cwd = " +
|
||||
debugConfig.cwd +
|
||||
" (= " +
|
||||
this.getLaunchTargetDirectory() +
|
||||
")" +
|
||||
"\n args = " +
|
||||
args.join(" ") +
|
||||
"\n program = " +
|
||||
debugConfig.program +
|
||||
" (= " +
|
||||
this.getLaunchTargetPath() +
|
||||
")" +
|
||||
"\n MIMode = " +
|
||||
debugConfig.MIMode +
|
||||
"\n miDebuggerPath = " +
|
||||
debugConfig.miDebuggerPath +
|
||||
"\n stopAtEntry = " +
|
||||
debugConfig.stopAtEntry +
|
||||
"\n symbolSearchPath = " +
|
||||
localize(
|
||||
"created.debug.config",
|
||||
"Created the following debug config:\n type = {0}\n cwd = {1} (= {2})\n args = {3}\n program = {4} (= {5})\n MIMode = {6}\n miDebuggerPath = {7}\n stopAtEntry = {8}\n symbolSearchPath = {9}",
|
||||
dbg,
|
||||
debugConfig.cwd,
|
||||
this.getLaunchTargetDirectory(),
|
||||
args.join(" "),
|
||||
debugConfig.program,
|
||||
this.getLaunchTargetPath(),
|
||||
debugConfig.MIMode,
|
||||
debugConfig.miDebuggerPath,
|
||||
debugConfig.stopAtEntry,
|
||||
debugConfig.symbolSearchPath
|
||||
)
|
||||
);
|
||||
|
||||
return debugConfig;
|
||||
|
@ -281,7 +273,11 @@ export class Launcher implements vscode.Disposable {
|
|||
if (configuration.getBuildBeforeLaunch()) {
|
||||
let currentBuildTarget: string = configuration.getCurrentTarget() || "";
|
||||
logger.message(
|
||||
`Building current target before launch: "${currentBuildTarget}"`
|
||||
localize(
|
||||
"building.current.target.before.launch",
|
||||
'Building current target before launch: "{0}"',
|
||||
currentBuildTarget
|
||||
)
|
||||
);
|
||||
let buildSuccess: boolean =
|
||||
(await make.buildTarget(
|
||||
|
@ -290,7 +286,13 @@ export class Launcher implements vscode.Disposable {
|
|||
false
|
||||
)) === make.ConfigureBuildReturnCodeTypes.success;
|
||||
if (!buildSuccess) {
|
||||
logger.message(`Building target "${currentBuildTarget}" failed.`);
|
||||
logger.message(
|
||||
localize(
|
||||
"building.target.failed",
|
||||
'Building target "{0}" failed.',
|
||||
currentBuildTarget
|
||||
)
|
||||
);
|
||||
let noButton: string = localize("no", "No");
|
||||
let yesButton: string = localize("yes", "Yes");
|
||||
const message: string = localize(
|
||||
|
@ -327,7 +329,7 @@ export class Launcher implements vscode.Disposable {
|
|||
localize(
|
||||
"cannot.op.no.launch.config.targets",
|
||||
"Cannot {0} because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target.",
|
||||
`'${op}'`
|
||||
op
|
||||
)
|
||||
);
|
||||
return LaunchStatuses.launchTargetsListEmpty;
|
||||
|
@ -336,7 +338,7 @@ export class Launcher implements vscode.Disposable {
|
|||
localize(
|
||||
"cannot.op.choose.launch.config",
|
||||
"Cannot {0} because there is no launch configuration set. Choose one from the quick pick.",
|
||||
`'${op}'`
|
||||
op
|
||||
)
|
||||
);
|
||||
await configuration.selectLaunchConfiguration();
|
||||
|
@ -350,7 +352,7 @@ export class Launcher implements vscode.Disposable {
|
|||
localize(
|
||||
"cannot.op.without.launch.config",
|
||||
"Cannot {0} until you select an active launch configuration.",
|
||||
`'${op}'`
|
||||
op
|
||||
)
|
||||
);
|
||||
return LaunchStatuses.noLaunchConfigurationSet;
|
||||
|
@ -418,11 +420,12 @@ export class Launcher implements vscode.Disposable {
|
|||
// Log the message for high verbosity only because the output channel will become visible over the terminal,
|
||||
// even if the terminal show() is called after the logger show().
|
||||
logger.message(
|
||||
"Running command '" +
|
||||
terminalCommand +
|
||||
"' in the terminal from location '" +
|
||||
this.getLaunchTargetDirectory() +
|
||||
"'",
|
||||
localize(
|
||||
"running.command.in.terminal",
|
||||
"Running command '{0}' in the terminal from location '{1}'",
|
||||
terminalCommand,
|
||||
this.getLaunchTargetDirectory()
|
||||
),
|
||||
"Debug"
|
||||
);
|
||||
return terminalCommand;
|
||||
|
|
465
src/make.ts
465
src/make.ts
|
@ -201,12 +201,16 @@ export function blockedByOp(
|
|||
|
||||
async function saveAll(): Promise<boolean> {
|
||||
if (configuration.getSaveBeforeBuildOrConfigure()) {
|
||||
logger.message("Saving opened files before build.");
|
||||
logger.message(
|
||||
localize("saving.opened.files", "Saving opened files before build.")
|
||||
);
|
||||
let saveSuccess: boolean = await vscode.workspace.saveAll();
|
||||
if (saveSuccess) {
|
||||
return true;
|
||||
} else {
|
||||
logger.message("Saving opened files failed.");
|
||||
logger.message(
|
||||
localize("saved.opened.files.failed", "Saving opened files failed.")
|
||||
);
|
||||
let yesButton: string = localize("yes", "Yes");
|
||||
let noButton: string = localize("no", "No");
|
||||
const chosen: vscode.MessageItem | undefined =
|
||||
|
@ -241,9 +245,13 @@ export function prepareBuildTarget(target: string): string[] {
|
|||
makeArgs = makeArgs.concat(configuration.getConfigurationMakeArgs());
|
||||
|
||||
logger.message(
|
||||
`Building target "${target}" with command: '${configuration.getConfigurationMakeCommand()} ${makeArgs.join(
|
||||
" "
|
||||
)}'`
|
||||
localize(
|
||||
"building.target.with.command",
|
||||
"Building target \"{0}\" with command: '{1} {2}'",
|
||||
target,
|
||||
configuration.getConfigurationMakeCommand(),
|
||||
makeArgs.join(" ")
|
||||
)
|
||||
);
|
||||
return makeArgs;
|
||||
}
|
||||
|
@ -294,12 +302,20 @@ export async function buildTarget(
|
|||
let configureElapsedTime: number | undefined; // used for telemetry
|
||||
if (extension.getState().configureDirty) {
|
||||
logger.message(
|
||||
"The project needs to configure in order to build properly the current target."
|
||||
localize(
|
||||
"project.needs.configure.for.build",
|
||||
"The project needs to configure in order to build properly the current target."
|
||||
)
|
||||
);
|
||||
if (configuration.getConfigureAfterCommand()) {
|
||||
configureExitCode = await configure(TriggeredBy.configureBeforeBuild);
|
||||
if (configureExitCode !== ConfigureBuildReturnCodeTypes.success) {
|
||||
logger.message("Attempting to run build after a failed configure.");
|
||||
logger.message(
|
||||
localize(
|
||||
"running.build.after.configure.fail",
|
||||
"Attempting to run build after a failed configure."
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
configureElapsedTime = util.elapsedTimeSince(buildStartTime);
|
||||
|
@ -340,7 +356,12 @@ export async function buildTarget(
|
|||
increment: 1,
|
||||
message: localize("make.build.cancelling", "Cancelling..."),
|
||||
});
|
||||
logger.message("The user is cancelling the build...");
|
||||
logger.message(
|
||||
localize(
|
||||
"user.cancelling.build",
|
||||
"The user is cancelling the build..."
|
||||
)
|
||||
);
|
||||
cancelBuild = true;
|
||||
|
||||
// Kill the task that is used for building.
|
||||
|
@ -352,7 +373,13 @@ export async function buildTarget(
|
|||
}
|
||||
});
|
||||
|
||||
logger.message(`Killing task "${makefileBuildTaskName}".`);
|
||||
logger.message(
|
||||
localize(
|
||||
"killing.task",
|
||||
'Killing task "{0}".',
|
||||
makefileBuildTaskName
|
||||
)
|
||||
);
|
||||
myTask?.terminate();
|
||||
});
|
||||
|
||||
|
@ -435,7 +462,12 @@ export async function doBuildTarget(
|
|||
const cwd: string = configuration.makeBaseDirectory();
|
||||
if (!util.checkDirectoryExistsSync(cwd)) {
|
||||
logger.message(
|
||||
`Target "${target}" failed to build because CWD passed in does not exist (${cwd}).`
|
||||
localize(
|
||||
"target.failed.because.cwd.not.exists",
|
||||
'Target "{0}" failed to build because CWD passed in does not exist ({1}).',
|
||||
target,
|
||||
cwd
|
||||
)
|
||||
);
|
||||
return ConfigureBuildReturnCodeTypes.notFound;
|
||||
}
|
||||
|
@ -463,11 +495,14 @@ export async function doBuildTarget(
|
|||
myTask.presentationOptions.showReuseMessage = true;
|
||||
|
||||
logger.message(
|
||||
`Executing task: "${
|
||||
myTask.name
|
||||
}" with quoting style "${quotingStyleName}"\n command name: ${
|
||||
myTaskCommand.value
|
||||
}\n command args ${makeArgs.join()}`,
|
||||
localize(
|
||||
"executing.task.quoting.style",
|
||||
'Executing task: "{0}" with quoting style "{1}"\n command name: {2}\n command args {3}',
|
||||
myTask.name,
|
||||
quotingStyleName,
|
||||
myTaskCommand.value,
|
||||
makeArgs.join()
|
||||
),
|
||||
"Debug"
|
||||
);
|
||||
await vscode.tasks.executeTask(myTask);
|
||||
|
@ -484,9 +519,21 @@ export async function doBuildTarget(
|
|||
});
|
||||
|
||||
if (result !== ConfigureBuildReturnCodeTypes.success) {
|
||||
logger.message(`Target "${target}" failed to build.`);
|
||||
logger.message(
|
||||
localize(
|
||||
"target.failed.to.build",
|
||||
'Target "{0}" failed to build.',
|
||||
target
|
||||
)
|
||||
);
|
||||
} else {
|
||||
logger.message(`Target "${target}" built successfully.`);
|
||||
logger.message(
|
||||
localize(
|
||||
"target.build.successfully",
|
||||
'Target "{0}" built successfully.',
|
||||
target
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -609,7 +656,12 @@ export async function generateParseContent(
|
|||
makeArgs.push("--no-builtin-variables");
|
||||
makeArgs.push("--no-builtin-rules");
|
||||
makeArgs.push("--question");
|
||||
logger.messageNoCR("Generating targets information with command: ");
|
||||
logger.messageNoCR(
|
||||
localize(
|
||||
"generating.targets.with.command",
|
||||
"Generating targets information with command: "
|
||||
)
|
||||
);
|
||||
} else {
|
||||
makeArgs.push("--dry-run");
|
||||
|
||||
|
@ -626,9 +678,11 @@ export async function generateParseContent(
|
|||
});
|
||||
|
||||
logger.messageNoCR(
|
||||
`Generating ${
|
||||
localize(
|
||||
"generating.configurating.cache",
|
||||
"Generating {0}configuration cache with command: ",
|
||||
getConfigureIsInBackground() ? "in the background a new " : ""
|
||||
}configuration cache with command: `
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -644,7 +698,13 @@ export async function generateParseContent(
|
|||
dryrunFile = path.join(extensionOutputFolder, dryrunFile);
|
||||
}
|
||||
dryrunFile = util.resolvePathToRoot(dryrunFile);
|
||||
logger.message(`Writing the dry-run output: ${dryrunFile}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"writing.dry.run.output",
|
||||
"Writing the dry-run output: {0}",
|
||||
dryrunFile
|
||||
)
|
||||
);
|
||||
|
||||
const lineEnding: string =
|
||||
process.platform === "win32" && process.env.MSYSTEM === undefined
|
||||
|
@ -704,10 +764,18 @@ export async function generateParseContent(
|
|||
"Dryrun timeout. See Makefile Tools Output Channel for details."
|
||||
);
|
||||
logger.message(
|
||||
"Dryrun timeout. Verify that the make command works properly " +
|
||||
"in your development terminal (it could wait for stdin)."
|
||||
localize(
|
||||
"dryrun.timeout.verify",
|
||||
"Dryrun timeout. Verify that the make command works properly in your development terminal (it could wait for stdin)."
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
localize(
|
||||
"double.check.dryrun",
|
||||
"Double check the dryrun output log: {0}",
|
||||
dryrunFile
|
||||
)
|
||||
);
|
||||
logger.message(`Double check the dryrun output log: ${dryrunFile}`);
|
||||
|
||||
// It's enough to show this warning popup once.
|
||||
clearInterval(timeout);
|
||||
|
@ -726,7 +794,13 @@ export async function generateParseContent(
|
|||
);
|
||||
clearInterval(timeout);
|
||||
let elapsedTime: number = util.elapsedTimeSince(startTime);
|
||||
logger.message(`Generating dry-run elapsed time: ${elapsedTime}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"generating.dry.run.elapsed",
|
||||
"Generating dry-run elapsed time: {0}",
|
||||
elapsedTime
|
||||
)
|
||||
);
|
||||
|
||||
parseFile = dryrunFile;
|
||||
parseContent = completeOutput;
|
||||
|
@ -739,8 +813,15 @@ export async function generateParseContent(
|
|||
result.returnCode !== ConfigureBuildReturnCodeTypes.success &&
|
||||
!forTargets
|
||||
) {
|
||||
logger.message("The make dry-run command failed.");
|
||||
logger.message("IntelliSense may work only partially or not at all.");
|
||||
logger.message(
|
||||
localize("make.dry.run.failed", "The make dry-run command failed.")
|
||||
);
|
||||
logger.message(
|
||||
localize(
|
||||
"intellisense.may.not.work",
|
||||
"IntelliSense may work only partially or not at all."
|
||||
)
|
||||
);
|
||||
logger.message(stderrStr);
|
||||
|
||||
// Report the standard dry-run error & guide only when the configure was not cancelled
|
||||
|
@ -776,7 +857,12 @@ export async function prePostConfigureHelper(
|
|||
// The check is needed also here in addition to disabling all UI and actions because,
|
||||
// depending on settings, this can run automatically at project load.
|
||||
if (!vscode.workspace.isTrusted) {
|
||||
logger.message("No script can run in an untrusted workspace.");
|
||||
logger.message(
|
||||
localize(
|
||||
"no.script.can.run.untrusted",
|
||||
"No script can run in an untrusted workspace."
|
||||
)
|
||||
);
|
||||
return ConfigureBuildReturnCodeTypes.untrusted;
|
||||
}
|
||||
|
||||
|
@ -812,7 +898,11 @@ export async function prePostConfigureHelper(
|
|||
cancelConfigureScript = true;
|
||||
|
||||
logger.message(
|
||||
`Attempting to kill the console process (PID = ${curPID}) and all its children subprocesses...`
|
||||
localize(
|
||||
"attempting.to.kill.console.process",
|
||||
"Attempting to kill the console process (PID = {0}) and all its children subprocesses...",
|
||||
curPID
|
||||
)
|
||||
);
|
||||
|
||||
await vscode.window.withProgress(
|
||||
|
@ -865,8 +955,10 @@ export async function preConfigure(triggeredBy: TriggeredBy): Promise<number> {
|
|||
)
|
||||
);
|
||||
logger.message(
|
||||
"No pre-configure script is set in settings. " +
|
||||
"Make sure a pre-configuration script path is defined with makefile.preConfigureScript."
|
||||
localize(
|
||||
"no.pre.configure.script.define.settings",
|
||||
"No pre-configure script is set in settings. Make sure a pre-configuration script path is defined with makefile.preConfigureScript."
|
||||
)
|
||||
);
|
||||
return ConfigureBuildReturnCodeTypes.notFound;
|
||||
}
|
||||
|
@ -874,7 +966,11 @@ export async function preConfigure(triggeredBy: TriggeredBy): Promise<number> {
|
|||
if (!util.checkFileExistsSync(scriptFile)) {
|
||||
vscode.window.showErrorMessage("Could not find pre-configure script.");
|
||||
logger.message(
|
||||
`Could not find the given pre-configure script "${scriptFile}" on disk. `
|
||||
localize(
|
||||
"could.not.find.pre.configure.on.disk",
|
||||
'Could not find the given pre-configure script "{0}" on disk.',
|
||||
scriptFile
|
||||
)
|
||||
);
|
||||
return ConfigureBuildReturnCodeTypes.notFound;
|
||||
}
|
||||
|
@ -914,23 +1010,25 @@ export async function preConfigure(triggeredBy: TriggeredBy): Promise<number> {
|
|||
export async function postConfigure(triggeredBy: TriggeredBy): Promise<number> {
|
||||
let scriptFile: string | undefined = configuration.getPostConfigureScript();
|
||||
if (!scriptFile) {
|
||||
vscode.window.showErrorMessage(
|
||||
localize(
|
||||
"no.postconfigure.script.provided",
|
||||
"Post-configure failed: no script provided."
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
"No post-configure script is set in settings. " +
|
||||
"Make sure a post-configuration script path is defined with makefile.postConfigureScript."
|
||||
const error = localize(
|
||||
"no.postconfigure.script.provided",
|
||||
"Post-configure failed: no script provided."
|
||||
);
|
||||
vscode.window.showErrorMessage(error);
|
||||
logger.message(error);
|
||||
return ConfigureBuildReturnCodeTypes.notFound;
|
||||
}
|
||||
|
||||
if (!util.checkFileExistsSync(scriptFile)) {
|
||||
vscode.window.showErrorMessage("Could not find post-configure script.");
|
||||
vscode.window.showErrorMessage(
|
||||
localize("could.not.find.error", "Could not find post-configure script.")
|
||||
);
|
||||
logger.message(
|
||||
`Could not find the given post-configure script "${scriptFile}" on disk. `
|
||||
localize(
|
||||
"could.not.find.post.configure.on.disk",
|
||||
'Could not find the given post-configure script "{0}" on disk.',
|
||||
scriptFile
|
||||
)
|
||||
);
|
||||
return ConfigureBuildReturnCodeTypes.notFound;
|
||||
}
|
||||
|
@ -1091,7 +1189,11 @@ export async function runPreConfigureScript(
|
|||
scriptFile: string
|
||||
): Promise<number> {
|
||||
logger.message(
|
||||
`Pre-configuring...\nScript: "${configuration.getPreConfigureScript()}"`
|
||||
localize(
|
||||
"pre.configuring.script",
|
||||
'Pre-configuring...\nScript: "{0}"',
|
||||
configuration.getPreConfigureScript()
|
||||
)
|
||||
);
|
||||
|
||||
const currentConfigPreConfigureArgs =
|
||||
|
@ -1119,7 +1221,11 @@ export async function runPostConfigureScript(
|
|||
scriptFile: string
|
||||
): Promise<number> {
|
||||
logger.message(
|
||||
`Post-configuring...\nScript: "${configuration.getPostConfigureScript()}"`
|
||||
localize(
|
||||
"post.configure.script",
|
||||
'Post-configuring... \nScript: "{0}"',
|
||||
configuration.getPostConfigureScript()
|
||||
)
|
||||
);
|
||||
|
||||
const currentConfigPostConfigureArgs =
|
||||
|
@ -1301,7 +1407,12 @@ export async function configure(
|
|||
// The check is needed also here in addition to disabling all UI and actions because,
|
||||
// depending on settings, this can run automatically at project load.
|
||||
if (!vscode.workspace.isTrusted) {
|
||||
logger.message("Cannot configure a project in an untrusted workspace.");
|
||||
logger.message(
|
||||
localize(
|
||||
"cannot.configure.project.untrusted",
|
||||
"Cannot configure a project in an untrusted workspace."
|
||||
)
|
||||
);
|
||||
return ConfigureBuildReturnCodeTypes.untrusted;
|
||||
}
|
||||
|
||||
|
@ -1314,7 +1425,10 @@ export async function configure(
|
|||
preConfigureExitCode = await preConfigure(TriggeredBy.alwaysPreconfigure);
|
||||
if (preConfigureExitCode !== ConfigureBuildReturnCodeTypes.success) {
|
||||
logger.message(
|
||||
"Attempting to run configure after a failed pre-configure."
|
||||
localize(
|
||||
"attempting.configure.after.failed.preconfigure",
|
||||
"Attempting to run configure after a failed pre-configure."
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1374,7 +1488,11 @@ export async function configure(
|
|||
cancel.onCancellationRequested(async () => {
|
||||
if (curPID !== -1) {
|
||||
logger.message(
|
||||
`Attempting to kill the make process (PID = ${curPID}) and all its children subprocesses...`
|
||||
localize(
|
||||
"attempting.to.kill.process.and.children",
|
||||
"Attempting to kill the make process (PID = ${curPID}) and all its children subprocesses...",
|
||||
curPID
|
||||
)
|
||||
);
|
||||
await vscode.window.withProgress(
|
||||
{
|
||||
|
@ -1393,10 +1511,18 @@ export async function configure(
|
|||
// The configure process may run make twice (or three times if the build target is reset),
|
||||
// with parsing in between and after. There is also the CppTools IntelliSense custom provider update
|
||||
// awaiting at various points. It is possible that the cancellation may happen when there is no make running.
|
||||
logger.message("curPID is 0, we are in between make invocations.");
|
||||
logger.message(
|
||||
"curPID is 0, we are in between make invocations.",
|
||||
"Debug"
|
||||
);
|
||||
}
|
||||
|
||||
logger.message("Exiting early from the configure process.");
|
||||
logger.message(
|
||||
localize(
|
||||
"exiting.configure.early",
|
||||
"Exiting early from the configure process."
|
||||
)
|
||||
);
|
||||
|
||||
// We want a successful configure as soon as possible.
|
||||
// The dirty state can help with that by triggering a new configure
|
||||
|
@ -1424,15 +1550,19 @@ export async function configure(
|
|||
}
|
||||
|
||||
if (retc === ConfigureBuildReturnCodeTypes.success) {
|
||||
logger.message("Configure succeeded.");
|
||||
logger.message(localize("configure.succeeded", "Configure succeeded."));
|
||||
} else {
|
||||
logger.message("Configure failed.");
|
||||
logger.message(localize("configure.failed", "Configure failed."));
|
||||
}
|
||||
|
||||
return retc;
|
||||
} catch (e) {
|
||||
logger.message(
|
||||
`Exception thrown during the configure process: ${e.message}`
|
||||
localize(
|
||||
"exception.thrown.during.configure",
|
||||
"Exception thrown during the configure process: {0}",
|
||||
e.message
|
||||
)
|
||||
);
|
||||
retc = ConfigureBuildReturnCodeTypes.other;
|
||||
return e.errno;
|
||||
|
@ -1517,10 +1647,22 @@ export async function configure(
|
|||
}
|
||||
if (preConfigureElapsedTime !== undefined) {
|
||||
telemetryMeasures.preConfigureElapsedTime = preConfigureElapsedTime;
|
||||
logger.message(`Preconfigure elapsed time: ${preConfigureElapsedTime}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"preconfigure.elapsed.time",
|
||||
"Preconfigure elapsed time: {0}",
|
||||
preConfigureElapsedTime
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
logger.message(`Configure elapsed time: ${configureElapsedTime}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"configure.elapsed.time",
|
||||
"Configure elapsed time: {0}",
|
||||
configureElapsedTime
|
||||
)
|
||||
);
|
||||
|
||||
setIsConfiguring(false);
|
||||
setConfigureIsClean(false);
|
||||
|
@ -1544,7 +1686,9 @@ export async function configure(
|
|||
TriggeredBy.alwaysPostConfigure
|
||||
);
|
||||
if (postConfigureExitCode !== ConfigureBuildReturnCodeTypes.success) {
|
||||
logger.message("Post-configure failed.");
|
||||
logger.message(
|
||||
localize("post.configure.failed", "Post-configure failed.")
|
||||
);
|
||||
}
|
||||
|
||||
postConfigureElapsedTime = util.elapsedTimeSince(
|
||||
|
@ -1559,7 +1703,13 @@ export async function configure(
|
|||
}
|
||||
if (postConfigureElapsedTime !== undefined) {
|
||||
telemetryMeasures.postConfigureElapsedTime = postConfigureElapsedTime;
|
||||
logger.message(`Postconfigure elapsed time: ${postConfigureElapsedTime}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"post.configure.elapsed.time",
|
||||
"Postconfigure elapsed time: {0}",
|
||||
postConfigureElapsedTime
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
telemetryProperties.buildTarget = processTargetForTelemetry(newBuildTarget);
|
||||
|
@ -1615,11 +1765,15 @@ async function parseLaunchConfigurations(
|
|||
});
|
||||
|
||||
if (launchConfigurationsStr.length === 0) {
|
||||
logger.message(
|
||||
`No${getConfigureIsClean() ? "" : " new"}${
|
||||
getConfigureIsClean() ? "" : " new"
|
||||
} launch configurations have been detected.`
|
||||
const notCleanMessage = localize(
|
||||
"no.new.launch.configurations",
|
||||
"No new launch configurations have been detected."
|
||||
);
|
||||
const cleanMessage = localize(
|
||||
"no.launch.configurations",
|
||||
"No launch configurations have been detected."
|
||||
);
|
||||
logger.message(getConfigureIsClean() ? cleanMessage : notCleanMessage);
|
||||
} else {
|
||||
// Sort and remove duplicates that can be created in the following scenarios:
|
||||
// - the same target binary invoked several times with the same arguments and from the same path
|
||||
|
@ -1632,12 +1786,22 @@ async function parseLaunchConfigurations(
|
|||
launchConfigurationsStr
|
||||
);
|
||||
|
||||
const cleanLaunchTargetsString = localize(
|
||||
"found.launch.targets.new",
|
||||
"Found the following {0} new launch targets defined in the makefile: {1}",
|
||||
launchConfigurationsStr.length,
|
||||
launchConfigurationsStr.join(";")
|
||||
);
|
||||
const notCleanLaunchTargetsString = localize(
|
||||
"found.launch.targets.old",
|
||||
"Found the following {0} launch targets defined in the makefile: {1}",
|
||||
launchConfigurationsStr.length,
|
||||
launchConfigurationsStr.join(";")
|
||||
);
|
||||
logger.message(
|
||||
`Found the following ${launchConfigurationsStr.length}${
|
||||
getConfigureIsClean() ? "" : " new"
|
||||
} launch targets defined in the makefile: ${launchConfigurationsStr.join(
|
||||
";"
|
||||
)}`
|
||||
getConfigureIsClean()
|
||||
? notCleanLaunchTargetsString
|
||||
: cleanLaunchTargetsString
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1657,9 +1821,11 @@ async function parseLaunchConfigurations(
|
|||
}
|
||||
|
||||
logger.message(
|
||||
`Complete list of launch targets: ${configuration
|
||||
.getLaunchTargets()
|
||||
.join(";")}`
|
||||
localize(
|
||||
"complete.list.of.launch.targets",
|
||||
"Complete list of launch targets: {0}",
|
||||
configuration.getLaunchTargets().join(";")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1704,17 +1870,35 @@ async function parseTargets(
|
|||
);
|
||||
if (retc === ConfigureBuildReturnCodeTypes.success) {
|
||||
if (targets.length === 0) {
|
||||
const cleanBuildTargets = localize(
|
||||
"clean.build.targets",
|
||||
"No build targets have been detected."
|
||||
);
|
||||
const notCleanBuildTargets = localize(
|
||||
"new.build.targets",
|
||||
"No new build targets have been detected."
|
||||
);
|
||||
logger.message(
|
||||
`No${
|
||||
getConfigureIsClean() ? "" : " new"
|
||||
} build targets have been detected.`
|
||||
getConfigureIsClean() ? cleanBuildTargets : notCleanBuildTargets
|
||||
);
|
||||
} else {
|
||||
targets = targets.sort();
|
||||
const cleanBuildTargetsDefinedInMakefile = localize(
|
||||
"clean.build.targets.clean",
|
||||
"Found the following {0} build targets defined in the makefile: {1}",
|
||||
targets.length,
|
||||
targets.join(";")
|
||||
);
|
||||
const notCleanBuildTargetsDefinedInMakefile = localize(
|
||||
"new.build.targets.clean",
|
||||
"Found the following {0} new build targets defined in the makefile: {1}",
|
||||
targets.length,
|
||||
targets.join(";")
|
||||
);
|
||||
logger.message(
|
||||
`Found the following ${targets.length}${
|
||||
getConfigureIsClean() ? "" : " new"
|
||||
} build targets defined in the makefile: ${targets.join(";")}`
|
||||
getConfigureIsClean()
|
||||
? cleanBuildTargetsDefinedInMakefile
|
||||
: notCleanBuildTargetsDefinedInMakefile
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1734,9 +1918,11 @@ async function parseTargets(
|
|||
}
|
||||
|
||||
logger.message(
|
||||
`Complete list of build targets: ${configuration
|
||||
.getBuildTargets()
|
||||
.join(";")}`
|
||||
localize(
|
||||
"list.build.targets.complete",
|
||||
"Complete list of build targets: {0}",
|
||||
configuration.getBuildTargets().join(";")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1760,11 +1946,15 @@ async function updateProvider(
|
|||
}
|
||||
|
||||
let startTime: number = Date.now();
|
||||
logger.message(
|
||||
`Updating the CppTools IntelliSense Configuration Provider.${
|
||||
recursive ? "(recursive)" : ""
|
||||
}`
|
||||
const recursiveString = localize(
|
||||
"updating.cpptools.configuration.provider.recursive",
|
||||
"Updating the CppTools IntelliSense Configuration Provider. (recursive)"
|
||||
);
|
||||
const nonRecursiveString = localize(
|
||||
"updating.cpptools.configuration.provider",
|
||||
"Updating the CppTools IntelliSense Configuration Provider."
|
||||
);
|
||||
logger.message(recursive ? recursiveString : nonRecursiveString);
|
||||
|
||||
let onStatus: any = (status: string): void => {
|
||||
progress.report({
|
||||
|
@ -1868,7 +2058,13 @@ export async function loadConfigurationFromCache(
|
|||
increment: 1,
|
||||
message: localize("make.configure.cache", "Configuring from cache"),
|
||||
});
|
||||
logger.message(`Configuring from cache: ${cachePath}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"configuring.from.cache",
|
||||
"Configuring from cache: {0}",
|
||||
cachePath
|
||||
)
|
||||
);
|
||||
let configurationCache: ConfigurationCache = {
|
||||
buildTargets: [],
|
||||
launchTargets: [],
|
||||
|
@ -1914,16 +2110,28 @@ export async function loadConfigurationFromCache(
|
|||
});
|
||||
} catch (e) {
|
||||
logger.message(
|
||||
"An error occured while parsing the configuration cache."
|
||||
localize(
|
||||
"error.occured.while.parsing.configuration",
|
||||
"An error occured while parsing the configuration cache."
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
localize(
|
||||
"running.clean.configure.instead",
|
||||
"Running clean configure instead."
|
||||
)
|
||||
);
|
||||
logger.message("Running clean configure instead.");
|
||||
setConfigureIsInBackground(false);
|
||||
setConfigureIsClean(true);
|
||||
}
|
||||
|
||||
elapsedTime = util.elapsedTimeSince(startTime);
|
||||
logger.message(
|
||||
`Load configuration from cache elapsed time: ${elapsedTime}`
|
||||
localize(
|
||||
"load.configuration.from.cache.elapsed",
|
||||
"Load configuration from cache elapsed time: {0}",
|
||||
elapsedTime
|
||||
)
|
||||
);
|
||||
|
||||
// Log all the files read from cache after elapsed time is calculated.
|
||||
|
@ -1999,7 +2207,10 @@ export async function doConfigure(
|
|||
}
|
||||
} else {
|
||||
logger.message(
|
||||
"Loading configurations from cache is not necessary.",
|
||||
localize(
|
||||
"loading.configurations.from.cache.not.necessary",
|
||||
"Loading configurations from cache is not necessary."
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
}
|
||||
|
@ -2020,7 +2231,9 @@ export async function doConfigure(
|
|||
}
|
||||
|
||||
// Some initial preprocessing required before any parsing is done.
|
||||
logger.message(`Preprocessing: "${parseFile}"`);
|
||||
logger.message(
|
||||
localize("preprocessing.parse.file", 'Preprocessing: "{0}"', parseFile)
|
||||
);
|
||||
let preprocessedDryrunOutput: string;
|
||||
let preprocessedDryrunOutputResult: parser.PreprocessDryRunOutputReturnType =
|
||||
await preprocessDryRun(
|
||||
|
@ -2039,13 +2252,19 @@ export async function doConfigure(
|
|||
return subphaseStats;
|
||||
}
|
||||
logger.message(
|
||||
`Preprocess elapsed time: ${subphaseStats.preprocessParseContent.elapsed}`
|
||||
localize(
|
||||
"preprocess.elapsed.time",
|
||||
"Preprocess elapsed time: {0}",
|
||||
subphaseStats.preprocessParseContent.elapsed
|
||||
)
|
||||
);
|
||||
|
||||
// Configure IntelliSense
|
||||
// Don't override retc1, since make invocations may fail with errors different than cancel
|
||||
// and we still complete the configure process.
|
||||
logger.message("Parsing for IntelliSense.");
|
||||
logger.message(
|
||||
localize("parsing.for.intellisense", "Parsing for IntelliSense.")
|
||||
);
|
||||
subphaseStats.parseIntelliSense = await updateProvider(
|
||||
progress,
|
||||
cancel,
|
||||
|
@ -2059,12 +2278,18 @@ export async function doConfigure(
|
|||
return subphaseStats;
|
||||
}
|
||||
logger.message(
|
||||
`Parsing for IntelliSense elapsed time: ${subphaseStats.parseIntelliSense.elapsed}`
|
||||
localize(
|
||||
"parsing.for.intellisense.elapsed",
|
||||
"Parsing for IntelliSense elapsed time: {0}",
|
||||
subphaseStats.parseIntelliSense.elapsed
|
||||
)
|
||||
);
|
||||
|
||||
// Configure launch targets as parsed from the makefile
|
||||
// (and not as read from settings via makefile.launchConfigurations).
|
||||
logger.message(`Parsing for launch targets.`);
|
||||
logger.message(
|
||||
localize("parsing.for.launch.targets", "Parsing for launch targets.")
|
||||
);
|
||||
subphaseStats.parseLaunch = await parseLaunchConfigurations(
|
||||
progress,
|
||||
cancel,
|
||||
|
@ -2077,7 +2302,11 @@ export async function doConfigure(
|
|||
return subphaseStats;
|
||||
}
|
||||
logger.message(
|
||||
`Parsing for launch targets elapsed time: ${subphaseStats.parseLaunch.elapsed}`
|
||||
localize(
|
||||
"parsing.for.launch.targets.elapsed",
|
||||
"Parsing for launch targets elapsed time: {0}",
|
||||
subphaseStats.parseLaunch.elapsed
|
||||
)
|
||||
);
|
||||
|
||||
// Verify if the current launch configuration is still part of the list and unset otherwise.
|
||||
|
@ -2097,7 +2326,11 @@ export async function doConfigure(
|
|||
.includes(currentLaunchConfiguration)
|
||||
) {
|
||||
logger.message(
|
||||
`Current launch configuration ${currentLaunchConfigurationStr} is no longer present in the available list.`
|
||||
localize(
|
||||
"current.launch.configuration.no.longer.present",
|
||||
"Current launch configuration {0} is no longer present in the available list.",
|
||||
currentLaunchConfigurationStr
|
||||
)
|
||||
);
|
||||
await configuration.setLaunchConfigurationByName("");
|
||||
}
|
||||
|
@ -2112,7 +2345,12 @@ export async function doConfigure(
|
|||
buildTargets.length === 0 ||
|
||||
(buildTargets.length === 1 && buildTargets[0] === "all")
|
||||
) {
|
||||
logger.message("Generating parse content for build targets.");
|
||||
logger.message(
|
||||
localize(
|
||||
"generating.parse.content.build.targets",
|
||||
"Generating parse content for build targets."
|
||||
)
|
||||
);
|
||||
subphaseStats.dryrunTargets = await generateParseContent(
|
||||
progress,
|
||||
cancel,
|
||||
|
@ -2126,7 +2364,13 @@ export async function doConfigure(
|
|||
return subphaseStats;
|
||||
}
|
||||
|
||||
logger.message(`Parsing for build targets from: "${parseFile}"`);
|
||||
logger.message(
|
||||
localize(
|
||||
"parsing.build.targets.from.parse.file",
|
||||
'Parsing for build targets from: "{0}"',
|
||||
parseFile
|
||||
)
|
||||
);
|
||||
subphaseStats.parseTargets = await parseTargets(
|
||||
progress,
|
||||
cancel,
|
||||
|
@ -2140,7 +2384,11 @@ export async function doConfigure(
|
|||
return subphaseStats;
|
||||
}
|
||||
logger.message(
|
||||
`Parsing build targets elapsed time: ${subphaseStats.parseTargets.elapsed}`
|
||||
localize(
|
||||
"parsing.build.targets.elapsed.time",
|
||||
"Parsing build targets elapsed time: {0}",
|
||||
subphaseStats.parseTargets.elapsed
|
||||
)
|
||||
);
|
||||
|
||||
// Verify if the current build target is still part of the list and unset otherwise.
|
||||
|
@ -2155,8 +2403,11 @@ export async function doConfigure(
|
|||
!buildTargets.includes(currentBuildTarget)
|
||||
) {
|
||||
logger.message(
|
||||
`Current build target ${currentBuildTarget} is no longer present in the available list.` +
|
||||
` Unsetting the current build target.`
|
||||
localize(
|
||||
"current.build.target.no.longer.present",
|
||||
"Current build target {0} is no longer present in the available list. Unsetting the current build target.",
|
||||
currentBuildTarget
|
||||
)
|
||||
);
|
||||
|
||||
// Setting a new target by name is not triggering a configure
|
||||
|
@ -2176,7 +2427,10 @@ export async function doConfigure(
|
|||
// it is impossible to get into the state of having a target that is not found in the available list.
|
||||
await configuration.setTargetByName("");
|
||||
logger.message(
|
||||
"Automatically reconfiguring the project after a build target change."
|
||||
localize(
|
||||
"automatically.reconfiguring.project.after.build.target.change",
|
||||
"Automatically reconfiguring the project after a build target change."
|
||||
)
|
||||
);
|
||||
recursiveDoConfigure = true;
|
||||
|
||||
|
@ -2195,14 +2449,19 @@ export async function doConfigure(
|
|||
// Let the caller collect and log all information regarding the subphases return codes.
|
||||
if (!recursiveDoConfigure) {
|
||||
logger.message(
|
||||
"Configure finished. The status for all the subphases that ran:"
|
||||
localize(
|
||||
"configure.finished.subphases",
|
||||
"Configure finished. The status for all the subphases that ran:"
|
||||
)
|
||||
);
|
||||
let subphases: ConfigureSubphaseStatusItem[] =
|
||||
getRelevantConfigStats(subphaseStats);
|
||||
subphases.forEach((subphase) => {
|
||||
const returnCode = localize("return.code", "return code");
|
||||
const elapsedTime = localize("elapsed.time", "elapsed time");
|
||||
logger.message(
|
||||
`${subphase.name}: return code = ${subphase.status.retc}, ` +
|
||||
`elapsed time = ${subphase.status.elapsed}`
|
||||
`${subphase.name}: ${returnCode} = ${subphase.status.retc}, ` +
|
||||
`${elapsedTime} = ${subphase.status.elapsed}`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
207
src/parser.ts
207
src/parser.ts
|
@ -15,6 +15,13 @@ import * as path from "path";
|
|||
import * as util from "./util";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
import * as nls from "vscode-nls";
|
||||
nls.config({
|
||||
messageFormat: nls.MessageFormat.bundle,
|
||||
bundleFormat: nls.BundleFormat.standalone,
|
||||
})();
|
||||
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
|
||||
|
||||
// List of compiler tools plus the most common aliases cc and c++
|
||||
// ++ needs to be escaped for the regular expression in parseLineAsTool.
|
||||
// Versioning and cross compilers naming variations dont' need to be included in this list,
|
||||
|
@ -574,8 +581,13 @@ async function parseAnySwitchFromToolArguments(
|
|||
|
||||
let stderr: any = (result: string): void => {
|
||||
logger.message(
|
||||
`Error while running the compiler args parser script '${parseCompilerArgsScriptFile}' ` +
|
||||
`for regions ("${compilerArgRegions})": "${result}"`,
|
||||
localize(
|
||||
"error.running.args.parser.script",
|
||||
"Error running the compiler args parser script {0} for regions ({1}): {2}",
|
||||
parseCompilerArgsScriptFile,
|
||||
compilerArgRegions,
|
||||
result
|
||||
),
|
||||
"Normal"
|
||||
);
|
||||
};
|
||||
|
@ -592,7 +604,12 @@ async function parseAnySwitchFromToolArguments(
|
|||
);
|
||||
if (result.returnCode !== 0) {
|
||||
logger.message(
|
||||
`The compiler args parser script '${parseCompilerArgsScriptFile}' failed with error code ${result.returnCode} for regions (${compilerArgRegions})`,
|
||||
localize(
|
||||
"compiler.args.parser.failed",
|
||||
"The compiler args parser script '{0}' failed with error code {1} for regions ({2})",
|
||||
parseCompilerArgsScriptFile,
|
||||
compilerArgRegions
|
||||
),
|
||||
"Normal"
|
||||
);
|
||||
}
|
||||
|
@ -925,7 +942,11 @@ function parseFilesFromToolArguments(args: string, exts: string[]): string[] {
|
|||
// Debug message to identify easier the scenarios where source files have inner quotes.
|
||||
if (result.includes('"')) {
|
||||
logger.message(
|
||||
`File argument that contains quotes: \`${result}\``,
|
||||
localize(
|
||||
"file.argument.has.quotes",
|
||||
"File argument that contains quotes: `{0}`",
|
||||
result
|
||||
),
|
||||
"Debug"
|
||||
);
|
||||
}
|
||||
|
@ -954,6 +975,8 @@ async function currentPathAfterCommand(
|
|||
: "";
|
||||
let newCurrentPath: string = "";
|
||||
|
||||
const analyzeLine = localize("analyze.line", "Analyzing line: {0}", line);
|
||||
|
||||
if (line.startsWith("cd -") && !configuration.getIgnoreDirectoryCommands()) {
|
||||
// Swap the last two current paths in the history.
|
||||
if (lastCurrentPath) {
|
||||
|
@ -965,12 +988,14 @@ async function currentPathAfterCommand(
|
|||
? currentPathHistory.pop() || ""
|
||||
: lastCurrentPath;
|
||||
|
||||
logger.message("Analyzing line: " + line, "Verbose");
|
||||
logger.message(analyzeLine, "Verbose");
|
||||
logger.message(
|
||||
"CD- command: leaving directory " +
|
||||
lastCurrentPath +
|
||||
" and entering directory " +
|
||||
lastCurrentPath2,
|
||||
localize(
|
||||
"leaving.directory",
|
||||
"CD- command: leaving directory {0} and entering directory {1}",
|
||||
lastCurrentPath,
|
||||
lastCurrentPath2
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
currentPathHistory.push(lastCurrentPath);
|
||||
|
@ -988,12 +1013,14 @@ async function currentPathAfterCommand(
|
|||
currentPathHistory.length > 0
|
||||
? currentPathHistory[currentPathHistory.length - 1]
|
||||
: "";
|
||||
logger.message("Analyzing line: " + line, "Verbose");
|
||||
logger.message(analyzeLine, "Verbose");
|
||||
logger.message(
|
||||
"POPD command or end of MAKE -C: leaving directory " +
|
||||
lastCurrentPath +
|
||||
" and entering directory " +
|
||||
lastCurrentPath2,
|
||||
localize(
|
||||
"popd.command",
|
||||
"POPD command or end of MAKE -C: leaving directory {0} and entering directory {1}",
|
||||
lastCurrentPath,
|
||||
lastCurrentPath2
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
} else if (
|
||||
|
@ -1012,9 +1039,13 @@ async function currentPathAfterCommand(
|
|||
}
|
||||
|
||||
currentPathHistory.push(newCurrentPath);
|
||||
logger.message("Analyzing line: " + line, "Verbose");
|
||||
logger.message(analyzeLine, "Verbose");
|
||||
logger.message(
|
||||
"CD command: entering directory " + newCurrentPath,
|
||||
localize(
|
||||
"cd.command",
|
||||
"CD command: entering directory {0}",
|
||||
newCurrentPath
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
} else if (
|
||||
|
@ -1023,9 +1054,13 @@ async function currentPathAfterCommand(
|
|||
) {
|
||||
newCurrentPath = await util.makeFullPath(line.slice(6), lastCurrentPath);
|
||||
currentPathHistory.push(newCurrentPath);
|
||||
logger.message("Analyzing line: " + line, "Verbose");
|
||||
logger.message(analyzeLine, "Verbose");
|
||||
logger.message(
|
||||
"PUSHD command: entering directory " + newCurrentPath,
|
||||
localize(
|
||||
"pushd.command",
|
||||
"PUSHD command: entering directory {0}",
|
||||
newCurrentPath
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
} else if (line.includes("Entering directory")) {
|
||||
|
@ -1041,8 +1076,15 @@ async function currentPathAfterCommand(
|
|||
newCurrentPath = "Could not parse directory";
|
||||
}
|
||||
|
||||
logger.message("Analyzing line: " + line, "Verbose");
|
||||
logger.message("MAKE -C: entering directory " + newCurrentPath, "Verbose");
|
||||
logger.message(analyzeLine, "Verbose");
|
||||
logger.message(
|
||||
localize(
|
||||
"make.c.entering",
|
||||
"MAKE -C: entering directory {0}",
|
||||
newCurrentPath
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
currentPathHistory.push(newCurrentPath);
|
||||
}
|
||||
|
||||
|
@ -1091,7 +1133,10 @@ export async function parseCustomConfigProvider(
|
|||
}
|
||||
|
||||
logger.message(
|
||||
"Parsing dry-run output for CppTools Custom Configuration Provider.",
|
||||
localize(
|
||||
"parsing.dryrun.output.cpptools",
|
||||
"Parsing dry-run output for CppTools Custom Configuration Provider."
|
||||
),
|
||||
"Normal"
|
||||
);
|
||||
|
||||
|
@ -1140,7 +1185,14 @@ export async function parseCustomConfigProvider(
|
|||
}
|
||||
|
||||
if (compilerTool) {
|
||||
logger.message("Found compiler command: " + line, "Verbose");
|
||||
logger.message(
|
||||
localize(
|
||||
"found.compiler.command",
|
||||
"Found compiler command: {0}",
|
||||
line
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
|
||||
// Compiler path is either what the makefile provides or found in the PATH environment variable or empty
|
||||
let compilerFullPath: string = compilerTool.fullPath || "";
|
||||
|
@ -1404,7 +1456,14 @@ export async function parseLaunchConfigurations(
|
|||
"EP",
|
||||
])
|
||||
) {
|
||||
logger.message("Found compiler command:\n" + line, "Verbose");
|
||||
logger.message(
|
||||
localize(
|
||||
"found.compiler.command",
|
||||
"Found compiler command:\n{0}",
|
||||
line
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
|
||||
// First read the value of the /Fe switch (for cl.exe)
|
||||
compilerTargetBinary = parseSingleSwitchFromToolArguments(
|
||||
|
@ -1425,15 +1484,21 @@ export async function parseLaunchConfigurations(
|
|||
let parsedObjPath: path.ParsedPath = path.parse(objFile);
|
||||
compilerTargetBinary = parsedObjPath.name + ".exe";
|
||||
logger.message(
|
||||
"The compiler command is not producing a target binary explicitly. Assuming " +
|
||||
compilerTargetBinary +
|
||||
" from the first object passed in with /Fo",
|
||||
localize(
|
||||
"compiler.command.target.binary",
|
||||
"The compiler command is not producing a target binary explicitly. Assuming {0} from the first object passed in with /Fo",
|
||||
compilerTargetBinary
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
logger.message(
|
||||
"Producing target binary with /Fe: " + compilerTargetBinary,
|
||||
localize(
|
||||
"producing.target.binary",
|
||||
"Producing target binary with /Fe: {0}",
|
||||
compilerTargetBinary
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
}
|
||||
|
@ -1453,9 +1518,11 @@ export async function parseLaunchConfigurations(
|
|||
);
|
||||
compilerTargetBinary = parsedSourcePath.name + ".exe";
|
||||
logger.message(
|
||||
"The compiler command is not producing a target binary explicitly. Assuming " +
|
||||
compilerTargetBinary +
|
||||
" from the first source file passed in",
|
||||
localize(
|
||||
"compiler.command.not.producing",
|
||||
"The compiler command is not producing a target binary explicitly. Assuming {0} from the first source file passed in",
|
||||
compilerTargetBinary
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
}
|
||||
|
@ -1503,7 +1570,14 @@ export async function parseLaunchConfigurations(
|
|||
linkerTool.arguments,
|
||||
["out", "o"]
|
||||
);
|
||||
logger.message("Found linker command: " + line, "Verbose");
|
||||
logger.message(
|
||||
localize(
|
||||
"found.linker.command",
|
||||
"Found linker command: {0}",
|
||||
line
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
|
||||
if (!linkerTargetBinary) {
|
||||
// For Microsoft link.exe, the default output binary takes the base name
|
||||
|
@ -1523,9 +1597,11 @@ export async function parseLaunchConfigurations(
|
|||
let targetBinaryFromFirstObjLib: string =
|
||||
parsedPath.name + ".exe";
|
||||
logger.message(
|
||||
"The link command is not producing a target binary explicitly. Assuming " +
|
||||
targetBinaryFromFirstObjLib +
|
||||
" based on first object passed in",
|
||||
localize(
|
||||
"link.not.producing.explicitly",
|
||||
"The link command is not producing a target binary explicitly. Assuming {0} based on first object passed in",
|
||||
targetBinaryFromFirstObjLib
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
linkerTargetBinary = targetBinaryFromFirstObjLib;
|
||||
|
@ -1534,7 +1610,10 @@ export async function parseLaunchConfigurations(
|
|||
// The default output binary from a linking operation is usually a.out on linux/mac,
|
||||
// produced in the same folder where the toolset is run.
|
||||
logger.message(
|
||||
"The link command is not producing a target binary explicitly. Assuming a.out",
|
||||
localize(
|
||||
"assuming.a.out",
|
||||
"The link command is not producing a target binary explicitly. Assuming a.out"
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
linkerTargetBinary = "a.out";
|
||||
|
@ -1556,7 +1635,11 @@ export async function parseLaunchConfigurations(
|
|||
linkerTargetBinary =
|
||||
util.removeSurroundingQuotes(linkerTargetBinary);
|
||||
logger.message(
|
||||
"Producing target binary: " + linkerTargetBinary,
|
||||
localize(
|
||||
"producing.target.binary",
|
||||
"Producing target binary: {0}",
|
||||
linkerTargetBinary
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
linkerTargetBinary = await util.makeFullPath(
|
||||
|
@ -1596,8 +1679,11 @@ export async function parseLaunchConfigurations(
|
|||
};
|
||||
|
||||
logger.message(
|
||||
"Adding launch configuration:\n" +
|
||||
configuration.launchConfigurationToString(launchConfiguration),
|
||||
localize(
|
||||
"adding.launch.configuration",
|
||||
"Adding launch configuration:\n{0}",
|
||||
configuration.launchConfigurationToString(launchConfiguration)
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
onFoundLaunchConfiguration(launchConfiguration);
|
||||
|
@ -1717,7 +1803,14 @@ export async function parseLaunchConfigurations(
|
|||
}
|
||||
|
||||
if (targetBinaryTool) {
|
||||
logger.message("Found binary execution command: " + line, "Verbose");
|
||||
logger.message(
|
||||
localize(
|
||||
"found.binary.execution.command",
|
||||
"Found binary execution command: {0}",
|
||||
line
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
// Include complete launch configuration: binary, execution path and args
|
||||
// are known from parsing the dry-run
|
||||
let splitArgs: string[] = targetBinaryTool.arguments
|
||||
|
@ -1738,8 +1831,11 @@ export async function parseLaunchConfigurations(
|
|||
};
|
||||
|
||||
logger.message(
|
||||
"Adding launch configuration:\n" +
|
||||
configuration.launchConfigurationToString(launchConfiguration),
|
||||
localize(
|
||||
"adding.launch.configuration",
|
||||
"Adding launch configuration:\n{0}",
|
||||
configuration.launchConfigurationToString(launchConfiguration)
|
||||
),
|
||||
"Verbose"
|
||||
);
|
||||
onFoundLaunchConfiguration(launchConfiguration);
|
||||
|
@ -1918,12 +2014,26 @@ export function parseStandard(
|
|||
} else if (language === "cpp") {
|
||||
standard = parseCppStandard(std, canUseGnu, canUseCxx23);
|
||||
if (!standard) {
|
||||
logger.message(`Unknown C++ standard control flag: ${std}`, "Normal");
|
||||
logger.message(
|
||||
localize(
|
||||
"unknown.c++.standard.control",
|
||||
"Unknown C++ standard control flag: {0}",
|
||||
std
|
||||
),
|
||||
"Normal"
|
||||
);
|
||||
}
|
||||
} else if (language === "c") {
|
||||
standard = parseCStandard(std, canUseGnu);
|
||||
if (!standard) {
|
||||
logger.message(`Unknown C standard control flag: ${std}`, "Normal");
|
||||
logger.message(
|
||||
localize(
|
||||
"unknown.c.standard.control",
|
||||
"Unknown C standard control flag: {0}",
|
||||
std
|
||||
),
|
||||
"Normal"
|
||||
);
|
||||
}
|
||||
} else if (language === undefined) {
|
||||
standard = parseCppStandard(std, canUseGnu, canUseCxx23);
|
||||
|
@ -1931,10 +2041,17 @@ export function parseStandard(
|
|||
standard = parseCStandard(std, canUseGnu);
|
||||
}
|
||||
if (!standard) {
|
||||
logger.message(`Unknown standard control flag: ${std}`, "Normal");
|
||||
logger.message(
|
||||
localize(
|
||||
"unknown.standard.control.flag",
|
||||
"Unknown standard control flag: {0}",
|
||||
std
|
||||
),
|
||||
"Normal"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
logger.message("Unknown language", "Normal");
|
||||
logger.message(localize("unknown.language", "Unknown language"), "Normal");
|
||||
}
|
||||
|
||||
return standard;
|
||||
|
|
|
@ -19,9 +19,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -255,9 +255,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}/src/test/fakeSuite/Repros>8cc()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -295,9 +295,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}/src/test/fakeSuite/Repros>8cc()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
|
@ -19,9 +19,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -290,9 +290,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}/src/test/fakeSuite/Repros>bin/foo.o()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -330,9 +330,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}/src/test/fakeSuite/Repros>bin/foo.o()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
|
@ -21,9 +21,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -274,9 +274,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}\src\test\fakeSuite\Repros>bin\InterestingSmallMakefile\ARC H3\Debug\main.exe(str3a,str3b,str3c)" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -345,9 +345,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}\src\test\fakeSuite\Repros>bin\InterestingSmallMakefile\arch1\Debug\main.exe(str3a,str3b,str3c)" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -419,9 +419,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}\src\test\fakeSuite\Repros>bin\InterestingSmallMakefile\arch2\Debug\main.exe()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -462,9 +462,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}\src\test\fakeSuite\Repros>bin\InterestingSmallMakefile\arch2\Debug\main.exe()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -493,9 +493,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}\src\test\fakeSuite\Repros>bin\InterestingSmallMakefile\arch2\Debug\main.exe()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -521,9 +521,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}\src\test\fakeSuite\Repros>bin\InterestingSmallMakefile\arch2\Debug\main.exe()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
|
@ -21,9 +21,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
|
@ -19,9 +19,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
|
@ -21,9 +21,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
|
@ -18,9 +18,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -112,9 +112,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
|
@ -18,9 +18,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -112,9 +112,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
|
@ -19,9 +19,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
No current launch configuration is set in the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -249,9 +249,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}/src/test/fakeSuite/Repros>bin/tvmi()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
@ -289,9 +289,9 @@ Additional compiler names: 'MyOwnFakeCompiler'
|
|||
Found the following configurations defined in makefile.configurations setting: varexp;test-make-f;test-make-C;complex_escaped_quotes;complex_escaped_quotes_winOnly;InterestingSmallMakefile_windows_configDebug;InterestingSmallMakefile_windows_configRelSize;InterestingSmallMakefile_windows_configRelSpeed;8cc_linux;8cc_mingw;Fido_linux;Fido_mingw;tinyvm_linux_pedantic;tinyvm_mingw_pedantic
|
||||
Reading current launch configuration "{REPO:VSCODE-MAKEFILE-TOOLS}/src/test/fakeSuite/Repros>bin/tvmi()" from the workspace state.
|
||||
Default launch configuration: MIMode = undefined,
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
miDebuggerPath = undefined,
|
||||
stopAtEntry = undefined,
|
||||
symbolSearchPath = undefined
|
||||
Configure on open: false
|
||||
Configure on edit: true
|
||||
Configure after command: true
|
||||
|
|
111
src/util.ts
111
src/util.ts
|
@ -237,7 +237,14 @@ export async function killTree(
|
|||
try {
|
||||
await taskKill(pid);
|
||||
} catch (e) {
|
||||
logger.message(`Failed to kill process ${pid}: ${e}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"failed.to.kill.process",
|
||||
"Failed to kill process {0}: {1}",
|
||||
pid,
|
||||
e
|
||||
)
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -264,7 +271,13 @@ export async function killTree(
|
|||
.split("\n")
|
||||
.map((line: string) => Number.parseInt(line));
|
||||
|
||||
logger.message(`Found children subprocesses: ${stdoutStr}.`);
|
||||
logger.message(
|
||||
localize(
|
||||
"found.children.subprocesses",
|
||||
"Found children subprocesses: {0}.",
|
||||
stdoutStr
|
||||
)
|
||||
);
|
||||
for (const other of children) {
|
||||
if (other) {
|
||||
await killTree(progress, other);
|
||||
|
@ -277,7 +290,9 @@ export async function killTree(
|
|||
}
|
||||
|
||||
try {
|
||||
logger.message(`Killing process PID = ${pid}`);
|
||||
logger.message(
|
||||
localize("killing.process", "Killing process PID = {0}", pid)
|
||||
);
|
||||
progress.report({
|
||||
increment: 1,
|
||||
message: localize(
|
||||
|
@ -385,9 +400,14 @@ export function spawnChildProcess(
|
|||
|
||||
if (ensureQuoted) {
|
||||
logger.message(
|
||||
`Spawning child process with:\n process name: ${qProcessName}\n process args: ${qArgs}\n working directory: ${workingDirectory}\n shell type: ${
|
||||
localize(
|
||||
"utils.quoting",
|
||||
"Spawning child process with:\n process name: {0}\n process args: {1}\n working directory: {2}\n shell type: {3}",
|
||||
qProcessName,
|
||||
qArgs.join(","),
|
||||
workingDirectory,
|
||||
shellType || "default"
|
||||
}`,
|
||||
),
|
||||
"Debug"
|
||||
);
|
||||
}
|
||||
|
@ -691,7 +711,13 @@ export function mergeProperties(dst: any, src: any): any {
|
|||
|
||||
if (dst[prop] !== undefined) {
|
||||
logger.message(
|
||||
`Destination object already has property ${prop} set to ${dst[prop]}. Overwriting from source with ${src[prop]}`,
|
||||
localize(
|
||||
"utils.overwriting.property",
|
||||
"Destination object already has property {0} set to {1}. Overwriting from source with {2}",
|
||||
prop,
|
||||
dst[prop],
|
||||
src[prop]
|
||||
),
|
||||
"Debug"
|
||||
);
|
||||
}
|
||||
|
@ -720,20 +746,35 @@ export function sortAndRemoveDuplicates(src: string[]): string[] {
|
|||
|
||||
export function reportDryRunError(dryrunOutputFile: string): void {
|
||||
logger.message(
|
||||
`You can see the detailed dry-run output at ${dryrunOutputFile}`
|
||||
localize(
|
||||
"utils.dryrun.detailed.output",
|
||||
"You can see the detailed dry-run output at {0}",
|
||||
dryrunOutputFile
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
"Make sure that the extension is invoking the same make command as in your development prompt environment."
|
||||
localize(
|
||||
"utils.dryrun.error.environment",
|
||||
"Make sure that the extension is invoking the same make command as in your development prompt environment."
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
"You may need to define or tweak a custom makefile configuration in settings via 'makefile.configurations' like described here: [link]"
|
||||
localize(
|
||||
"utils.dryrun.error.makefile",
|
||||
"You may need to define or tweak a custom makefile configuration in settings via 'makefile.configurations' like described here: [link]"
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
"Also make sure your code base does not have any known issues with the dry-run switches used by this extension (makefile.dryrunSwitches)."
|
||||
localize(
|
||||
"utils.dryrun.error.knownissues",
|
||||
"Also make sure your code base does not have any known issues with the dry-run switches used by this extension (makefile.dryrunSwitches)."
|
||||
)
|
||||
);
|
||||
logger.message(
|
||||
"If you are not able to fix the dry-run, open a GitHub issue in Makefile Tools repo: " +
|
||||
"https://github.com/microsoft/vscode-makefile-tools/issues"
|
||||
localize(
|
||||
"utils.dryrun.error.github",
|
||||
"If you are not able to fix the dry-run, open a GitHub issue in Makefile Tools repo: https://github.com/microsoft/vscode-makefile-tools/issues"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -874,7 +915,13 @@ export async function getExpandedSettingVal<T>(
|
|||
}
|
||||
} catch (e) {
|
||||
logger.message(
|
||||
`Exception while expanding string "${settingId}.${prop}": '${e.message}'`
|
||||
localize(
|
||||
"utils.exception.expanding",
|
||||
'Exception while expanding string "{0}.{1}": "{2}"',
|
||||
settingId,
|
||||
prop,
|
||||
e.message
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -930,7 +977,12 @@ export async function expandVariablesInSetting(
|
|||
);
|
||||
if (preprocStr !== settingVal) {
|
||||
logger.message(
|
||||
`Detected escaped variable expansion patterns in setting '${settingId}', within value '${settingVal}'.`
|
||||
localize(
|
||||
"detected.escape.patterns",
|
||||
"Detected escaped variable expansion patterns in setting '{0}', within value '{1}'.",
|
||||
settingId,
|
||||
settingVal
|
||||
)
|
||||
);
|
||||
telemetryProperties.pattern = "escaped";
|
||||
telemetry.logEvent("varexp", telemetryProperties);
|
||||
|
@ -970,7 +1022,12 @@ export async function expandVariablesInSetting(
|
|||
} catch (e) {
|
||||
toStr = "unknown";
|
||||
logger.message(
|
||||
`Exception while executing command "${result[5]}": '${e.message}'`
|
||||
localize(
|
||||
"exception.executing",
|
||||
"Exception while executing command \"{0}\": '{1}'",
|
||||
result[5],
|
||||
e.message
|
||||
)
|
||||
);
|
||||
}
|
||||
} else if (result[4] === "config" && result[5]) {
|
||||
|
@ -1008,7 +1065,13 @@ export async function expandVariablesInSetting(
|
|||
}
|
||||
}
|
||||
} else {
|
||||
logger.message(`Unrecognized variable format: ${result[0]}`);
|
||||
logger.message(
|
||||
localize(
|
||||
"unrecognized.variable.format",
|
||||
"Unrecognized variable format: {0}",
|
||||
result[0]
|
||||
)
|
||||
);
|
||||
toStr = "unknown";
|
||||
telemetryProperties.pattern = "unrecognized";
|
||||
}
|
||||
|
@ -1026,8 +1089,12 @@ export async function expandVariablesInSetting(
|
|||
// We will address in future multiple passes.
|
||||
if (regexpVSCodeVar.exec(toStr) !== null) {
|
||||
logger.message(
|
||||
`"${result[0]}" resolves to "${toStr}" which requires another expansion.` +
|
||||
" We will support multiple expansion passes in the future. "
|
||||
localize(
|
||||
"multiple.expansion.passes",
|
||||
'"{0}" resolves to "{1}" which requires another expansion. We will support multiple expansion passes in the future.',
|
||||
result[0],
|
||||
toStr
|
||||
)
|
||||
);
|
||||
expandedSetting = expandedSetting.replace(result[0], "unknown");
|
||||
} else {
|
||||
|
@ -1040,7 +1107,13 @@ export async function expandVariablesInSetting(
|
|||
|
||||
if (expandedSetting !== settingVal) {
|
||||
logger.message(
|
||||
`Expanding from '${settingVal}' to '${expandedSetting}' for setting '${settingId}'.`
|
||||
localize(
|
||||
"expanding.setting",
|
||||
"Expanding from '{0}' to '{1}' for setting '{2}'.",
|
||||
settingVal,
|
||||
expandedSetting,
|
||||
settingId
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче