File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 304304 },
305305 {
306306 "command" : " codeQLQueryHistory.openQuery" ,
307- "title" : " Open Query" ,
307+ "title" : " Open the Query that Produced these results " ,
308308 "icon" : {
309309 "light" : " media/light/edit.svg" ,
310310 "dark" : " media/dark/edit.svg"
Original file line number Diff line number Diff line change @@ -310,6 +310,10 @@ export class QueryHistoryManager extends DisposableObject {
310310 return ;
311311 }
312312
313+ if ( ! finalSingleItem ) {
314+ throw new Error ( 'No query selected. Select a query history item you have already run and try again.' ) ;
315+ }
316+
313317 const textDocument = await vscode . workspace . openTextDocument (
314318 vscode . Uri . file ( finalSingleItem . query . program . queryPath )
315319 ) ;
@@ -398,6 +402,11 @@ export class QueryHistoryManager extends DisposableObject {
398402 if ( ! this . assertSingleQuery ( finalMultiSelect ) ) {
399403 return ;
400404 }
405+
406+ if ( ! finalSingleItem ) {
407+ throw new Error ( 'No query selected. Select a query history item you have already run and try again.' ) ;
408+ }
409+
401410 this . treeDataProvider . setCurrentItem ( finalSingleItem ) ;
402411
403412 const now = new Date ( ) ;
@@ -440,6 +449,10 @@ export class QueryHistoryManager extends DisposableObject {
440449 return ;
441450 }
442451
452+ if ( ! singleItem ) {
453+ throw new Error ( 'No query selected. Select a query history item you have already run and try again.' ) ;
454+ }
455+
443456 const queryName = singleItem . queryName . endsWith ( '.ql' )
444457 ? singleItem . queryName
445458 : singleItem . queryName + '.ql' ;
Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ async function promptUserToSaveChanges(document: TextDocument): Promise<boolean>
345345 else {
346346 const yesItem = { title : 'Yes' , isCloseAffordance : false } ;
347347 const alwaysItem = { title : 'Always Save' , isCloseAffordance : false } ;
348- const noItem = { title : 'No (run anyway )' , isCloseAffordance : false } ;
348+ const noItem = { title : 'No (run version on disk )' , isCloseAffordance : false } ;
349349 const cancelItem = { title : 'Cancel' , isCloseAffordance : true } ;
350350 const message = 'Query file has unsaved changes. Save now?' ;
351351 const chosenItem = await window . showInformationMessage (
@@ -478,6 +478,10 @@ export async function compileAndRunQueryAgainstDatabase(
478478 // Figure out the library path for the query.
479479 const packConfig = await cliServer . resolveLibraryPath ( diskWorkspaceFolders , queryPath ) ;
480480
481+ if ( ! packConfig . dbscheme ) {
482+ throw new Error ( 'No dbscheme. Is your qlpack.yml missing or invalid?' ) ;
483+ }
484+
481485 // Check whether the query has an entirely different schema from the
482486 // database. (Queries that merely need the database to be upgraded
483487 // won't trigger this check)
You can’t perform that action at this time.
0 commit comments