Skip to content

Commit c5be0b5

Browse files
authored
Merge pull request #5205 from microsoft/seanmcm/0_27_0_release_merge
Seanmcm/0 27 0 release merge
2 parents 6c40808 + e8080fc commit c5be0b5

File tree

7 files changed

+78
-39
lines changed

7 files changed

+78
-39
lines changed

Extension/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# C/C++ for Visual Studio Code Change Log
22

3+
## Version 0.27.0-insiders5: March 26, 2019
4+
* 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)
5+
* Fix tag parsing not working on Windows 7 without SP1. [#5155](https://github.com/microsoft/vscode-cpptools/issues/5155)
6+
* 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)
7+
* 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)
8+
* Fix `updateChannel` being settable per-workspace. [PR #5185](https://github.com/microsoft/vscode-cpptools/pull/5185)
9+
* Fix opened files external to the workspace folder being removed from the database during loading. [#5190](https://github.com/microsoft/vscode-cpptools/issues/5190)
10+
* Fix crash for workspaces with no workspace folders. [#5192](https://github.com/microsoft/vscode-cpptools/issues/5192)
11+
* Fix environment variables used for the RunInTerminal Request. [MIEngine#979](https://github.com/microsoft/MIEngine/issues/979)
12+
313
## Version 0.27.0-insiders4: March 23, 2019
414
### Bug Fixes
515
* Fix `Go to Symbol in Workspace` not applying `search.exclude` settings. [#5099](https://github.com/microsoft/vscode-cpptools/issues/5099)

Extension/i18n/jpn/src/platform.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
{
77
"unknown.os.platform": "不明な OS プラットフォーム",
88
"missing.plist.productversion": "SystemVersion.plist から ProduceVersion を取得できませんでした",
9-
"missing.darwin.systemversion.file": "{0} で SystemVersion plist が見つかりませんでした。"
9+
"missing.darwin.systemversion.file": "{0} で SystemVersion.plist が見つかりませんでした。"
1010
}

Extension/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@
488488
],
489489
"default": "Default",
490490
"description": "%c_cpp.configuration.updateChannel.description%",
491-
"scope": "window"
491+
"scope": "application"
492492
},
493493
"C_Cpp.experimentalFeatures": {
494494
"type": "string",
@@ -1717,7 +1717,7 @@
17171717
"https-proxy-agent": "^2.2.4",
17181718
"jsonc-parser": "^2.1.1",
17191719
"minimatch": "^3.0.4",
1720-
"minimist": "^1.2.2",
1720+
"minimist": "^1.2.5",
17211721
"mkdirp": "^0.5.1",
17221722
"parse5": "^5.1.0",
17231723
"parse5-traverse": "^1.0.3",
@@ -1745,7 +1745,9 @@
17451745
"webpack/acorn": "^6.4.1",
17461746
"gulp-sourcemaps/acorn": "^5.7.4",
17471747
"eslint/acorn": "^7.1.1",
1748-
"gulp-eslint/acorn": "^7.1.1"
1748+
"gulp-eslint/acorn": "^7.1.1",
1749+
"**/mkdirp/minimist": "^0.2.1",
1750+
"yargs-parser": "^13.1.2"
17491751
},
17501752
"runtimeDependencies": [
17511753
{

Extension/src/LanguageServer/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ export class DefaultClient implements Client {
595595
}
596596

597597
if (!storagePath) {
598-
storagePath = path.join(this.RootPath, "/.vscode");
598+
storagePath = this.RootPath ? path.join(this.RootPath, "/.vscode") : "";
599599
}
600600
if (workspaceFolder && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 1) {
601601
storagePath = path.join(storagePath, util.getUniqueWorkspaceStorageName(workspaceFolder));
@@ -1072,7 +1072,7 @@ export class DefaultClient implements Client {
10721072
let settings: CppSettings[] = [];
10731073
let otherSettings: OtherSettings[] = [];
10741074

1075-
if (vscode.workspace.workspaceFolders) {
1075+
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
10761076
for (let workspaceFolder of vscode.workspace.workspaceFolders) {
10771077
settings.push(new CppSettings(workspaceFolder.uri));
10781078
otherSettings.push(new OtherSettings(workspaceFolder.uri));

Extension/src/common.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,9 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
847847
let additionalArgs: string[] = [];
848848
let isWindows: boolean = os.platform() === 'win32';
849849
if (compilerPath) {
850-
if (compilerPath === "cl.exe") {
850+
if (compilerPath.endsWith("\\cl.exe") || compilerPath.endsWith("/cl.exe") || compilerPath === "cl.exe") {
851851
// Input is only compiler name, this is only for cl.exe
852-
compilerName = compilerPath;
852+
compilerName = path.basename(compilerPath);
853853

854854
} else if (compilerPath.startsWith("\"")) {
855855
// Input has quotes around compiler path
@@ -881,6 +881,7 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
881881
additionalArgs = additionalArgs.filter((arg: string) => arg.trim().length !== 0); // Remove empty args.
882882
compilerPath = potentialCompilerPath;
883883
}
884+
compilerName = path.basename(compilerPath);
884885
}
885886
// Get compiler name if there are no args but path is valid or a valid path was found with args.
886887
if (compilerPath === "cl.exe" || checkFileExistsSync(compilerPath)) {

Extension/src/main.ts

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import * as Telemetry from './telemetry';
1212
import * as util from './common';
1313
import * as vscode from 'vscode';
1414
import * as nls from 'vscode-nls';
15+
import { PersistentState } from './LanguageServer/persistentState';
1516

1617
import { CppToolsApi, CppToolsExtension } from 'vscode-cpptools';
1718
import { getTemporaryCommandRegistrarInstance, initializeTemporaryCommandRegistrar } from './commands';
@@ -69,17 +70,44 @@ export function deactivate(): Thenable<void> {
6970
async function processRuntimeDependencies(): Promise<void> {
7071
const installLockExists: boolean = await util.checkInstallLockFile();
7172

72-
if (installLockExists) {
73+
setInstallationStage('getPlatformInfo');
74+
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();
75+
76+
let forceOnlineInstall: boolean = false;
77+
if (info.platform === "darwin" && info.version) {
78+
const darwinVersion: PersistentState<string | undefined> = new PersistentState("Cpp.darwinVersion", info.version);
79+
80+
// macOS version has changed
81+
if (darwinVersion.Value !== info.version) {
82+
const highSierraOrLowerRegex: RegExp = new RegExp('10\\.(1[0-3]|[0-9])(\\..*)*$');
83+
const lldbMiFolderPath: string = util.getExtensionFilePath('./debugAdapters/lldb-mi');
84+
85+
// For macOS and if a user has upgraded their OS, check to see if we are on Mojave or later
86+
// and that the debugAdapters/lldb-mi folder exists. This will force a online install to get the correct binaries.
87+
if (!highSierraOrLowerRegex.test(info.version) &&
88+
!fs.existsSync(lldbMiFolderPath)) {
89+
90+
forceOnlineInstall = true;
91+
92+
setInstallationStage('cleanUpUnusedBinaries');
93+
await cleanUpUnusedBinaries(info);
94+
}
95+
}
96+
}
97+
98+
const doOfflineInstall: boolean = installLockExists && !forceOnlineInstall;
99+
100+
if (doOfflineInstall) {
73101
// Offline Scenario: Lock file exists but package.json has not had its activationEvents rewritten.
74102
if (util.packageJson.activationEvents && util.packageJson.activationEvents.length === 1) {
75103
try {
76-
await offlineInstallation();
104+
await offlineInstallation(info);
77105
} catch (error) {
78106
getOutputChannelLogger().showErrorMessage(localize('initialization.failed', 'The installation of the C/C++ extension failed. Please see the output window for more information.'));
79107
showOutputChannel();
80108

81109
// Send the failure telemetry since postInstall will not be called.
82-
sendTelemetry(await PlatformInformation.GetPlatformInformation());
110+
sendTelemetry(info);
83111
}
84112
} else {
85113
// The extension has been installed and activated before.
@@ -88,20 +116,21 @@ async function processRuntimeDependencies(): Promise<void> {
88116
} else {
89117
// No lock file, need to download and install dependencies.
90118
try {
91-
await onlineInstallation();
119+
await onlineInstallation(info);
92120
} catch (error) {
93121
handleError(error);
94122

95123
// Send the failure telemetry since postInstall will not be called.
96-
sendTelemetry(await PlatformInformation.GetPlatformInformation());
124+
sendTelemetry(info);
97125
}
98126
}
99127
}
100128

101-
async function offlineInstallation(): Promise<void> {
102-
setInstallationStage('getPlatformInfo');
129+
async function offlineInstallation(info: PlatformInformation): Promise<void> {
103130
setInstallationType(InstallationType.Offline);
104-
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();
131+
132+
setInstallationStage('cleanUpUnusedBinaries');
133+
await cleanUpUnusedBinaries(info);
105134

106135
setInstallationStage('cleanUpUnusedBinaries');
107136
await cleanUpUnusedBinaries(info);
@@ -122,10 +151,8 @@ async function offlineInstallation(): Promise<void> {
122151
await postInstall(info);
123152
}
124153

125-
async function onlineInstallation(): Promise<void> {
126-
setInstallationStage('getPlatformInfo');
154+
async function onlineInstallation(info: PlatformInformation): Promise<void> {
127155
setInstallationType(InstallationType.Online);
128-
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();
129156

130157
await downloadAndInstallPackages(info);
131158

@@ -177,6 +204,12 @@ function packageMatchesPlatform(pkg: IPackage, info: PlatformInformation): boole
177204
VersionsMatch(pkg, info);
178205
}
179206

207+
function invalidPackageVersion(pkg: IPackage, info: PlatformInformation): boolean {
208+
return PlatformsMatch(pkg, info) &&
209+
(pkg.architectures === undefined || ArchitecturesMatch(pkg, info)) &&
210+
!VersionsMatch(pkg, info);
211+
}
212+
180213
function makeOfflineBinariesExecutable(info: PlatformInformation): Promise<void> {
181214
let promises: Thenable<void>[] = [];
182215
let packages: IPackage[] = util.packageJson["runtimeDependencies"];
@@ -196,7 +229,7 @@ function cleanUpUnusedBinaries(info: PlatformInformation): Promise<void> {
196229

197230
packages.forEach(p => {
198231
if (p.binaries && p.binaries.length > 0 &&
199-
!packageMatchesPlatform(p, info)) {
232+
invalidPackageVersion(p, info)) {
200233
p.binaries.forEach(binary => {
201234
const path: string = util.getExtensionFilePath(binary);
202235
if (fs.existsSync(path)) {

Extension/yarn.lock

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3678,15 +3678,15 @@ [email protected], minimatch@^3.0.4:
36783678
dependencies:
36793679
brace-expansion "^1.1.7"
36803680

3681-
3682-
version "0.0.8"
3683-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
3684-
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
3681+
[email protected], minimist@^0.2.1:
3682+
version "0.2.1"
3683+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.1.tgz#827ba4e7593464e7c221e8c5bed930904ee2c455"
3684+
integrity sha512-GY8fANSrTMfBVfInqJAY41QkOM+upUTytK1jZ0c8+3HdHrJxBJ3rF5i9moClXTE8uUSnUo8cAsCoxDXvSY4DHg==
36853685

3686-
minimist@^1.2.0, minimist@^1.2.2:
3687-
version "1.2.2"
3688-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.2.tgz#b00a00230a1108c48c169e69a291aafda3aacd63"
3689-
integrity sha512-rIqbOrKb8GJmx/5bc2M0QchhUouMXSpd1RTclXsB41JdL+VtnojfaJR+h7F9k18/4kHUsBFgk80Uk+q569vjPA==
3686+
minimist@^1.2.0, minimist@^1.2.5:
3687+
version "1.2.5"
3688+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
3689+
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
36903690

36913691
mississippi@^3.0.0:
36923692
version "3.0.0"
@@ -6136,21 +6136,14 @@ yallist@^3.0.2:
61366136
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
61376137
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
61386138

6139-
[email protected], yargs-parser@^13.1.0, yargs-parser@^13.1.1:
6140-
version "13.1.1"
6141-
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0"
6142-
integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==
6139+
[email protected], yargs-parser@^13.1.0, yargs-parser@^13.1.1, yargs-parser@^13.1.2, yargs-parser@^5.0.0:
6140+
version "13.1.2"
6141+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38"
6142+
integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==
61436143
dependencies:
61446144
camelcase "^5.0.0"
61456145
decamelize "^1.2.0"
61466146

6147-
yargs-parser@^5.0.0:
6148-
version "5.0.0"
6149-
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a"
6150-
integrity sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=
6151-
dependencies:
6152-
camelcase "^3.0.0"
6153-
61546147
61556148
version "1.6.0"
61566149
resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f"

0 commit comments

Comments
 (0)