mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix New Notebook issues (#5958)
* Fix New Notebook issues - Fix #5338 New Notebook menu item should be next to New Query - Fix #4936 Add a shortcut to create a notebook in the document well Created a built-in New Notebook command that routes to the existing extension-based command. This avoided a rearchitecture that was more complex that seemed worth it. Per VSCode patterns, used a _ modifier for the existing command so it's "private"
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
"title": "%notebook.analyzeJupyterNotebook%"
|
||||
},
|
||||
{
|
||||
"command": "notebook.command.new",
|
||||
"command": "_notebook.command.new",
|
||||
"title": "%notebook.command.new%",
|
||||
"icon": {
|
||||
"dark": "resources/dark/new_notebook_inverse.svg",
|
||||
@@ -145,7 +145,8 @@
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "notebook.command.new"
|
||||
"command": "_notebook.command.new",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "notebook.command.open"
|
||||
@@ -204,11 +205,6 @@
|
||||
}
|
||||
],
|
||||
"objectExplorer/item/context": [
|
||||
{
|
||||
"command": "notebook.command.new",
|
||||
"when": "isQueryProvider && nodeType == Server",
|
||||
"group": "1root@1"
|
||||
},
|
||||
{
|
||||
"command": "notebook.command.analyzeNotebook",
|
||||
"when": "nodeType=~/^mssqlCluster/ && nodeLabel=~/[^\\s]+(\\.(csv|tsv|txt))$/ && nodeType == mssqlCluster:file",
|
||||
@@ -233,10 +229,6 @@
|
||||
]
|
||||
},
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "notebook.command.new",
|
||||
"key": "Ctrl+Shift+N"
|
||||
},
|
||||
{
|
||||
"command": "notebook.command.runactivecell",
|
||||
"key": "F5",
|
||||
|
||||
@@ -25,7 +25,7 @@ let controller: JupyterController;
|
||||
type ChooseCellType = { label: string, id: CellType };
|
||||
|
||||
export async function activate(extensionContext: vscode.ExtensionContext): Promise<IExtensionApi> {
|
||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('notebook.command.new', (context?: azdata.ConnectedContext) => {
|
||||
extensionContext.subscriptions.push(vscode.commands.registerCommand('_notebook.command.new', (context?: azdata.ConnectedContext) => {
|
||||
let connectionProfile: azdata.IConnectionProfile = undefined;
|
||||
if (context && context.connectionProfile) {
|
||||
connectionProfile = context.connectionProfile;
|
||||
|
||||
Reference in New Issue
Block a user