mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Still load other projects even if one doesn't exist (#14585)
* still load other projects if one doesn't exist * show all errors at the end * update error message * remove project(s)
This commit is contained in:
@@ -20,6 +20,7 @@ export const EnterWorkspaceConfirmation = localize('dataworkspace.enterWorkspace
|
||||
export const WorkspaceContainsNotAddedProjects = localize('dataworkspace.workspaceContainsNotAddedProjects', "The current workspace contains one or more projects that have not been added to the workspace. Use the 'Open existing' dialog to add projects to the projects pane.");
|
||||
export const LaunchOpenExisitingDialog = localize('dataworkspace.launchOpenExistingDialog', "Launch Open existing dialog");
|
||||
export const DoNotShowAgain = localize('dataworkspace.doNotShowAgain', "Do not show again");
|
||||
export const ProjectsFailedToLoad = localize('dataworkspace.projectsFailedToLoad', "Some projects failed to load. Please open console for more information");
|
||||
|
||||
// config settings
|
||||
export const projectsConfigurationKey = 'projects';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
import { IWorkspaceService } from './interfaces';
|
||||
import { UnknownProjectsError } from './constants';
|
||||
import { ProjectsFailedToLoad, UnknownProjectsError } from './constants';
|
||||
import { WorkspaceTreeItem } from 'dataworkspace';
|
||||
import { TelemetryReporter } from './telemetry';
|
||||
|
||||
@@ -45,7 +45,9 @@ export class WorkspaceTreeDataProvider implements vscode.TreeDataProvider<Worksp
|
||||
|
||||
const typeMetric: Record<string, number> = {};
|
||||
|
||||
let errorCount = 0;
|
||||
for (const project of projects) {
|
||||
try {
|
||||
const projectProvider = await this._workspaceService.getProjectProvider(project);
|
||||
|
||||
this.incrementProjectTypeMetric(typeMetric, project);
|
||||
@@ -67,6 +69,14 @@ export class WorkspaceTreeDataProvider implements vscode.TreeDataProvider<Worksp
|
||||
element: child
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
errorCount++;
|
||||
console.error(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
if (errorCount > 0) {
|
||||
vscode.window.showErrorMessage(ProjectsFailedToLoad);
|
||||
}
|
||||
|
||||
TelemetryReporter.sendMetricsEvent(typeMetric, 'OpenWorkspaceProjectTypes');
|
||||
|
||||
Reference in New Issue
Block a user