Skip to content

Commit 9018cac

Browse files
Rename decodeBqrsToExternalApiUsages => decodeBqrsToMethods
1 parent aec742a commit 9018cac

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

extensions/ql-vscode/src/model-editor/bqrs.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { Call, CallClassification, Method } from "./method";
33
import { ModeledMethodType } from "./modeled-method";
44
import { parseLibraryFilename } from "./library";
55

6-
export function decodeBqrsToExternalApiUsages(
7-
chunk: DecodedBqrsChunk,
8-
): Method[] {
6+
export function decodeBqrsToMethods(chunk: DecodedBqrsChunk): Method[] {
97
const methodsByApiName = new Map<string, Method>();
108

119
chunk?.tuples.forEach((tuple) => {

extensions/ql-vscode/src/model-editor/external-api-usage-queries.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { QueryLanguage } from "../common/query-language";
1515
import { fetchExternalApiQueries } from "./queries";
1616
import { Method } from "./method";
1717
import { runQuery } from "../local-queries/run-query";
18-
import { decodeBqrsToExternalApiUsages } from "./bqrs";
18+
import { decodeBqrsToMethods } from "./bqrs";
1919

2020
type RunQueryOptions = {
2121
cliServer: CodeQLCliServer;
@@ -132,7 +132,7 @@ export async function runExternalApiQueries(
132132
maxStep: externalApiQueriesProgressMaxStep,
133133
});
134134

135-
return decodeBqrsToExternalApiUsages(bqrsChunk);
135+
return decodeBqrsToMethods(bqrsChunk);
136136
}
137137

138138
type GetResultsOptions = {

extensions/ql-vscode/test/unit-tests/model-editor/bqrs.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { decodeBqrsToExternalApiUsages } from "../../../src/model-editor/bqrs";
1+
import { decodeBqrsToMethods } from "../../../src/model-editor/bqrs";
22
import { DecodedBqrsChunk } from "../../../src/common/bqrs-cli-types";
33
import { CallClassification } from "../../../src/model-editor/method";
44

5-
describe("decodeBqrsToExternalApiUsages", () => {
5+
describe("decodeBqrsToMethods", () => {
66
const chunk: DecodedBqrsChunk = {
77
columns: [
88
{ name: "usage", kind: "Entity" },
@@ -230,11 +230,11 @@ describe("decodeBqrsToExternalApiUsages", () => {
230230
],
231231
};
232232

233-
it("extracts api usages", () => {
234-
// Even though there are a number of usages with the same number of usages, the order returned should be stable:
233+
it("extracts methods", () => {
234+
// Even though there are a number of methods with the same number of usages, the order returned should be stable:
235235
// - Iterating over a map (as done by .values()) is guaranteed to be in insertion order
236236
// - Sorting the array of usages is guaranteed to be a stable sort
237-
expect(decodeBqrsToExternalApiUsages(chunk)).toEqual([
237+
expect(decodeBqrsToMethods(chunk)).toEqual([
238238
{
239239
library: "rt",
240240
libraryVersion: undefined,

0 commit comments

Comments
 (0)