MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / runNewPythonFile

Function runNewPythonFile

src/test/datascience/helpers.ts:174–184  ·  view source on GitHub ↗
(
    interactiveWindowProvider: IInteractiveWindowProvider,
    source: string,
    disposables: vscode.Disposable[]
)

Source from the content-addressed store, hash-verified

172}
173
174export async function runNewPythonFile(
175 interactiveWindowProvider: IInteractiveWindowProvider,
176 source: string,
177 disposables: vscode.Disposable[]
178) {
179 const tempFile = await createTemporaryFile({ contents: source, extension: '.py' });
180 disposables.push(tempFile);
181 const untitledPythonFile = await vscode.workspace.openTextDocument(tempFile.file);
182 const activeInteractiveWindow = await runCurrentFile(interactiveWindowProvider, untitledPythonFile);
183 return { activeInteractiveWindow, untitledPythonFile };
184}
185
186export async function runCurrentFile(interactiveWindowProvider: IInteractiveWindowProvider, file: vscode.TextDocument) {
187 await vscode.window.showTextDocument(file, vscode.ViewColumn.One);

Calls 4

createTemporaryFileFunction · 0.90
runCurrentFileFunction · 0.85
openTextDocumentMethod · 0.80
pushMethod · 0.65

Tested by

no test coverage detected