Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)

* Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d

* Fix vs unit tests and hygiene issue

* Fix strict null check issue
This commit is contained in:
Chris LaFreniere
2019-06-10 18:27:09 -07:00
committed by GitHub
parent ff38bc8143
commit d15a3fcc98
926 changed files with 19529 additions and 11383 deletions

View File

@@ -45,13 +45,14 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
this._futureFixes.cancel();
}
}));
this._register(dom.addStandardDisposableListener(this._domNode, 'click', e => {
this._register(dom.addStandardDisposableListener(this._domNode, 'mousedown', 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);
@@ -106,9 +107,8 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
return this._position;
}
tryShow(newState: CodeActionsState.State) {
if (newState.type !== CodeActionsState.Type.Triggered || this._position && (!newState.position || this._position.position && this._position.position.lineNumber !== newState.position.lineNumber)) {
tryShow(newState: CodeActionsState.Triggered) {
if (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,10 +121,6 @@ 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) {