Add sql bindings package reference to project (#16912)

* list packages and add packages working

* cleanup and remove list packages

* cleanup

* change to pull in latest package version
This commit is contained in:
Kim Santiago
2021-08-27 16:58:54 -07:00
committed by GitHub
parent 22141259d3
commit 2c75f199e8
5 changed files with 134 additions and 2 deletions

View File

@@ -2,8 +2,9 @@ import * as vscode from 'vscode';
import { BindingType } from 'vscode-mssql';
import * as constants from '../common/constants';
import * as utils from '../common/utils';
import { PackageHelper } from '../tools/packageHelper';
export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined): Promise<void> {
export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined, packageHelper: PackageHelper): Promise<void> {
if (!uri) {
// this command only shows in the command palette when the active editor is a .cs file, so we can safely assume that's the scenario
// when this is called without a uri
@@ -95,5 +96,8 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined):
vscode.window.showErrorMessage(e);
return;
}
// 6. Add sql extension package reference to project. If the reference is already there, it doesn't get added again
await packageHelper.addPackageToAFProjectContainingFile(uri.fsPath, constants.sqlExtensionPackageName);
}