diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a82b0b..8591c73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to the "vscode-makefile-tools" extension will be documented in this file. +## 0.1.2 +- Support suffixes/prefixes specific for version and cross compilers. +- Add the possibility to list only the makefile targets marked as .PHONY. +- Various bug fixes. + ## 0.1.1 - Addressed feedback from 0.1 diff --git a/package.json b/package.json index 97b9c79..4c6d441 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "makefile-tools", "displayName": "Makefile Tools", "description": "Provide makefile support in VS Code: C/C++ IntelliSense, build, debug/run.", - "version": "0.1.1", + "version": "0.1.2", "publisher": "ms-vscode", "preview": true, "icon": "res/makefile-logo.png", @@ -349,7 +349,7 @@ "makefile.configurationCachePath": { "type": "string", "description": "The path to a cache file storing the output of the last dry-run make command", - "default": "./configurationCache.log", + "default": ".vscode/configurationCache.log", "scope": "resource" }, "makefile.dryrunSwitches": { diff --git a/src/configuration.ts b/src/configuration.ts index fe2b833..873068e 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -770,7 +770,7 @@ export async function initFromStateAndSettings(): Promise { if (extension.getState().configureDirty && configureOnEdit) { if ((extension.getCompletedConfigureInSession()) && !make.blockedByOp(make.Operations.configure, false)) { - logger.message("Configuring clean after settings or makefile changes..."); + logger.message("Configuring after settings or makefile changes..."); make.configure(make.TriggeredBy.configureAfterEditorFocusChange); // this sets configureDirty back to false if it succeeds } } diff --git a/src/parser.ts b/src/parser.ts index b9bdf9d..21868d4 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -325,7 +325,7 @@ function parseLineAsTool( return { pathInMakefile: toolPathInMakefile, fullPath: toolFullPath, - arguments: match[3], + arguments: match[match.length - 1], found: toolFound }; } diff --git a/src/telemetry.ts b/src/telemetry.ts index 26adc18..92eda2b 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -55,7 +55,7 @@ export function logEvent(eventName: string, properties?: Properties, measures?: } // Allow-lists for various settings. -function filterSetting(value: any, key: string) : string { +function filterSetting(value: any, key: string, defaultValue: string) : string { if (key === "makefile.dryrunSwitches") { let dryrunSwitches: string[] = value; let filteredSwitches: string[] | undefined = dryrunSwitches.map(sw => { @@ -85,6 +85,15 @@ function filterSetting(value: any, key: string) : string { return filteredSwitches.join(";"); } + // Even if the key represents a setting that shouldn't share its value, + // we can still record if it is undefined by the user (removed from settings.json) + // or equal to the default we set in package.json. + if (!value) { + return "undefined"; + } else if (value === defaultValue) { + return defaultValue; + } + return "..."; } @@ -161,7 +170,9 @@ function filterKey(key: string): string { // inaccurate or incomplete telemetry information for makefile and launch configurations. // This is not very critical since any of their state changes will update telemetry for them. export function analyzeSettings(setting: any, key: string, propSchema: any, ignoreDefault: boolean, telemetryProperties: Properties | null): Properties | null { - let type : string = typeof (setting); + // type can be undefined if setting is null, + // which happens when the user removes that setting. + let type : string | undefined = setting ? typeof (setting) : undefined; let jsonType : string | undefined = propSchema.type ? propSchema.type : undefined; // Skip anything else if the current setting represents a function. @@ -179,8 +190,10 @@ export function analyzeSettings(setting: any, key: string, propSchema: any, igno // The type "array" defined in package.json is seen as object by the workspace setting type. // Not all package.json constructs have a type (example: configuration properties list) // but the workspace setting type sees them as object. - if (jsonType !== type && jsonType !== undefined && (type !== "object" || jsonType !== "array")) { - logger.message(`Settings versus package.json type mismatch for "${key}".`); + if (jsonType !== type && + jsonType !== undefined && type !== undefined && + (type !== "object" || jsonType !== "array")) { + logger.message(`Settings versus package.json type mismatch for "${key}".`); } // Enum values always safe to report. @@ -212,14 +225,14 @@ export function analyzeSettings(setting: any, key: string, propSchema: any, igno // Apply allow-lists for strings. case "string": if (telemetryProperties) { - telemetryProperties[filterKey(key)] = filterSetting(setting, key); + telemetryProperties[filterKey(key)] = filterSetting(setting, key, propSchema.default); } break; case "array": // We are interested in logging arrays of basic types if (telemetryProperties && propSchema.items.type !== "object" && propSchema.items.type !== "array") { - telemetryProperties[filterKey(key)] = filterSetting(setting, key); + telemetryProperties[filterKey(key)] = filterSetting(setting, key, propSchema.default); break; } /* falls through */