mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-07 01:25:38 -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;
|
return;
|
||||||
}
|
}
|
||||||
// Combine all the text from the batches back together
|
// 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 connProfile = await azdata.connection.getConnection(document.uri);
|
||||||
const isError = queryInfo.messages.find(m => m.isError) ? false : true;
|
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
|
// 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
|
* The ranges for each batch that has executed so far
|
||||||
*/
|
*/
|
||||||
range: vscode.Range[];
|
batchRanges: vscode.Range[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface QueryEventListener {
|
export interface QueryEventListener {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export namespace QueryInfo {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
messages: queryInfo.messages,
|
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 {
|
export interface IQueryInfo {
|
||||||
range: IRange[];
|
batchRanges: IRange[];
|
||||||
messages: IQueryMessage[];
|
messages: IQueryMessage[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export class QueryInfo {
|
|||||||
public queryRunner?: EditQueryRunner;
|
public queryRunner?: EditQueryRunner;
|
||||||
public dataService?: DataService;
|
public dataService?: DataService;
|
||||||
public queryEventQueue: QueryEvent[] = [];
|
public queryEventQueue: QueryEvent[] = [];
|
||||||
public range: Array<IRange> = [];
|
public batchRanges: Array<IRange> = [];
|
||||||
public selectionSnippet?: string;
|
public selectionSnippet?: string;
|
||||||
|
|
||||||
// Notes if the angular components have obtained the DataService. If not, all messages sent
|
// 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
|
// If the query is not in progress, we can reuse the query runner
|
||||||
queryRunner = existingRunner!;
|
queryRunner = existingRunner!;
|
||||||
info.range = [];
|
info.batchRanges = [];
|
||||||
info.selectionSnippet = undefined;
|
info.selectionSnippet = undefined;
|
||||||
} else {
|
} else {
|
||||||
// We do not have a query runner for this editor, so create a new one
|
// 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)
|
text: strings.format(nls.localize('runQueryBatchStartLine', "Line {0}"), b.range.startLineNumber)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
info.range.push(b.range);
|
info.batchRanges.push(b.range);
|
||||||
}
|
}
|
||||||
let message = {
|
let message = {
|
||||||
message: messageText,
|
message: messageText,
|
||||||
@@ -293,7 +293,7 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
uri: queryRunner.uri,
|
uri: queryRunner.uri,
|
||||||
queryInfo:
|
queryInfo:
|
||||||
{
|
{
|
||||||
range: info.range,
|
batchRanges: info.batchRanges,
|
||||||
messages: info.queryRunner!.messages
|
messages: info.queryRunner!.messages
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -311,7 +311,7 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
uri: queryRunner.uri,
|
uri: queryRunner.uri,
|
||||||
queryInfo:
|
queryInfo:
|
||||||
{
|
{
|
||||||
range: info.range,
|
batchRanges: info.batchRanges,
|
||||||
messages: info.queryRunner!.messages
|
messages: info.queryRunner!.messages
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -327,7 +327,7 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
uri: queryRunner.uri,
|
uri: queryRunner.uri,
|
||||||
queryInfo:
|
queryInfo:
|
||||||
{
|
{
|
||||||
range: info.range,
|
batchRanges: info.batchRanges,
|
||||||
messages: info.queryRunner!.messages
|
messages: info.queryRunner!.messages
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -343,7 +343,7 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
uri: planInfo.fileUri,
|
uri: planInfo.fileUri,
|
||||||
queryInfo:
|
queryInfo:
|
||||||
{
|
{
|
||||||
range: info.range,
|
batchRanges: info.batchRanges,
|
||||||
messages: info.queryRunner!.messages
|
messages: info.queryRunner!.messages
|
||||||
},
|
},
|
||||||
params: planInfo
|
params: planInfo
|
||||||
@@ -358,7 +358,7 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
uri: qp2Info.fileUri,
|
uri: qp2Info.fileUri,
|
||||||
queryInfo:
|
queryInfo:
|
||||||
{
|
{
|
||||||
range: info.range,
|
batchRanges: info.batchRanges,
|
||||||
messages: info.queryRunner!.messages
|
messages: info.queryRunner!.messages
|
||||||
},
|
},
|
||||||
params: qp2Info.planGraphs
|
params: qp2Info.planGraphs
|
||||||
@@ -372,7 +372,7 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
uri: queryRunner.uri,
|
uri: queryRunner.uri,
|
||||||
queryInfo:
|
queryInfo:
|
||||||
{
|
{
|
||||||
range: info.range,
|
batchRanges: info.batchRanges,
|
||||||
messages: info.queryRunner!.messages
|
messages: info.queryRunner!.messages
|
||||||
},
|
},
|
||||||
params: resultSetInfo
|
params: resultSetInfo
|
||||||
@@ -514,7 +514,7 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
uri: ownerUri,
|
uri: ownerUri,
|
||||||
queryInfo:
|
queryInfo:
|
||||||
{
|
{
|
||||||
range: info.range,
|
batchRanges: info.batchRanges,
|
||||||
messages: info.queryRunner!.messages
|
messages: info.queryRunner!.messages
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -531,7 +531,7 @@ export class QueryModelService implements IQueryModelService {
|
|||||||
uri: ownerUri,
|
uri: ownerUri,
|
||||||
queryInfo:
|
queryInfo:
|
||||||
{
|
{
|
||||||
range: info.range,
|
batchRanges: info.batchRanges,
|
||||||
messages: info.queryRunner!.messages
|
messages: info.queryRunner!.messages
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user