diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 808f93693b..fb0554ed87 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,15 @@ # C/C++ for Visual Studio Code Change Log +## Version 0.27.0-insiders5: March 26, 2019 +* Fix the configuration UI showing errors when an older version of `cl.exe` is set in the `compilerPath`. [#5151](https://github.com/microsoft/vscode-cpptools/issues/5151) +* Fix tag parsing not working on Windows 7 without SP1. [#5155](https://github.com/microsoft/vscode-cpptools/issues/5155) +* Fix debugger not working until the extension is reinstalled after macOS High Sierra or older is upgraded to a newer OS. [#5171](https://github.com/microsoft/vscode-cpptools/issues/5171) +* Fix the `Open File…` scenario without a workspace showing "Tag Parser initializing" (all symbol operations fail). [#5176](https://github.com/microsoft/vscode-cpptools/issues/5176) +* Fix `updateChannel` being settable per-workspace. [PR #5185](https://github.com/microsoft/vscode-cpptools/pull/5185) +* Fix opened files external to the workspace folder being removed from the database during loading. [#5190](https://github.com/microsoft/vscode-cpptools/issues/5190) +* Fix crash for workspaces with no workspace folders. [#5192](https://github.com/microsoft/vscode-cpptools/issues/5192) +* Fix environment variables used for the RunInTerminal Request. [MIEngine#979](https://github.com/microsoft/MIEngine/issues/979) + ## Version 0.27.0-insiders4: March 23, 2019 ### Bug Fixes * Fix `Go to Symbol in Workspace` not applying `search.exclude` settings. [#5099](https://github.com/microsoft/vscode-cpptools/issues/5099) diff --git a/Extension/i18n/jpn/src/platform.i18n.json b/Extension/i18n/jpn/src/platform.i18n.json index 8cf3a20fc6..afb0803b99 100644 --- a/Extension/i18n/jpn/src/platform.i18n.json +++ b/Extension/i18n/jpn/src/platform.i18n.json @@ -6,5 +6,5 @@ { "unknown.os.platform": "不明な OS プラットフォーム", "missing.plist.productversion": "SystemVersion.plist から ProduceVersion を取得できませんでした", - "missing.darwin.systemversion.file": "{0} で SystemVersion plist が見つかりませんでした。" + "missing.darwin.systemversion.file": "{0} で SystemVersion.plist が見つかりませんでした。" } \ No newline at end of file diff --git a/Extension/package.json b/Extension/package.json index d8722da616..c5a6b8da6b 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -488,7 +488,7 @@ ], "default": "Default", "description": "%c_cpp.configuration.updateChannel.description%", - "scope": "window" + "scope": "application" }, "C_Cpp.experimentalFeatures": { "type": "string", @@ -1717,7 +1717,7 @@ "https-proxy-agent": "^2.2.4", "jsonc-parser": "^2.1.1", "minimatch": "^3.0.4", - "minimist": "^1.2.2", + "minimist": "^1.2.5", "mkdirp": "^0.5.1", "parse5": "^5.1.0", "parse5-traverse": "^1.0.3", @@ -1745,7 +1745,9 @@ "webpack/acorn": "^6.4.1", "gulp-sourcemaps/acorn": "^5.7.4", "eslint/acorn": "^7.1.1", - "gulp-eslint/acorn": "^7.1.1" + "gulp-eslint/acorn": "^7.1.1", + "**/mkdirp/minimist": "^0.2.1", + "yargs-parser": "^13.1.2" }, "runtimeDependencies": [ { diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index b8b7e42cab..a75439f9f3 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -595,7 +595,7 @@ export class DefaultClient implements Client { } if (!storagePath) { - storagePath = path.join(this.RootPath, "/.vscode"); + storagePath = this.RootPath ? path.join(this.RootPath, "/.vscode") : ""; } if (workspaceFolder && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 1) { storagePath = path.join(storagePath, util.getUniqueWorkspaceStorageName(workspaceFolder)); @@ -1072,7 +1072,7 @@ export class DefaultClient implements Client { let settings: CppSettings[] = []; let otherSettings: OtherSettings[] = []; - if (vscode.workspace.workspaceFolders) { + if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) { for (let workspaceFolder of vscode.workspace.workspaceFolders) { settings.push(new CppSettings(workspaceFolder.uri)); otherSettings.push(new OtherSettings(workspaceFolder.uri)); diff --git a/Extension/src/common.ts b/Extension/src/common.ts index 89ae89c51c..712197b085 100644 --- a/Extension/src/common.ts +++ b/Extension/src/common.ts @@ -847,9 +847,9 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp let additionalArgs: string[] = []; let isWindows: boolean = os.platform() === 'win32'; if (compilerPath) { - if (compilerPath === "cl.exe") { + if (compilerPath.endsWith("\\cl.exe") || compilerPath.endsWith("/cl.exe") || compilerPath === "cl.exe") { // Input is only compiler name, this is only for cl.exe - compilerName = compilerPath; + compilerName = path.basename(compilerPath); } else if (compilerPath.startsWith("\"")) { // Input has quotes around compiler path @@ -881,6 +881,7 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp additionalArgs = additionalArgs.filter((arg: string) => arg.trim().length !== 0); // Remove empty args. compilerPath = potentialCompilerPath; } + compilerName = path.basename(compilerPath); } // Get compiler name if there are no args but path is valid or a valid path was found with args. if (compilerPath === "cl.exe" || checkFileExistsSync(compilerPath)) { diff --git a/Extension/src/main.ts b/Extension/src/main.ts index e90d9ad434..367c755d9d 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -12,6 +12,7 @@ import * as Telemetry from './telemetry'; import * as util from './common'; import * as vscode from 'vscode'; import * as nls from 'vscode-nls'; +import { PersistentState } from './LanguageServer/persistentState'; import { CppToolsApi, CppToolsExtension } from 'vscode-cpptools'; import { getTemporaryCommandRegistrarInstance, initializeTemporaryCommandRegistrar } from './commands'; @@ -69,17 +70,44 @@ export function deactivate(): Thenable { async function processRuntimeDependencies(): Promise { const installLockExists: boolean = await util.checkInstallLockFile(); - if (installLockExists) { + setInstallationStage('getPlatformInfo'); + const info: PlatformInformation = await PlatformInformation.GetPlatformInformation(); + + let forceOnlineInstall: boolean = false; + if (info.platform === "darwin" && info.version) { + const darwinVersion: PersistentState = new PersistentState("Cpp.darwinVersion", info.version); + + // macOS version has changed + if (darwinVersion.Value !== info.version) { + const highSierraOrLowerRegex: RegExp = new RegExp('10\\.(1[0-3]|[0-9])(\\..*)*$'); + const lldbMiFolderPath: string = util.getExtensionFilePath('./debugAdapters/lldb-mi'); + + // For macOS and if a user has upgraded their OS, check to see if we are on Mojave or later + // and that the debugAdapters/lldb-mi folder exists. This will force a online install to get the correct binaries. + if (!highSierraOrLowerRegex.test(info.version) && + !fs.existsSync(lldbMiFolderPath)) { + + forceOnlineInstall = true; + + setInstallationStage('cleanUpUnusedBinaries'); + await cleanUpUnusedBinaries(info); + } + } + } + + const doOfflineInstall: boolean = installLockExists && !forceOnlineInstall; + + if (doOfflineInstall) { // Offline Scenario: Lock file exists but package.json has not had its activationEvents rewritten. if (util.packageJson.activationEvents && util.packageJson.activationEvents.length === 1) { try { - await offlineInstallation(); + await offlineInstallation(info); } catch (error) { getOutputChannelLogger().showErrorMessage(localize('initialization.failed', 'The installation of the C/C++ extension failed. Please see the output window for more information.')); showOutputChannel(); // Send the failure telemetry since postInstall will not be called. - sendTelemetry(await PlatformInformation.GetPlatformInformation()); + sendTelemetry(info); } } else { // The extension has been installed and activated before. @@ -88,20 +116,21 @@ async function processRuntimeDependencies(): Promise { } else { // No lock file, need to download and install dependencies. try { - await onlineInstallation(); + await onlineInstallation(info); } catch (error) { handleError(error); // Send the failure telemetry since postInstall will not be called. - sendTelemetry(await PlatformInformation.GetPlatformInformation()); + sendTelemetry(info); } } } -async function offlineInstallation(): Promise { - setInstallationStage('getPlatformInfo'); +async function offlineInstallation(info: PlatformInformation): Promise { setInstallationType(InstallationType.Offline); - const info: PlatformInformation = await PlatformInformation.GetPlatformInformation(); + + setInstallationStage('cleanUpUnusedBinaries'); + await cleanUpUnusedBinaries(info); setInstallationStage('cleanUpUnusedBinaries'); await cleanUpUnusedBinaries(info); @@ -122,10 +151,8 @@ async function offlineInstallation(): Promise { await postInstall(info); } -async function onlineInstallation(): Promise { - setInstallationStage('getPlatformInfo'); +async function onlineInstallation(info: PlatformInformation): Promise { setInstallationType(InstallationType.Online); - const info: PlatformInformation = await PlatformInformation.GetPlatformInformation(); await downloadAndInstallPackages(info); @@ -177,6 +204,12 @@ function packageMatchesPlatform(pkg: IPackage, info: PlatformInformation): boole VersionsMatch(pkg, info); } +function invalidPackageVersion(pkg: IPackage, info: PlatformInformation): boolean { + return PlatformsMatch(pkg, info) && + (pkg.architectures === undefined || ArchitecturesMatch(pkg, info)) && + !VersionsMatch(pkg, info); +} + function makeOfflineBinariesExecutable(info: PlatformInformation): Promise { let promises: Thenable[] = []; let packages: IPackage[] = util.packageJson["runtimeDependencies"]; @@ -196,7 +229,7 @@ function cleanUpUnusedBinaries(info: PlatformInformation): Promise { packages.forEach(p => { if (p.binaries && p.binaries.length > 0 && - !packageMatchesPlatform(p, info)) { + invalidPackageVersion(p, info)) { p.binaries.forEach(binary => { const path: string = util.getExtensionFilePath(binary); if (fs.existsSync(path)) { diff --git a/Extension/yarn.lock b/Extension/yarn.lock index 6c88cac027..0257432b2b 100644 --- a/Extension/yarn.lock +++ b/Extension/yarn.lock @@ -3678,15 +3678,15 @@ minimatch@3.0.4, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= +minimist@0.0.8, minimist@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.1.tgz#827ba4e7593464e7c221e8c5bed930904ee2c455" + integrity sha512-GY8fANSrTMfBVfInqJAY41QkOM+upUTytK1jZ0c8+3HdHrJxBJ3rF5i9moClXTE8uUSnUo8cAsCoxDXvSY4DHg== -minimist@^1.2.0, minimist@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.2.tgz#b00a00230a1108c48c169e69a291aafda3aacd63" - integrity sha512-rIqbOrKb8GJmx/5bc2M0QchhUouMXSpd1RTclXsB41JdL+VtnojfaJR+h7F9k18/4kHUsBFgk80Uk+q569vjPA== +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== mississippi@^3.0.0: version "3.0.0" @@ -6136,21 +6136,14 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yargs-parser@13.1.1, yargs-parser@^13.1.0, yargs-parser@^13.1.1: - version "13.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" - integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== +yargs-parser@13.1.1, yargs-parser@^13.1.0, yargs-parser@^13.1.1, yargs-parser@^13.1.2, yargs-parser@^5.0.0: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" - integrity sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo= - dependencies: - camelcase "^3.0.0" - yargs-unparser@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f"