Skip to content

Commit

Permalink
Merge pull request #10728 from microsoft/main
Browse files Browse the repository at this point in the history
Merge for 1.15.1
  • Loading branch information
sean-mcmanus authored Mar 22, 2023
2 parents 1ce1e9c + 10125df commit 42dfef3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Extension/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"C:/git/Vcls-vscode-test/SingleRootProject",
"C:/git/Vcls-vscode-test/MultirootDeadlockTest/test.code-workspace",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/integrationTests/IntelliSenseFeatures/index"
],
Expand Down
3 changes: 2 additions & 1 deletion Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# C/C++ for Visual Studio Code Changelog

## Version 1.15.1: March 21, 2023
## Version 1.15.1: March 22, 2023
### Bug Fixes
* Fix crashes with a multiroot workspace. [#10636](https://github.com/microsoft/vscode-cpptools/issues/10636)
* Fix a deadlock with a multiroot workspace. [#10719](https://github.com/microsoft/vscode-cpptools/issues/10719)

## Version 1.15.0: March 15, 2023
### Enhancements
Expand Down
12 changes: 2 additions & 10 deletions Extension/src/LanguageServer/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { NewUI } from './ui_new';
import { ReferencesCommandMode, referencesCommandModeToString } from './references';
import { getCustomConfigProviders, CustomConfigurationProviderCollection, isSameProviderExtensionId } from './customProviders';
import * as telemetry from '../telemetry';
import { IExperimentationService } from 'tas-client';
import { CppSettings } from './settings';

nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
Expand Down Expand Up @@ -489,14 +487,8 @@ export async function getUI(): Promise<UI> {

async function _getUI(): Promise<UI> {
if (!ui) {
const experimentationService: IExperimentationService | undefined = await telemetry.getExperimentationService();
if (experimentationService !== undefined) {
const settings: CppSettings = new CppSettings();
const useNewUI: boolean | undefined = experimentationService.getTreatmentVariable<boolean>("vscode", "ShowLangStatBar");
ui = useNewUI || settings.experimentalFeatures ? new NewUI() : new OldUI();
} else {
ui = new NewUI();
}
const useNewUI: boolean = await telemetry.showLanguageStatusExperiment();
ui = useNewUI ? new NewUI() : new OldUI();
}
return ui;
}
10 changes: 10 additions & 0 deletions Extension/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import TelemetryReporter from '@vscode/extension-telemetry';
import { getExperimentationServiceAsync, IExperimentationService, IExperimentationTelemetry, TargetPopulation } from 'vscode-tas-client';
import { CppSettings } from './LanguageServer/settings';
import * as util from './common';

interface IPackageInfo {
Expand Down Expand Up @@ -76,6 +77,15 @@ export function getExperimentationService(): Promise<IExperimentationService> |
return initializationPromise;
}

export async function showLanguageStatusExperiment(): Promise<boolean> {
if (new CppSettings().experimentalFeatures) {
return true;
}
const experimentationService: IExperimentationService | undefined = await getExperimentationService();
const useNewUI: boolean | undefined = experimentationService?.getTreatmentVariable<boolean>("vscode", "ShowLangStatBar");
return useNewUI ?? false;
}

export async function deactivate(): Promise<void> {
if (initializationPromise) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ suite("[Inlay hints test]", function(): void {
let referenceOperatorEnabledValue: any;
let referenceOperatorShowSpaceValue: any;
// Test setup
const rootUri: vscode.Uri = vscode.workspace.workspaceFolders[0].uri;
const rootUri: vscode.Uri = vscode.workspace.workspaceFolders[1].uri;
const filePath: string | undefined = rootUri.fsPath + "/inlay_hints.cpp";
const fileUri: vscode.Uri = vscode.Uri.file(filePath);
const disposables: vscode.Disposable[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as testHelpers from '../testHelpers';
suite("[Quick info test]", function(): void {
let cpptools: apit.CppToolsTestApi;
const disposables: vscode.Disposable[] = [];
const filePath: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/quickInfo.cpp";
const filePath: string = vscode.workspace.workspaceFolders[1].uri.fsPath + "/quickInfo.cpp";
const fileUri: vscode.Uri = vscode.Uri.file(filePath);
let platform: string = "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as apit from 'vscode-cpptools/out/testApi';
suite(`[Reference test]`, function(): void {
let cpptools: apit.CppToolsTestApi;
const disposables: vscode.Disposable[] = [];
const path: string = vscode.workspace.workspaceFolders[0].uri.fsPath + "/references.cpp";
const path: string = vscode.workspace.workspaceFolders[1].uri.fsPath + "/references.cpp";
const fileUri: vscode.Uri = vscode.Uri.file(path);
let testHook: apit.CppToolsTestHook;
let getIntelliSenseStatus: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function main() {
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './index');

// Note, when running tests locally, replace testWorkspace with local path to "~/Vcls-vscode-test/SingleRootProject"
// Note, when running tests locally, replace TESTS_WORKSPACE with local path to "~/Vcls-vscode-test/MultirootDeadlockTest/test.code-workspace"
// in the Launch.json file.
let testWorkspace: string | undefined = process.env.TESTS_WORKSPACE;
if (!testWorkspace) {
Expand Down

0 comments on commit 42dfef3

Please sign in to comment.