Skip to content

Commit

Permalink
passing tests, but TS error
Browse files Browse the repository at this point in the history
  • Loading branch information
justschen committed Apr 1, 2024
1 parent a2f7e04 commit ee71421
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/vs/editor/contrib/codeAction/browser/codeAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ export async function getCodeActions(
...coalesce(actions.map(x => x.documentation)),
...getAdditionalDocumentationForShowingActions(registry, model, trigger, allActions)
];
const result = new ManagedCodeActionSet(allActions, allDocumentation, disposables);
result.dispose();
return result;
return new ManagedCodeActionSet(allActions, allDocumentation, disposables);
} finally {
listener.dispose();
cts.dispose();
Expand Down
7 changes: 5 additions & 2 deletions src/vs/editor/contrib/codeAction/browser/codeActionModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class CodeActionModel extends Disposable {
const supportedActions: string[] = this._registry.all(model).flatMap(provider => provider.providedCodeActionKinds ?? []);
this._supportedCodeActions.set(supportedActions.join(' '));

this._codeActionOracle.value = new CodeActionOracle(this._editor, this._markerService, trigger => {
this._codeActionOracle.value = new CodeActionOracle(this._editor, this._markerService, async trigger => {
if (!trigger) {
this.setState(CodeActionsState.Empty);
return;
Expand Down Expand Up @@ -315,7 +315,8 @@ export class CodeActionModel extends Disposable {
}
}
}
// temporarilly hiding here as this is enabled/disabled behind a setting.

// This is for case where setting for nearby quickfixes is off.
return getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token);
});
if (trigger.trigger.type === CodeActionTriggerType.Invoke) {
Expand All @@ -335,6 +336,8 @@ export class CodeActionModel extends Disposable {
if (!isManualToAutoTransition) {
this.setState(newState);
}
const toDisposeActions = await actions;
toDisposeActions.dispose();
}, undefined);
this._codeActionOracle.value.trigger({ type: CodeActionTriggerType.Auto, triggerAction: CodeActionTriggerSource.Default });
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import * as assert from 'assert';
import { promiseWithResolvers } from 'vs/base/common/async';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { assertType } from 'vs/base/common/types';
import { URI } from 'vs/base/common/uri';
import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler';
Expand Down

0 comments on commit ee71421

Please sign in to comment.