Fix/highlight correct item (#11016)

* get children of unexpanded books

* highlight item inside collapsed parent in treeView

* fix path issue on windows

* refactor common code into separate func

* refactor
This commit is contained in:
Maddy
2020-06-24 13:44:50 -07:00
committed by GitHub
parent c2ef27cd68
commit 561b881200
2 changed files with 45 additions and 18 deletions

View File

@@ -15,7 +15,7 @@ import { IExtensionApi, IPackageManageProvider } from './types';
import { CellType } from './contracts/content';
import { NotebookUriHandler } from './protocol/notebookUriHandler';
import { BookTreeViewProvider } from './book/bookTreeView';
import { NavigationProviders } from './common/constants';
import { NavigationProviders, BuiltInCommands, unsavedBooksContextKey } from './common/constants';
const localize = nls.loadMessageBundle();
@@ -128,7 +128,14 @@ export async function activate(extensionContext: vscode.ExtensionContext): Promi
} else {
bookTreeViewProvider.revealActiveDocumentInViewlet(e.document.uri, false);
}
});
azdata.nb.onDidOpenNotebookDocument(async e => {
if (e.uri.scheme === 'untitled') {
await vscode.commands.executeCommand(BuiltInCommands.SetContext, unsavedBooksContextKey, true);
} else {
await vscode.commands.executeCommand(BuiltInCommands.SetContext, unsavedBooksContextKey, false);
}
});
return {