提交 d5913e54 编写于 作者: M Matt Bierner

Always show the code action light bulb if quick fixes or refactorings are available

Fixes #61642

Remove logic added by ab77235b. The original concern was that we would end up showing the light bulb too often but its not sure this will be a problem in practice.
上级 edce7e2b
......@@ -11,7 +11,6 @@ import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import 'vs/css!./lightBulbWidget';
import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';
import { TextModel } from 'vs/editor/common/model/textModel';
import { CodeActionKind } from 'vs/editor/contrib/codeAction/codeActionTrigger';
import { CodeActionsComputeEvent } from './codeActionModel';
export class LightBulbWidget implements IDisposable, IContentWidget {
......@@ -122,12 +121,8 @@ export class LightBulbWidget implements IDisposable, IContentWidget {
const selection = this._model.rangeOrSelection;
this._model.actions.then(fixes => {
if (!token.isCancellationRequested && fixes && fixes.length > 0) {
if (!selection || selection.isEmpty() && fixes.every(fix => !!(fix.kind && CodeActionKind.Refactor.contains(fix.kind)))) {
this.hide();
} else {
this._show();
}
if (!token.isCancellationRequested && fixes && fixes.length > 0 && selection) {
this._show();
} else {
this.hide();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册