-
Notifications
You must be signed in to change notification settings - Fork 882
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
Switch query events to just send ranges instead of full query text #19823
Conversation
|
||
public set uri(newUri: string) { | ||
this.queryRunner.uri = newUri; | ||
this.dataService.uri = newUri; | ||
if (this.queryRunner) { |
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.
While I was here fixed these as well since we're not guaranteed to have them exist when this is called
Pull Request Test Coverage Report for Build 2557389573
💛 - Coveralls |
if (this._captureEnabled && queryInfo && type === 'queryStop') { | ||
const queryText = queryInfo.queryText ?? ''; | ||
const textDocuments = vscode.workspace.textDocuments; | ||
const textDocument = textDocuments.find(e => e.uri.toString() === vscode.Uri.parse(document.uri).toString()); |
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.
so, are e.uri.toString()
and document.uri
different?
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.
Probably not, but I wanted to be absolutely sure - hence the parsing to Uri and then toString'ing that
Sending over the entire query text each time has perf implications - and it turns out there's no need for this since the extension can just get the text from the range directly. The extension host keeps its own copy of the text documents locally so it doesn't have go ever go outside of the process when doing it this way. This allowed me to greatly simplify the event logic as well.
Note that there are still perf issues with executing queries for large documents (I started hitting issues in the 100MB range). But I didn't see any noticeable impact from having these events firing (even with query history enabled) compared to stable ADS.