mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
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:
@@ -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));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user