mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
QueryEvent range -> batchRanges (#19890)
* Switch query events to just send ranges instead of full query text * undo azdata changes * fix type * comment + remove unneeded ? * range -> batchRanges * undo
This commit is contained in:
@@ -36,7 +36,7 @@ export class QueryHistoryProvider implements vscode.TreeDataProvider<QueryHistor
|
||||
return;
|
||||
}
|
||||
// Combine all the text from the batches back together
|
||||
const queryText = queryInfo.range.map(r => textDocument.getText(r) ?? '').join(EOL);
|
||||
const queryText = queryInfo.batchRanges.map(r => textDocument.getText(r) ?? '').join(EOL);
|
||||
const connProfile = await azdata.connection.getConnection(document.uri);
|
||||
const isError = queryInfo.messages.find(m => m.isError) ? false : true;
|
||||
// Add to the front of the list so the new item appears at the top
|
||||
|
||||
2
src/sql/azdata.proposed.d.ts
vendored
2
src/sql/azdata.proposed.d.ts
vendored
@@ -1568,7 +1568,7 @@ declare module 'azdata' {
|
||||
/**
|
||||
* The ranges for each batch that has executed so far
|
||||
*/
|
||||
range: vscode.Range[];
|
||||
batchRanges: vscode.Range[];
|
||||
}
|
||||
|
||||
export interface QueryEventListener {
|
||||
|
||||
@@ -15,7 +15,7 @@ export namespace QueryInfo {
|
||||
}
|
||||
return {
|
||||
messages: queryInfo.messages,
|
||||
range: queryInfo.range.map(r => typeConverters.Range.to(r))
|
||||
batchRanges: queryInfo.batchRanges.map(r => typeConverters.Range.to(r))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export interface IExecutionPlanInfo {
|
||||
}
|
||||
|
||||
export interface IQueryInfo {
|
||||
range: IRange[];
|
||||
batchRanges: IRange[];
|
||||
messages: IQueryMessage[];
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export class QueryInfo {
|
||||
public queryRunner?: EditQueryRunner;
|
||||
public dataService?: DataService;
|
||||
public queryEventQueue: QueryEvent[] = [];
|
||||
public range: Array<IRange> = [];
|
||||
public batchRanges: Array<IRange> = [];
|
||||
public selectionSnippet?: string;
|
||||
|
||||
// Notes if the angular components have obtained the DataService. If not, all messages sent
|
||||
@@ -228,7 +228,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
|
||||
// If the query is not in progress, we can reuse the query runner
|
||||
queryRunner = existingRunner!;
|
||||
info.range = [];
|
||||
info.batchRanges = [];
|
||||
info.selectionSnippet = undefined;
|
||||
} else {
|
||||
// We do not have a query runner for this editor, so create a new one
|
||||
@@ -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.batchRanges.push(b.range);
|
||||
}
|
||||
let message = {
|
||||
message: messageText,
|
||||
@@ -293,7 +293,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
uri: queryRunner.uri,
|
||||
queryInfo:
|
||||
{
|
||||
range: info.range,
|
||||
batchRanges: info.batchRanges,
|
||||
messages: info.queryRunner!.messages
|
||||
}
|
||||
};
|
||||
@@ -311,7 +311,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
uri: queryRunner.uri,
|
||||
queryInfo:
|
||||
{
|
||||
range: info.range,
|
||||
batchRanges: info.batchRanges,
|
||||
messages: info.queryRunner!.messages
|
||||
}
|
||||
};
|
||||
@@ -327,7 +327,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
uri: queryRunner.uri,
|
||||
queryInfo:
|
||||
{
|
||||
range: info.range,
|
||||
batchRanges: info.batchRanges,
|
||||
messages: info.queryRunner!.messages
|
||||
}
|
||||
};
|
||||
@@ -343,7 +343,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
uri: planInfo.fileUri,
|
||||
queryInfo:
|
||||
{
|
||||
range: info.range,
|
||||
batchRanges: info.batchRanges,
|
||||
messages: info.queryRunner!.messages
|
||||
},
|
||||
params: planInfo
|
||||
@@ -358,7 +358,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
uri: qp2Info.fileUri,
|
||||
queryInfo:
|
||||
{
|
||||
range: info.range,
|
||||
batchRanges: info.batchRanges,
|
||||
messages: info.queryRunner!.messages
|
||||
},
|
||||
params: qp2Info.planGraphs
|
||||
@@ -372,7 +372,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
uri: queryRunner.uri,
|
||||
queryInfo:
|
||||
{
|
||||
range: info.range,
|
||||
batchRanges: info.batchRanges,
|
||||
messages: info.queryRunner!.messages
|
||||
},
|
||||
params: resultSetInfo
|
||||
@@ -514,7 +514,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
uri: ownerUri,
|
||||
queryInfo:
|
||||
{
|
||||
range: info.range,
|
||||
batchRanges: info.batchRanges,
|
||||
messages: info.queryRunner!.messages
|
||||
},
|
||||
};
|
||||
@@ -531,7 +531,7 @@ export class QueryModelService implements IQueryModelService {
|
||||
uri: ownerUri,
|
||||
queryInfo:
|
||||
{
|
||||
range: info.range,
|
||||
batchRanges: info.batchRanges,
|
||||
messages: info.queryRunner!.messages
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user