mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Load all data workspace projects directly from workspace (#15921)
* Load all projects directly from workspace * fixes * Remove relativity and fix tests * fix compile * PR comments * remove unused * distro
This commit is contained in:
@@ -4,9 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import AdsTelemetryReporter from '@microsoft/ads-extension-telemetry';
|
||||
import * as path from 'path';
|
||||
import * as utils from './utils';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
const packageJson = require('../../package.json');
|
||||
|
||||
@@ -14,28 +12,6 @@ let packageInfo = utils.getPackageInfo(packageJson)!;
|
||||
|
||||
export const TelemetryReporter = new AdsTelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
|
||||
|
||||
export function calculateRelativity(projectPath: string, workspacePath?: string): string {
|
||||
workspacePath = workspacePath ?? vscode.workspace.workspaceFile?.fsPath;
|
||||
|
||||
if (!workspacePath) {
|
||||
return 'noWorkspace';
|
||||
}
|
||||
|
||||
const relativePath = path.relative(path.dirname(projectPath), path.dirname(workspacePath));
|
||||
|
||||
if (relativePath.length === 0) { // no path difference
|
||||
return 'sameFolder';
|
||||
}
|
||||
|
||||
const pathParts = relativePath.split(path.sep);
|
||||
|
||||
if (pathParts.every(x => x === '..')) {
|
||||
return 'directAncestor';
|
||||
}
|
||||
|
||||
return 'other'; // sibling, cousin, descendant, etc.
|
||||
}
|
||||
|
||||
|
||||
export enum TelemetryViews {
|
||||
WorkspaceTreePane = 'WorkspaceTreePane',
|
||||
|
||||
Reference in New Issue
Block a user