File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import { CompositeDisposable , TextEditor } from "atom"
2+ import type { Disposable } from "atom"
23import { OutlineView } from "./outlineView"
34import type { OutlineProvider } from "atom-ide-base"
45import { ProviderRegistry } from "atom-ide-base/commons-atom/ProviderRegistry"
@@ -56,16 +57,20 @@ export function deactivate() {
5657// subscriptions.add(busySignalProvider)
5758// }
5859
59- export async function consumeOutlineProvider ( provider : OutlineProvider ) {
60- subscriptions . add ( /* providerRegistryEntry */ outlineProviderRegistry . addProvider ( provider ) )
60+ export function consumeOutlineProvider ( provider : OutlineProvider ) : Disposable {
61+ const prividerDisposable = outlineProviderRegistry . addProvider ( provider )
62+ subscriptions . add ( /* providerRegistryEntry */ prividerDisposable )
6163
6264 // NOTE Generate (try) an outline after obtaining a provider for the current active editor
6365 // this initial outline is always rendered no matter if it is visible or not,
6466 // this is because we can't track if the outline tab becomes visible suddenly later,
6567 // or if the editor changes later once outline is visible
6668 // so we need to have an outline for the current editor
6769 // the following updates rely on the visibility
68- await getOutline ( )
70+ getOutline ( ) . catch ( ( err ) => {
71+ throw err
72+ } )
73+ return prividerDisposable
6974}
7075
7176// disposables returned inside onEditorChangedDisposable
You can’t perform that action at this time.
0 commit comments