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) => {
119119 * @param {StatementInfo } [options]
120120 */
121121 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+
122126 const instance = getInstance ( ) ;
123127 const config = instance . getConfig ( ) ;
124128 const content = instance . getContent ( ) ;
125129 const editor = vscode . window . activeTextEditor ;
126130
127- if ( options || ( editor && editor . document . languageId === `sql` ) ) {
131+ if ( optionsIsValid || ( editor && editor . document . languageId === `sql` ) ) {
128132 /** @type {StatementInfo } */
129- const statement = options || this . parseStatement ( editor ) ;
133+ const statement = ( optionsIsValid ? options : this . parseStatement ( editor ) ) ;
130134
131135 if ( statement . open ) {
132136 const textDoc = await vscode . workspace . openTextDocument ( { language : `sql` , content : statement . content } ) ;
You can’t perform that action at this time.
0 commit comments