Skip to content

Commit 7576d5c

Browse files
committed
Added "Reload examples" command
Signed-off-by: Seb Julliand <[email protected]>
1 parent 03f3045 commit 7576d5c

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

package.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@
7575
"type": "string",
7676
"description": "SQL formatting options: Lowercase or uppercase SQL identifiers",
7777
"default": "preserve",
78-
"enum": ["lower", "upper", "preserve"],
78+
"enum": [
79+
"lower",
80+
"upper",
81+
"preserve"
82+
],
7983
"enumDescriptions": [
8084
"Format SQL identifiers in lowercase",
8185
"Format SQL identifiers in uppercase",
@@ -86,7 +90,10 @@
8690
"type": "string",
8791
"description": "SQL formatting options: Lowercase or uppercase SQL keywords",
8892
"default": "lower",
89-
"enum": ["lower", "upper"],
93+
"enum": [
94+
"lower",
95+
"upper"
96+
],
9097
"enumDescriptions": [
9198
"Format reserved SQL keywords in lowercase",
9299
"Format reserved SQL keywords in uppercase"
@@ -291,6 +298,12 @@
291298
"category": "Db2 for i (Examples)",
292299
"icon": "$(clear-all)"
293300
},
301+
{
302+
"command": "vscode-db2i.examples.reload",
303+
"title": "Reload examples",
304+
"category": "Db2 for i",
305+
"icon": "$(sync)"
306+
},
294307
{
295308
"command": "vscode-db2i.jobManager.newJob",
296309
"title": "New SQL Job",
@@ -420,6 +433,10 @@
420433
{
421434
"command": "vscode-db2i.jobManager.deleteConfig",
422435
"when": "never"
436+
},
437+
{
438+
"command": "vscode-db2i.examples.reload",
439+
"when": "never"
423440
}
424441
],
425442
"editor/context": [
@@ -466,7 +483,12 @@
466483
"command": "vscode-db2i.examples.clearFilter",
467484
"group": "navigation",
468485
"when": "view == exampleBrowser"
469-
},
486+
},
487+
{
488+
"command": "vscode-db2i.examples.reload",
489+
"group": "navigation@99",
490+
"when": "view == exampleBrowser"
491+
},
470492
{
471493
"command": "vscode-db2i.openSqlDocument",
472494
"group": "navigation",
@@ -646,4 +668,4 @@
646668
"sql-formatter": "^14.0.0",
647669
"lru-cache": "^6.0.0"
648670
}
649-
}
671+
}

src/views/examples/exampleBrowser.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export class ExampleBrowser implements TreeDataProvider<any> {
3838
commands.registerCommand(`vscode-db2i.examples.clearFilter`, async () => {
3939
this.currentFilter = undefined;
4040
this.refresh();
41+
}),
42+
43+
commands.registerCommand("vscode-db2i.examples.reload", () => {
44+
delete Examples[ServiceInfoLabel];
45+
this.refresh();
4146
})
4247
);
4348

0 commit comments

Comments
 (0)