Add Query Editor API to sqlops.proposed (#1196)

* add support query editor API

* remove sqlops.proposed.d.ts in sp_whoIsActive

* address comments

* add catch error when connect
This commit is contained in:
Abbie Petchtes
2018-04-23 13:42:27 -07:00
committed by GitHub
parent b30f7ee41c
commit 965458ca74
12 changed files with 1143 additions and 33 deletions

View File

@@ -49,15 +49,12 @@ export default class MainController extends ControllerBase {
}
private onExecute(connection: sqlops.IConnectionProfile, fileName: string): void {
let sqlFile = fs.readFileSync(path.join(__dirname, '..', 'sql', fileName)).toString();
this.openSQLFileWithContent(sqlFile);
}
private openSQLFileWithContent(content: string): void {
vscode.workspace.openTextDocument({language: 'sql', content: content}).then(doc => {
vscode.window.showTextDocument(doc, vscode.ViewColumn.Active, false);
let sqlContent = fs.readFileSync(path.join(__dirname, '..', 'sql', fileName)).toString();
vscode.workspace.openTextDocument({language: 'sql', content: sqlContent}).then(doc => {
vscode.window.showTextDocument(doc, vscode.ViewColumn.Active, false).then(() => {
let filePath = doc.uri.toString();
sqlops.queryeditor.connect(filePath, connection.id).then(() => sqlops.queryeditor.runQuery(filePath));
});
});
}
}
}