Rename function: getQueryId -> getQueryHistoryItemId
This commit is contained in:
@@ -18,7 +18,7 @@ export function getRawQueryName(item: QueryHistoryInfo): string {
|
||||
}
|
||||
}
|
||||
|
||||
export function getQueryId(item: QueryHistoryInfo): string {
|
||||
export function getQueryHistoryItemId(item: QueryHistoryInfo): string {
|
||||
switch (item.t) {
|
||||
case 'local':
|
||||
return item.initialInfo.id;
|
||||
|
||||
@@ -31,7 +31,7 @@ import { commandRunner } from './commandRunner';
|
||||
import { ONE_HOUR_IN_MS, TWO_HOURS_IN_MS } from './pure/time';
|
||||
import { assertNever, getErrorMessage, getErrorStack } from './pure/helpers-pure';
|
||||
import { CompletedLocalQueryInfo, LocalQueryInfo } from './query-results';
|
||||
import { getQueryId, QueryHistoryInfo } from './query-history-info';
|
||||
import { getQueryHistoryItemId, QueryHistoryInfo } from './query-history-info';
|
||||
import { DatabaseManager } from './databases';
|
||||
import { registerQueryHistoryScrubber } from './query-history-scrubber';
|
||||
import { QueryStatus } from './query-status';
|
||||
@@ -1070,7 +1070,7 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
queryText: encodeURIComponent(await this.getQueryText(finalSingleItem)),
|
||||
});
|
||||
|
||||
const queryId = getQueryId(finalSingleItem);
|
||||
const queryId = getQueryHistoryItemId(finalSingleItem);
|
||||
|
||||
const uri = Uri.parse(
|
||||
`codeql:${queryId}?${params.toString()}`, true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { QueryStatus } from '../../src/query-status';
|
||||
import { getQueryId, getRawQueryName } from '../../src/query-history-info';
|
||||
import { getQueryHistoryItemId, getRawQueryName } from '../../src/query-history-info';
|
||||
import { VariantAnalysisHistoryItem } from '../../src/remote-queries/variant-analysis-history-item';
|
||||
import { createMockVariantAnalysis } from '../../src/vscode-tests/factories/remote-queries/shared/variant-analysis';
|
||||
import { createMockLocalQueryInfo } from '../../src/vscode-tests/factories/local-queries/local-query-history-item';
|
||||
@@ -49,14 +49,14 @@ describe('Query history info', () => {
|
||||
|
||||
const queryHistoryItem = createMockLocalQueryInfo(dateStr);
|
||||
|
||||
const queryId = getQueryId(queryHistoryItem);
|
||||
const queryId = getQueryHistoryItemId(queryHistoryItem);
|
||||
|
||||
expect(queryId).to.equal(queryHistoryItem.initialInfo.id);
|
||||
});
|
||||
|
||||
it('should get the ID for remote query history items', () => {
|
||||
const queryHistoryItem = createMockRemoteQueryHistoryItem({});
|
||||
const queryId = getQueryId(queryHistoryItem);
|
||||
const queryId = getQueryHistoryItemId(queryHistoryItem);
|
||||
|
||||
expect(queryId).to.equal(queryHistoryItem.queryId);
|
||||
});
|
||||
@@ -70,7 +70,7 @@ describe('Query history info', () => {
|
||||
variantAnalysis: createMockVariantAnalysis()
|
||||
};
|
||||
|
||||
const queryId = getQueryId(queryHistoryItem);
|
||||
const queryId = getQueryHistoryItemId(queryHistoryItem);
|
||||
|
||||
expect(queryId).to.equal(queryHistoryItem.queryId);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user