mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
add vscode mssql handling for getSqlProjectsService() (#22121)
* add vscode mssql handling for getSqlProjectsService() * try to fix error because of projectStyle enum
This commit is contained in:
@@ -279,6 +279,7 @@ export function getDataWorkspaceExtensionApi(): dataworkspace.IExtension {
|
||||
|
||||
export type IDacFxService = mssql.IDacFxService | vscodeMssql.IDacFxService;
|
||||
export type ISchemaCompareService = mssql.ISchemaCompareService | vscodeMssql.ISchemaCompareService;
|
||||
export type ISqlProjectsService = mssql.ISqlProjectsService | vscodeMssql.ISqlProjectsService;
|
||||
|
||||
export async function getDacFxService(): Promise<IDacFxService> {
|
||||
if (getAzdataApi()) {
|
||||
@@ -302,12 +303,15 @@ export async function getSchemaCompareService(): Promise<ISchemaCompareService>
|
||||
}
|
||||
}
|
||||
|
||||
export async function getSqlProjectsService(): Promise<mssql.ISqlProjectsService> {
|
||||
const ext = vscode.extensions.getExtension(mssql.extension.name) as vscode.Extension<mssql.IExtension>;
|
||||
const api = await ext.activate();
|
||||
return api.sqlProjects;
|
||||
|
||||
// TODO: add vscode-mssql support
|
||||
export async function getSqlProjectsService(): Promise<ISqlProjectsService> {
|
||||
if (getAzdataApi()) {
|
||||
const ext = vscode.extensions.getExtension(mssql.extension.name) as vscode.Extension<mssql.IExtension>;
|
||||
const api = await ext.activate();
|
||||
return api.sqlProjects;
|
||||
} else {
|
||||
const api = await getVscodeMssqlApi();
|
||||
return api.sqlProjects;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getVscodeMssqlApi(): Promise<vscodeMssql.IExtension> {
|
||||
|
||||
Reference in New Issue
Block a user