Revert "Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)" (#5983)

This reverts commit d15a3fcc98.
This commit is contained in:
Karl Burtram
2019-06-11 12:35:58 -07:00
committed by GitHub
parent 95a50b7892
commit 5a7562a37b
926 changed files with 11394 additions and 19540 deletions

View File

@@ -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) {