mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix projects notification showing when it shouldn't (#15890)
* fix projects notification showing when it shouldn't * use path.resolve
This commit is contained in:
@@ -14,12 +14,12 @@ import { IWorkspaceService } from './common/interfaces';
|
|||||||
import { IconPathHelper } from './common/iconHelper';
|
import { IconPathHelper } from './common/iconHelper';
|
||||||
import { ProjectDashboard } from './dialogs/projectDashboard';
|
import { ProjectDashboard } from './dialogs/projectDashboard';
|
||||||
|
|
||||||
export function activate(context: vscode.ExtensionContext): Promise<IExtension> {
|
export async function activate(context: vscode.ExtensionContext): Promise<IExtension> {
|
||||||
const workspaceService = new WorkspaceService(context);
|
const workspaceService = new WorkspaceService(context);
|
||||||
workspaceService.loadTempProjects();
|
await workspaceService.loadTempProjects();
|
||||||
workspaceService.checkForProjectsNotAddedToWorkspace();
|
await workspaceService.checkForProjectsNotAddedToWorkspace();
|
||||||
context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(() => {
|
context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(async () => {
|
||||||
workspaceService.checkForProjectsNotAddedToWorkspace();
|
await workspaceService.checkForProjectsNotAddedToWorkspace();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const workspaceTreeDataProvider = new WorkspaceTreeDataProvider(workspaceService);
|
const workspaceTreeDataProvider = new WorkspaceTreeDataProvider(workspaceService);
|
||||||
|
|||||||
@@ -218,6 +218,11 @@ export class WorkspaceService implements IWorkspaceService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of all the supported projects in the folder
|
||||||
|
* @param folder folder to look look for projects
|
||||||
|
* @returns array of file paths of supported projects
|
||||||
|
*/
|
||||||
async getAllProjectsInFolder(folder: vscode.Uri): Promise<string[]> {
|
async getAllProjectsInFolder(folder: vscode.Uri): Promise<string[]> {
|
||||||
// get the unique supported project extensions
|
// get the unique supported project extensions
|
||||||
const supportedProjectExtensions = [...new Set((await this.getAllProjectTypes()).map(p => { return p.projectFileExtension; }))];
|
const supportedProjectExtensions = [...new Set((await this.getAllProjectTypes()).map(p => { return p.projectFileExtension; }))];
|
||||||
@@ -229,7 +234,8 @@ export class WorkspaceService implements IWorkspaceService {
|
|||||||
// so the filter needs to be in the format folder/**/*.sqlproj if there's only one supported projectextension
|
// so the filter needs to be in the format folder/**/*.sqlproj if there's only one supported projectextension
|
||||||
const projFilter = supportedProjectExtensions.length > 1 ? path.posix.join(escapedPath, '**', `*.{${supportedProjectExtensions.toString()}}`) : path.posix.join(escapedPath, '**', `*.${supportedProjectExtensions[0]}`);
|
const projFilter = supportedProjectExtensions.length > 1 ? path.posix.join(escapedPath, '**', `*.{${supportedProjectExtensions.toString()}}`) : path.posix.join(escapedPath, '**', `*.${supportedProjectExtensions[0]}`);
|
||||||
|
|
||||||
return await glob(projFilter);
|
// glob will return an array of file paths with forward slashes, so they need to be converted back if on windows
|
||||||
|
return (await glob(projFilter)).map(p => path.resolve(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getProjectProvider(projectFile: vscode.Uri): Promise<dataworkspace.IProjectProvider | undefined> {
|
async getProjectProvider(projectFile: vscode.Uri): Promise<dataworkspace.IProjectProvider | undefined> {
|
||||||
|
|||||||
Reference in New Issue
Block a user