mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
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:
@@ -6,8 +6,9 @@
|
||||
import * as vscode from 'vscode';
|
||||
import * as os from 'os';
|
||||
import * as constants from './constants';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as glob from 'fast-glob';
|
||||
import { promises as fs } from 'fs';
|
||||
|
||||
/**
|
||||
* Consolidates on the error message string
|
||||
@@ -143,3 +144,16 @@ export function readSqlCmdVariables(xmlDoc: any): Record<string, string> {
|
||||
|
||||
return sqlCmdVariables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively gets all the sqlproj files at any depth in a folder
|
||||
* @param folderPath
|
||||
*/
|
||||
export async function getSqlProjectFilesInFolder(folderPath: string): Promise<string[]> {
|
||||
// path needs to use forward slashes for glob to work
|
||||
const escapedPath = glob.escapePath(folderPath.replace(/\\/g, '/'));
|
||||
const sqlprojFilter = path.posix.join(escapedPath, '**', '*.sqlproj');
|
||||
const results = await glob(sqlprojFilter);
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user