mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Sql Proj VS Code fixes (#16506)
* Sql Proj VS Code fixes * remove comment
This commit is contained in:
@@ -7,7 +7,8 @@ declare module 'dataworkspace' {
|
|||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
export const enum extension {
|
export const enum extension {
|
||||||
name = 'Microsoft.data-workspace'
|
name = 'Microsoft.data-workspace',
|
||||||
|
vscodeName = 'Microsoft.data-workspace-vscode'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -249,7 +249,8 @@ export function getSqlProjectsInWorkspace(): Promise<vscode.Uri[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getDataWorkspaceExtensionApi(): dataworkspace.IExtension {
|
export function getDataWorkspaceExtensionApi(): dataworkspace.IExtension {
|
||||||
const extension = vscode.extensions.getExtension(dataworkspace.extension.name)!;
|
const dataworkspaceExtName = getAzdataApi() ? dataworkspace.extension.name : dataworkspace.extension.vscodeName;
|
||||||
|
const extension = vscode.extensions.getExtension(dataworkspaceExtName)!;
|
||||||
return extension.exports;
|
return extension.exports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
declare module 'sqldbproj' {
|
declare module 'sqldbproj' {
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
export const enum extension {
|
export const enum extension {
|
||||||
name = 'Microsoft.sql-database-projects'
|
name = 'Microsoft.sql-database-projects',
|
||||||
|
vsCodeName = 'Microsoft.sql-database-projects-vscode'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ export class BuildHelper {
|
|||||||
private initialized: boolean = false;
|
private initialized: boolean = false;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.extensionDir = vscode.extensions.getExtension(sqldbproj.extension.name)?.extensionPath ?? '';
|
const extName = utils.getAzdataApi() ? sqldbproj.extension.name : sqldbproj.extension.vsCodeName;
|
||||||
|
this.extensionDir = vscode.extensions.getExtension(extName)?.extensionPath ?? '';
|
||||||
this.extensionBuildDir = path.join(this.extensionDir, buildDirectory);
|
this.extensionBuildDir = path.join(this.extensionDir, buildDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +53,6 @@ export class BuildHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const buildfilesPath = await this.getBuildDirPathFromMssqlTools();
|
const buildfilesPath = await this.getBuildDirPathFromMssqlTools();
|
||||||
|
|
||||||
buildFiles.forEach(async (fileName) => {
|
buildFiles.forEach(async (fileName) => {
|
||||||
if (await (utils.exists(path.join(buildfilesPath, fileName)))) {
|
if (await (utils.exists(path.join(buildfilesPath, fileName)))) {
|
||||||
await fs.copyFile(path.join(buildfilesPath, fileName), path.join(this.extensionBuildDir, fileName));
|
await fs.copyFile(path.join(buildfilesPath, fileName), path.join(this.extensionBuildDir, fileName));
|
||||||
@@ -81,8 +81,12 @@ export class BuildHelper {
|
|||||||
if (utils.getAzdataApi()) {
|
if (utils.getAzdataApi()) {
|
||||||
installDir = config.installDirectory?.replace('{#version#}', config.version).replace('{#platform#}', this.getPlatform());
|
installDir = config.installDirectory?.replace('{#version#}', config.version).replace('{#platform#}', this.getPlatform());
|
||||||
} else {
|
} else {
|
||||||
// VS Code MSSQL extension has its config.json
|
// VS Code MSSQL extension has a slightly different format for its config.json
|
||||||
installDir = config.service?.installDir?.replace('{#version#}', config.version).replace('{#platform#}', this.getPlatform());
|
installDir = config.service?.installDir?.replace('{#version#}', config.service.version).replace('{#platform#}', this.getPlatform());
|
||||||
|
if (installDir) {
|
||||||
|
// The path to the install location is relative to one directory above where the config is so account for that here
|
||||||
|
installDir = path.join('..', installDir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (installDir) {
|
if (installDir) {
|
||||||
|
|||||||
Reference in New Issue
Block a user