Skip to content

Commit 250089a

Browse files
committed
Renaming and smaller merge comments
1 parent 2e12b8d commit 250089a

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

extensions/ql-vscode/src/databases/config/db-config-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class DbConfigStore extends DisposableObject {
163163

164164
// Remove duplicates from the list of repositories.
165165
const newRepositoriesList = [
166-
...new Set([...new Set(parent.repositories), ...new Set(repoNwoList)]),
166+
...new Set([...parent.repositories, ...repoNwoList]),
167167
];
168168

169169
parent.repositories = newRepositoriesList.slice(0, 1000);

extensions/ql-vscode/src/databases/ui/db-panel.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class DbPanel extends DisposableObject {
189189
);
190190

191191
if (parentList) {
192-
this.truncatedReposNote(truncatedRepositories, parentList);
192+
this.reportAnyTruncatedRepos(truncatedRepositories, parentList);
193193
}
194194
}
195195

@@ -369,9 +369,7 @@ export class DbPanel extends DisposableObject {
369369
},
370370
);
371371
if (!codeSearchLanguage) {
372-
// We don't need to display a warning pop-up in this case, since the user just escaped out of the operation.
373-
// We set 'true' to make this a silent exception.
374-
throw new UserCancellationException("No language selected", true);
372+
return;
375373
}
376374

377375
const codeSearchQuery = await window.showInputBox({
@@ -408,12 +406,12 @@ export class DbPanel extends DisposableObject {
408406

409407
const truncatedRepositories =
410408
await this.dbManager.addNewRemoteReposToList(repositories, listName);
411-
this.truncatedReposNote(truncatedRepositories, listName);
409+
this.reportAnyTruncatedRepos(truncatedRepositories, listName);
412410
},
413411
);
414412
}
415413

416-
private truncatedReposNote(
414+
private reportAnyTruncatedRepos(
417415
truncatedRepositories: string[],
418416
listName: string,
419417
) {

extensions/ql-vscode/test/unit-tests/databases/config/db-config-store.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ describe("db config store", () => {
262262
});
263263

264264
// Add
265-
await configStore.addRemoteReposToList(
265+
const response = await configStore.addRemoteReposToList(
266266
["owner/repo1", "owner/repo2"],
267267
"list1",
268268
);
@@ -278,11 +278,12 @@ describe("db config store", () => {
278278
name: "list1",
279279
repositories: ["owner/repo1", "owner/repo2"],
280280
});
281+
expect(response).toEqual([]);
281282

282283
configStore.dispose();
283284
});
284285

285-
it("should add no more than 1000 repositories to a remote list using #addRemoteReposToList", async () => {
286+
it("should add no more than 1000 repositories to a remote list when adding multiple repos", async () => {
286287
// Initial set up
287288
const dbConfig = createDbConfig({
288289
remoteLists: [
@@ -296,7 +297,7 @@ describe("db config store", () => {
296297
const configStore = await initializeConfig(dbConfig, configPath, app);
297298

298299
// Add
299-
const reponse = await configStore.addRemoteReposToList(
300+
const response = await configStore.addRemoteReposToList(
300301
[...Array(1001).keys()].map((i) => `owner/db${i}`),
301302
"list1",
302303
);
@@ -311,12 +312,12 @@ describe("db config store", () => {
311312
expect(updatedRemoteDbs.repositoryLists[0].repositories).toHaveLength(
312313
1000,
313314
);
314-
expect(reponse).toEqual(["owner/db1000"]);
315+
expect(response).toEqual(["owner/db1000"]);
315316

316317
configStore.dispose();
317318
});
318319

319-
it("should add no more than 1000 repositories to a remote list using #addRemoteRepo", async () => {
320+
it("should add no more than 1000 repositories to a remote list when adding one repo", async () => {
320321
// Initial set up
321322
const dbConfig = createDbConfig({
322323
remoteLists: [

extensions/ql-vscode/test/unit-tests/databases/db-manager.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe("db manager", () => {
115115
});
116116
});
117117

118-
it("should return truncated repos when adding to a user defined list using #addNewRemoteReposToList", async () => {
118+
it("should return truncated repos when adding multiple repos to a user defined list", async () => {
119119
const dbConfig: DbConfig = createDbConfig({
120120
remoteLists: [
121121
{
@@ -135,7 +135,7 @@ describe("db manager", () => {
135135
expect(response).toEqual(["owner2/repo2"]);
136136
});
137137

138-
it("should return truncated repos when adding to a user defined list using #addNewRemoteRepo", async () => {
138+
it("should return truncated repos when adding one repo to a user defined list", async () => {
139139
const dbConfig: DbConfig = createDbConfig({
140140
remoteLists: [
141141
{

0 commit comments

Comments
 (0)