Commit 6e41241
committed
Ensure we're selecting database in single rooted workspace
After some testing of the wizard with a single rooted workspace
(`github/code-scanning`) we discovered a general VSCode extension
bug whereby after we download a database, we don't select it.
This isn't an issue in the wizard, but it does affect us as it means
we'll generate the QL pack, download the db for you but then you won't
know that we haven't selected your database.
So let's make sure our flow works for this case by explicitly selecting
the database once it's downloaded.
We've noticed by testing that we need to set the current database item
before we call `addDatabaseSourceArchiveFolder()`. Once that method is
called, the call to `setCurrentDatabaseItem()` is ignored.
We've had to make some changes to the openDatabase() method to select
a database item by default, since most places where we call `openDatabase()`
also immediately select the item.
There is one exception [1] in the test-runner.ts file, where we set the
current database item under special conditions.
For this reason, we've made the behaviour configurable and tried to add
some descriptive naming to the params so that it's easy to understand
what the config is doing.
[1]: https://github.com/github/vscode-codeql/blob/4170e7f7a7026b3ebcc75b7509dd55f317293a4d/extensions/ql-vscode/src/test-runner.ts#L120-L1241 parent 34d4fd4 commit 6e41241
File tree
4 files changed
+42
-6
lines changed- extensions/ql-vscode
- src
- test/vscode-tests/minimal-workspace
4 files changed
+42
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
320 | 322 | | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| 326 | + | |
324 | 327 | | |
325 | 328 | | |
326 | | - | |
327 | 329 | | |
328 | 330 | | |
329 | 331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
311 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
312 | 315 | | |
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
316 | | - | |
| 319 | + | |
| 320 | + | |
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
320 | | - | |
321 | 324 | | |
322 | 325 | | |
323 | 326 | | |
| |||
758 | 761 | | |
759 | 762 | | |
760 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
761 | 767 | | |
762 | 768 | | |
763 | 769 | | |
764 | 770 | | |
765 | 771 | | |
| 772 | + | |
766 | 773 | | |
767 | 774 | | |
768 | | - | |
769 | 775 | | |
770 | 776 | | |
771 | 777 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
| 624 | + | |
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
| |||
629 | 630 | | |
630 | 631 | | |
631 | 632 | | |
| 633 | + | |
632 | 634 | | |
633 | 635 | | |
634 | 636 | | |
| |||
643 | 645 | | |
644 | 646 | | |
645 | 647 | | |
| 648 | + | |
646 | 649 | | |
647 | 650 | | |
648 | 651 | | |
| |||
652 | 655 | | |
653 | 656 | | |
654 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
655 | 661 | | |
656 | 662 | | |
657 | 663 | | |
| |||
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| 711 | + | |
711 | 712 | | |
712 | 713 | | |
713 | 714 | | |
| |||
722 | 723 | | |
723 | 724 | | |
724 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
725 | 731 | | |
726 | 732 | | |
727 | 733 | | |
| |||
746 | 752 | | |
747 | 753 | | |
748 | 754 | | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
749 | 768 | | |
750 | 769 | | |
751 | 770 | | |
| |||
762 | 781 | | |
763 | 782 | | |
764 | 783 | | |
| 784 | + | |
| 785 | + | |
765 | 786 | | |
766 | 787 | | |
767 | 788 | | |
768 | 789 | | |
769 | 790 | | |
770 | | - | |
| 791 | + | |
| 792 | + | |
771 | 793 | | |
772 | 794 | | |
773 | 795 | | |
| |||
0 commit comments