-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OE clicking and awaiting the expansion calls #6761
Conversation
src/sql/workbench/parts/objectExplorer/browser/treeSelectionHandler.ts
Outdated
Show resolved
Hide resolved
} | ||
this._lastClicked = specificSelection; | ||
this._lastClicked = selection; | ||
} | ||
|
||
this._clickTimer = setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make more sense to just move the setTiemout to the if mouse event since for other selection types (keyboard) we don't want to use this timeout method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah. Do we want to treat a keyboard selection as a full double click?
} | ||
this._lastClicked = specificSelection; | ||
this._lastClicked = selection; | ||
} | ||
|
||
this._clickTimer = setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vscode also has a class for wrapping timeouts, https://github.com/microsoft/azuredatastudio/blob/master/src/vs/base/common/async.ts#L496 if you want to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oo this looks good!
Before this we call the expand/refresh/expandAll codepoints without awaiting their response. This was causing random issues and race conditions with our code depending on how fast you clicked.