mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-21 04:20:11 -04:00
This reverts commit d15a3fcc98.
This commit is contained in:
@@ -45,14 +45,13 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
||||
this._futureFixes.cancel();
|
||||
}
|
||||
}));
|
||||
this._register(dom.addStandardDisposableListener(this._domNode, 'mousedown', e => {
|
||||
this._register(dom.addStandardDisposableListener(this._domNode, 'click', e => {
|
||||
if (this._state.type !== CodeActionsState.Type.Triggered) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure that focus / cursor location is not lost when clicking widget icon
|
||||
this._editor.focus();
|
||||
dom.EventHelper.stop(e, true);
|
||||
// a bit of extra work to make sure the menu
|
||||
// doesn't cover the line-text
|
||||
const { top, height } = dom.getDomNodePagePosition(this._domNode);
|
||||
@@ -107,8 +106,9 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
||||
return this._position;
|
||||
}
|
||||
|
||||
tryShow(newState: CodeActionsState.Triggered) {
|
||||
if (this._position && (!newState.position || this._position.position && this._position.position.lineNumber !== newState.position.lineNumber)) {
|
||||
tryShow(newState: CodeActionsState.State) {
|
||||
|
||||
if (newState.type !== CodeActionsState.Type.Triggered || this._position && (!newState.position || this._position.position && this._position.position.lineNumber !== newState.position.lineNumber)) {
|
||||
// hide when getting a 'hide'-request or when currently
|
||||
// showing on another line
|
||||
this.hide();
|
||||
@@ -121,6 +121,10 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
||||
const { token } = this._futureFixes;
|
||||
this._state = newState;
|
||||
|
||||
if (this._state.type === CodeActionsState.Empty.type) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selection = this._state.rangeOrSelection;
|
||||
this._state.actions.then(fixes => {
|
||||
if (!token.isCancellationRequested && fixes.actions.length > 0 && selection) {
|
||||
|
||||
Reference in New Issue
Block a user