1import {Disposable, DisposableStack} from '../base/disposable'; 2 3import {globals} from './globals'; 4import {NotesManager} from './notes_manager'; 5import {NotesEditorTab} from './notes_panel'; 6 7/** 8 * Registers with the tab manager to show notes details panels when notes are 9 * selected. 10 * 11 * Notes are core functionality thus don't really belong in a plugin. 12 */ 13export class Notes implements Disposable { 14 private trash = new DisposableStack(); 15 16 constructor() { 17 this.trash.use( 18 globals.tabManager.registerDetailsPanel(new NotesEditorTab()), 19 ); 20 21 this.trash.use( 22 globals.tabManager.registerTab({ 23 uri: 'notes.manager', 24 isEphemeral: false, 25 content: { 26 getTitle: () => 'Notes & markers', 27 render: () => m(NotesManager), 28 }, 29 }), 30 ); 31 } 32 33 dispose(): void { 34 this.trash.dispose(); 35 } 36} 37