mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Cleanup sql projects tree (#21883)
* remove MessageTreeItem and rename projectUri to relativeProjectUri * declare variables inline in constructor
This commit is contained in:
@@ -777,7 +777,7 @@ export class ProjectsController {
|
||||
await project.exclude(fileEntry);
|
||||
} else {
|
||||
TelemetryReporter.sendErrorEvent(TelemetryViews.ProjectTree, TelemetryActions.excludeFromProject);
|
||||
void vscode.window.showErrorMessage(constants.unableToPerformAction(constants.excludeAction, node.projectUri.path));
|
||||
void vscode.window.showErrorMessage(constants.unableToPerformAction(constants.excludeAction, node.relativeProjectUri.path));
|
||||
}
|
||||
|
||||
this.refreshProjectsTree(context);
|
||||
@@ -835,7 +835,7 @@ export class ProjectsController {
|
||||
.withAdditionalProperties({ objectType: node.constructor.name })
|
||||
.send();
|
||||
|
||||
void vscode.window.showErrorMessage(constants.unableToPerformAction(constants.deleteAction, node.projectUri.path));
|
||||
void vscode.window.showErrorMessage(constants.unableToPerformAction(constants.deleteAction, node.relativeProjectUri.path));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1454,7 +1454,7 @@ export class ProjectsController {
|
||||
const trimmedUri = utils.trimChars(utils.getPlatformSafeFileEntryPath(utils.trimUri(root.fileSystemUri, fileOrFolder.fileSystemUri)), '/');
|
||||
return allFileEntries.find(x => utils.trimChars(utils.getPlatformSafeFileEntryPath(x.relativePath), '/') === trimmedUri);
|
||||
}
|
||||
return project.files.find(x => utils.getPlatformSafeFileEntryPath(x.relativePath) === utils.getPlatformSafeFileEntryPath(utils.trimUri(context.root.projectUri, context.projectUri)));
|
||||
return project.files.find(x => utils.getPlatformSafeFileEntryPath(x.relativePath) === utils.getPlatformSafeFileEntryPath(utils.trimUri(context.root.relativeProjectUri, context.relativeProjectUri)));
|
||||
}
|
||||
|
||||
private getProjectFromContext(context: Project | BaseProjectTreeItem | dataworkspace.WorkspaceTreeItem): Project {
|
||||
@@ -1469,12 +1469,12 @@ export class ProjectsController {
|
||||
if (context.root instanceof ProjectRootTreeItem) {
|
||||
return (<ProjectRootTreeItem>context.root).project;
|
||||
} else {
|
||||
throw new Error(constants.unexpectedProjectContext(context.projectUri.path));
|
||||
throw new Error(constants.unexpectedProjectContext(context.relativeProjectUri.path));
|
||||
}
|
||||
}
|
||||
|
||||
private getRelativePath(treeNode: BaseProjectTreeItem): string {
|
||||
return treeNode instanceof FolderNode ? utils.trimUri(treeNode.root.projectUri, treeNode.projectUri) : '';
|
||||
return treeNode instanceof FolderNode ? utils.trimUri(treeNode.root.relativeProjectUri, treeNode.relativeProjectUri) : '';
|
||||
}
|
||||
|
||||
private getConnectionProfileFromContext(context: azdataType.IConnectionProfile | mssqlVscode.ITreeNodeInfo | undefined): azdataType.IConnectionProfile | mssqlVscode.IConnectionInfo | undefined {
|
||||
|
||||
Reference in New Issue
Block a user