File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -119,14 +119,18 @@ exports.initialise = (context) => {
119
119
* @param {StatementInfo } [options]
120
120
*/
121
121
async ( options ) => {
122
+ // Options here can be a vscode.Uri when called from editor context.
123
+ // But that isn't valid here.
124
+ const optionsIsValid = ( options && options . content !== undefined ) ;
125
+
122
126
const instance = getInstance ( ) ;
123
127
const config = instance . getConfig ( ) ;
124
128
const content = instance . getContent ( ) ;
125
129
const editor = vscode . window . activeTextEditor ;
126
130
127
- if ( options || ( editor && editor . document . languageId === `sql` ) ) {
131
+ if ( optionsIsValid || ( editor && editor . document . languageId === `sql` ) ) {
128
132
/** @type {StatementInfo } */
129
- const statement = options || this . parseStatement ( editor ) ;
133
+ const statement = ( optionsIsValid ? options : this . parseStatement ( editor ) ) ;
130
134
131
135
if ( statement . open ) {
132
136
const textDoc = await vscode . workspace . openTextDocument ( { language : `sql` , content : statement . content } ) ;
You can’t perform that action at this time.
0 commit comments