only show new query when query is supported (#17346)

* only show new query when query is supported

* test case fix and pr comments

* rename context key
This commit is contained in:
Alan Ren
2021-10-13 13:01:31 -07:00
committed by GitHub
parent 547ceba501
commit 156f8f1d5f
13 changed files with 66 additions and 20 deletions

View File

@@ -134,7 +134,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
id: OE_NEW_NOTEBOOK_COMMAND_ID,
title: localize('newQuery', "New Notebook")
},
when: ContextKeyExpr.or(ContextKeyExpr.and(TreeNodeContextKey.Status.notEqualsTo('Unavailable'), TreeNodeContextKey.NodeType.isEqualTo('Server')), ContextKeyExpr.and(TreeNodeContextKey.Status.notEqualsTo('Unavailable'), TreeNodeContextKey.NodeType.isEqualTo('Database')))
when: ContextKeyExpr.and(TreeNodeContextKey.Status.notEqualsTo('Unavailable'), TreeNodeContextKey.IsQueryProvider.isEqualTo(true), ContextKeyExpr.or(TreeNodeContextKey.NodeType.isEqualTo('Server'), TreeNodeContextKey.NodeType.isEqualTo('Database')))
});
const ExplorerNotebookActionID = 'explorer.notebook';