Skip to content

Commit 971fb6e

Browse files
committed
Rename updateItemInExpandedState -> updateExpandedItem and replaceItemInExpandedState -> replaceExpandedItem
1 parent 13db377 commit 971fb6e

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

extensions/ql-vscode/src/databases/db-item-expansion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface RemoteUserDefinedListExpandedDbItem {
3131
listName: string;
3232
}
3333

34-
export function updateItemInExpandedState(
34+
export function updateExpandedItem(
3535
currentExpandedItems: ExpandedDbItem[],
3636
dbItem: DbItem,
3737
itemExpanded: boolean,
@@ -50,7 +50,7 @@ export function updateItemInExpandedState(
5050
}
5151
}
5252

53-
export function replaceItemInExpandedState(
53+
export function replaceExpandedItem(
5454
currentExpandedItems: ExpandedDbItem[],
5555
currentDbItem: DbItem,
5656
newDbItem: DbItem,

extensions/ql-vscode/src/databases/db-manager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
RemoteUserDefinedListDbItem,
1212
} from "./db-item";
1313
import {
14-
updateItemInExpandedState,
15-
replaceItemInExpandedState,
14+
updateExpandedItem,
15+
replaceExpandedItem,
1616
ExpandedDbItem,
1717
} from "./db-item-expansion";
1818
import {
@@ -80,7 +80,7 @@ export class DbManager {
8080
): Promise<void> {
8181
const currentExpandedItems = this.getExpandedItems();
8282

83-
const newExpandedItems = updateItemInExpandedState(
83+
const newExpandedItems = updateExpandedItem(
8484
currentExpandedItems,
8585
dbItem,
8686
itemExpanded,
@@ -127,7 +127,7 @@ export class DbManager {
127127
}
128128

129129
const newDbItem = { ...currentDbItem, listName: newName };
130-
const newExpandedItems = replaceItemInExpandedState(
130+
const newExpandedItems = replaceExpandedItem(
131131
this.getExpandedItems(),
132132
currentDbItem,
133133
newDbItem,

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import {
33
RootRemoteDbItem,
44
} from "../../../src/databases/db-item";
55
import {
6-
updateItemInExpandedState,
6+
updateExpandedItem,
77
ExpandedDbItem,
88
ExpandedDbItemKind,
9-
replaceItemInExpandedState,
9+
replaceExpandedItem,
1010
} from "../../../src/databases/db-item-expansion";
1111
import {
1212
createRemoteUserDefinedListDbItem,
1313
createRootRemoteDbItem,
1414
} from "../../factories/db-item-factories";
1515

1616
describe("db item expansion", () => {
17-
describe("updateItemInExpandedState", () => {
17+
describe("updateExpandedItem", () => {
1818
it("should add an expanded item to an existing list", () => {
1919
const currentExpandedItems: ExpandedDbItem[] = [
2020
{
@@ -31,7 +31,7 @@ describe("db item expansion", () => {
3131
listName: "list2",
3232
});
3333

34-
const newExpandedItems = updateItemInExpandedState(
34+
const newExpandedItems = updateExpandedItem(
3535
currentExpandedItems,
3636
dbItem,
3737
true,
@@ -52,7 +52,7 @@ describe("db item expansion", () => {
5252
listName: "list2",
5353
});
5454

55-
const newExpandedItems = updateItemInExpandedState([], dbItem, true);
55+
const newExpandedItems = updateExpandedItem([], dbItem, true);
5656

5757
expect(newExpandedItems).toEqual([
5858
{
@@ -78,7 +78,7 @@ describe("db item expansion", () => {
7878
listName: "list1",
7979
});
8080

81-
const newExpandedItems = updateItemInExpandedState(
81+
const newExpandedItems = updateExpandedItem(
8282
currentExpandedItems,
8383
dbItem,
8484
false,
@@ -100,7 +100,7 @@ describe("db item expansion", () => {
100100

101101
const dbItem: RootRemoteDbItem = createRootRemoteDbItem();
102102

103-
const newExpandedItems = updateItemInExpandedState(
103+
const newExpandedItems = updateExpandedItem(
104104
currentExpandedItems,
105105
dbItem,
106106
false,
@@ -110,7 +110,7 @@ describe("db item expansion", () => {
110110
});
111111
});
112112

113-
describe("replaceItemInExpandedState", () => {
113+
describe("replaceExpandedItem", () => {
114114
it("should replace the db item", () => {
115115
const currentExpandedItems: ExpandedDbItem[] = [
116116
{
@@ -139,7 +139,7 @@ describe("db item expansion", () => {
139139
listName: "list1 (renamed)",
140140
};
141141

142-
const newExpandedItems = replaceItemInExpandedState(
142+
const newExpandedItems = replaceExpandedItem(
143143
currentExpandedItems,
144144
currentDbItem,
145145
newDbItem,

0 commit comments

Comments
 (0)