mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 17:22:55 -05:00
Fix/prev next links issue (#10523)
* intital test code * added tests * remove commented code * fix for failing tests * reuse exported enum * changes to address comments * add back onVisibility highlight * port highlight fix from Chris * fix tests
This commit is contained in:
@@ -10,7 +10,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
|
||||
import {
|
||||
INotebookService, INotebookManager, INotebookProvider,
|
||||
DEFAULT_NOTEBOOK_FILETYPE, INotebookEditor, SQL_NOTEBOOK_PROVIDER, INavigationProvider, ILanguageMagic
|
||||
DEFAULT_NOTEBOOK_FILETYPE, INotebookEditor, SQL_NOTEBOOK_PROVIDER, INavigationProvider, ILanguageMagic, NavigationProviders, unsavedBooksContextKey
|
||||
} from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { RenderMimeRegistry } from 'sql/workbench/services/notebook/browser/outputs/registry';
|
||||
import { standardRendererFactories } from 'sql/workbench/services/notebook/browser/outputs/factories';
|
||||
@@ -36,6 +36,7 @@ import { NotebookChangeType } from 'sql/workbench/services/notebook/common/contr
|
||||
import { find, firstIndex } from 'vs/base/common/arrays';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { notebookConstants } from 'sql/workbench/services/notebook/browser/interfaces';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
||||
export interface NotebookProviderProperties {
|
||||
provider: string;
|
||||
@@ -115,7 +116,8 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IFileService private readonly _fileService: IFileService,
|
||||
@ILogService private readonly _logService: ILogService,
|
||||
@IQueryManagementService private readonly _queryManagementService: IQueryManagementService
|
||||
@IQueryManagementService private readonly _queryManagementService: IQueryManagementService,
|
||||
@IContextKeyService private contextKeyService: IContextKeyService,
|
||||
) {
|
||||
super();
|
||||
this._providersMemento = new Memento('notebookProviders', this._storageService);
|
||||
@@ -220,7 +222,11 @@ export class NotebookService extends Disposable implements INotebookService {
|
||||
}
|
||||
|
||||
getNavigationProvider(): INavigationProvider {
|
||||
let provider = this._navigationProviders.size > 0 ? this._navigationProviders.values().next().value : undefined;
|
||||
let provider;
|
||||
if (this._navigationProviders.size > 0) {
|
||||
const providerName = this.contextKeyService.getContextKeyValue(unsavedBooksContextKey) ? NavigationProviders.ProvidedBooksNavigator : NavigationProviders.NotebooksNavigator;
|
||||
provider = this._navigationProviders.get(providerName);
|
||||
}
|
||||
return provider;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user