Clean up coverage and fix issue with notebook names (#10826)

* Clean up coverage and fix issue with notebook names

* update name
This commit is contained in:
Charles Gagnon
2020-06-10 13:44:38 -07:00
committed by GitHub
parent d849ed9357
commit dff43687e2
6 changed files with 200 additions and 141 deletions

View File

@@ -8,6 +8,7 @@ import * as fs from 'fs-extra';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as azdata from 'azdata';
import { notebookLanguages } from './constants';
const localize = nls.loadMessageBundle();
@@ -189,7 +190,8 @@ export function sortPackageVersions(versions: string[], ascending: boolean = tru
}
export function isEditorTitleFree(title: string): boolean {
let hasTextDoc = vscode.workspace.textDocuments.findIndex(doc => doc.isUntitled && doc.fileName === title) > -1;
let hasTextDoc = vscode.workspace.textDocuments.findIndex(doc => doc.isUntitled && doc.fileName === title && !notebookLanguages.find(lang => lang === doc.languageId)) > -1;
let hasNotebookDoc = azdata.nb.notebookDocuments.findIndex(doc => doc.isUntitled && doc.fileName === title) > -1;
return !hasTextDoc && !hasNotebookDoc;
}