mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Initial implementation for VSCode Notebook support (#17885)
This commit is contained in:
@@ -10,6 +10,9 @@ import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
const NBFORMAT = 4;
|
||||
const NBFORMAT_MINOR = 2;
|
||||
|
||||
export class CellTypes {
|
||||
public static readonly Code = 'code';
|
||||
public static readonly Markdown = 'markdown';
|
||||
@@ -29,8 +32,8 @@ export const pySparkNotebookContent: azdata.nb.INotebookContents = {
|
||||
display_name: 'PySpark'
|
||||
}
|
||||
},
|
||||
nbformat: 4,
|
||||
nbformat_minor: 2
|
||||
nbformat: NBFORMAT,
|
||||
nbformat_minor: NBFORMAT_MINOR
|
||||
};
|
||||
|
||||
export const notebookContentForCellLanguageTest: azdata.nb.INotebookContents = {
|
||||
@@ -46,8 +49,8 @@ export const notebookContentForCellLanguageTest: azdata.nb.INotebookContents = {
|
||||
display_name: ''
|
||||
},
|
||||
},
|
||||
nbformat: 4,
|
||||
nbformat_minor: 2
|
||||
nbformat: NBFORMAT,
|
||||
nbformat_minor: NBFORMAT_MINOR
|
||||
};
|
||||
|
||||
export const pythonNotebookMultipleCellsContent: azdata.nb.INotebookContents = {
|
||||
@@ -78,8 +81,8 @@ export const pythonNotebookMultipleCellsContent: azdata.nb.INotebookContents = {
|
||||
display_name: 'Python 3'
|
||||
}
|
||||
},
|
||||
nbformat: 4,
|
||||
nbformat_minor: 2
|
||||
nbformat: NBFORMAT,
|
||||
nbformat_minor: NBFORMAT_MINOR
|
||||
};
|
||||
|
||||
export const sqlNotebookContent: azdata.nb.INotebookContents = {
|
||||
@@ -95,8 +98,8 @@ export const sqlNotebookContent: azdata.nb.INotebookContents = {
|
||||
display_name: 'SQL'
|
||||
}
|
||||
},
|
||||
nbformat: 4,
|
||||
nbformat_minor: 2
|
||||
nbformat: NBFORMAT,
|
||||
nbformat_minor: NBFORMAT_MINOR
|
||||
};
|
||||
|
||||
export const sqlNotebookMultipleCellsContent: azdata.nb.INotebookContents = {
|
||||
@@ -122,8 +125,8 @@ export const sqlNotebookMultipleCellsContent: azdata.nb.INotebookContents = {
|
||||
display_name: 'SQL'
|
||||
}
|
||||
},
|
||||
nbformat: 4,
|
||||
nbformat_minor: 2
|
||||
nbformat: NBFORMAT,
|
||||
nbformat_minor: NBFORMAT_MINOR
|
||||
};
|
||||
|
||||
export const pySparkKernelMetadata = {
|
||||
|
||||
@@ -93,3 +93,7 @@ export const SQL_PROVIDER = 'MSSQL';
|
||||
export const USER = 'user';
|
||||
export const AUTHTYPE = 'authenticationType';
|
||||
export const INTEGRATED_AUTH = 'integrated';
|
||||
|
||||
// The version of the notebook file format that we support
|
||||
export const NBFORMAT = 4;
|
||||
export const NBFORMAT_MINOR = 2;
|
||||
|
||||
@@ -885,8 +885,8 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
||||
name: 'python3'
|
||||
}
|
||||
},
|
||||
nbformat: 4,
|
||||
nbformat_minor: 5
|
||||
nbformat: constants.NBFORMAT,
|
||||
nbformat_minor: constants.NBFORMAT_MINOR
|
||||
};
|
||||
|
||||
await vscode.commands.executeCommand('_notebook.command.new', {
|
||||
|
||||
@@ -147,8 +147,8 @@ describe('Notebook URI Handler', function (): void {
|
||||
display_name: 'Python 3'
|
||||
}
|
||||
},
|
||||
nbformat: 4,
|
||||
nbformat_minor: 5
|
||||
nbformat: constants.NBFORMAT,
|
||||
nbformat_minor: constants.NBFORMAT_MINOR
|
||||
};
|
||||
|
||||
await fs.writeFile(notebookPath, JSON.stringify(notebookContent));
|
||||
|
||||
Reference in New Issue
Block a user