Add reference to another sql project (#12186)

* add projects to add database reference dialog

* able to add project references

* check for circular dependency

* only allow adding reference to project in the same workspace

* fix location dropdown when project reference is enabled

* add tests

* more tests

* cleanup

* fix flakey test

* addressing comments
This commit is contained in:
Kim Santiago
2020-09-10 17:44:39 -07:00
committed by GitHub
parent 7df132b307
commit 133ff73a43
11 changed files with 380 additions and 70 deletions

View File

@@ -9,11 +9,10 @@ import * as dataworkspace from 'dataworkspace';
import * as templates from '../templates/templates';
import * as constants from '../common/constants';
import * as path from 'path';
import * as glob from 'fast-glob';
import * as newProjectTool from '../tools/newProjectTool';
import { SqlDatabaseProjectTreeViewProvider } from './databaseProjectTreeViewProvider';
import { getErrorMessage } from '../common/utils';
import { getErrorMessage, getSqlProjectFilesInFolder } from '../common/utils';
import { ProjectsController } from './projectController';
import { BaseProjectTreeItem } from '../models/tree/baseTreeItem';
import { NetCoreTool } from '../tools/netcoreTool';
@@ -113,10 +112,7 @@ export default class MainController implements vscode.Disposable {
}
public async loadProjectsInFolder(folderPath: string): Promise<void> {
// path needs to use forward slashes for glob to work
let escapedPath = glob.escapePath(folderPath.replace(/\\/g, '/'));
let sqlprojFilter = path.posix.join(escapedPath, '**', '*.sqlproj');
let results = await glob(sqlprojFilter);
const results = await getSqlProjectFilesInFolder(folderPath);
for (let f in results) {
// open the project, but don't switch focus to the file explorer viewlet