mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Nb/show notebooks as untitled (#6376)
* open notebooks as untitled files and removed the saving to home directory * return just filename without extension since save is adding the .ipynb ext * Changes to open bdc notebooks as untitled docs. Updated tests to align with the changes * changes: not to show untitled file as dirty and cleaned up tests in notebookService * changes to address untitled name conflicts with open editors. * comment cleanup
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as vscode from 'vscode';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
/**
|
||||
* Abstract of platform dependencies
|
||||
@@ -16,6 +17,7 @@ export interface IPlatformService {
|
||||
fileExists(file: string): boolean;
|
||||
openFile(filePath: string): void;
|
||||
showErrorMessage(message: string): void;
|
||||
isNotebookNameUsed(title: string): boolean;
|
||||
}
|
||||
|
||||
export class PlatformService implements IPlatformService {
|
||||
@@ -38,4 +40,8 @@ export class PlatformService implements IPlatformService {
|
||||
showErrorMessage(message: string): void {
|
||||
vscode.window.showErrorMessage(message);
|
||||
}
|
||||
|
||||
isNotebookNameUsed(title: string): boolean {
|
||||
return (azdata.nb.notebookDocuments.findIndex(doc => doc.isUntitled && doc.fileName === title) > -1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user