-
Notifications
You must be signed in to change notification settings - Fork 883
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the Source EULA. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import type * as azdata from 'azdata'; | ||
import { IQueryInfo } from 'sql/workbench/services/query/common/queryModel'; | ||
import * as typeConverters from 'vs/workbench/api/common/extHostTypeConverters'; | ||
|
||
export namespace QueryInfo { | ||
|
||
export function to(queryInfo: IQueryInfo | undefined): azdata.queryeditor.QueryInfo | undefined { | ||
if (!queryInfo) { | ||
return undefined; | ||
} | ||
return { | ||
messages: queryInfo.messages, | ||
range: queryInfo.range.map(r => typeConverters.Range.to(r)) | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,23 +35,23 @@ export interface QueryEvent { | |
export class QueryInfo { | ||
public queryRunner?: EditQueryRunner; | ||
public dataService?: DataService; | ||
public queryEventQueue?: QueryEvent[]; | ||
public range?: Array<IRange>; | ||
public queryEventQueue: QueryEvent[] = []; | ||
public range: Array<IRange> = []; | ||
public selectionSnippet?: string; | ||
|
||
// Notes if the angular components have obtained the DataService. If not, all messages sent | ||
// via the data service will be lost. | ||
public dataServiceReady?: boolean; | ||
public dataServiceReady: boolean = false; | ||
|
||
constructor() { | ||
this.dataServiceReady = false; | ||
this.queryEventQueue = []; | ||
this.range = []; | ||
} | ||
constructor() { } | ||
|
||
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 commentThe 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 |
||
this.queryRunner.uri = newUri; | ||
} | ||
if (this.dataService) { | ||
this.dataService.uri = newUri; | ||
} | ||
} | ||
} | ||
|
||
|
@@ -271,7 +271,7 @@ export class QueryModelService implements IQueryModelService { | |
text: strings.format(nls.localize('runQueryBatchStartLine', "Line {0}"), b.range.startLineNumber) | ||
}; | ||
} | ||
info.range!.push(b.range); | ||
info.range.push(b.range); | ||
} | ||
let message = { | ||
message: messageText, | ||
|
@@ -293,7 +293,7 @@ export class QueryModelService implements IQueryModelService { | |
uri: queryRunner.uri, | ||
queryInfo: | ||
{ | ||
range: info.range!, | ||
range: info.range, | ||
messages: info.queryRunner!.messages | ||
} | ||
}; | ||
|
@@ -311,7 +311,7 @@ export class QueryModelService implements IQueryModelService { | |
uri: queryRunner.uri, | ||
queryInfo: | ||
{ | ||
range: info.range!, | ||
range: info.range, | ||
messages: info.queryRunner!.messages | ||
} | ||
}; | ||
|
@@ -327,7 +327,7 @@ export class QueryModelService implements IQueryModelService { | |
uri: queryRunner.uri, | ||
queryInfo: | ||
{ | ||
range: info.range!, | ||
range: info.range, | ||
messages: info.queryRunner!.messages | ||
} | ||
}; | ||
|
@@ -343,7 +343,7 @@ export class QueryModelService implements IQueryModelService { | |
uri: planInfo.fileUri, | ||
queryInfo: | ||
{ | ||
range: info.range!, | ||
range: info.range, | ||
messages: info.queryRunner!.messages | ||
}, | ||
params: planInfo | ||
|
@@ -358,7 +358,7 @@ export class QueryModelService implements IQueryModelService { | |
uri: qp2Info.fileUri, | ||
queryInfo: | ||
{ | ||
range: info.range!, | ||
range: info.range, | ||
messages: info.queryRunner!.messages | ||
}, | ||
params: qp2Info.planGraphs | ||
|
@@ -372,7 +372,7 @@ export class QueryModelService implements IQueryModelService { | |
uri: queryRunner.uri, | ||
queryInfo: | ||
{ | ||
range: info.range!, | ||
range: info.range, | ||
messages: info.queryRunner!.messages | ||
}, | ||
params: resultSetInfo | ||
|
@@ -514,7 +514,7 @@ export class QueryModelService implements IQueryModelService { | |
uri: ownerUri, | ||
queryInfo: | ||
{ | ||
range: info.range!, | ||
range: info.range, | ||
messages: info.queryRunner!.messages | ||
}, | ||
}; | ||
|
@@ -531,7 +531,7 @@ export class QueryModelService implements IQueryModelService { | |
uri: ownerUri, | ||
queryInfo: | ||
{ | ||
range: info.range!, | ||
range: info.range, | ||
messages: info.queryRunner!.messages | ||
}, | ||
}; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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()
anddocument.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