Skip to content

Commit 8741ba9

Browse files
committed
Rename externalApiInfo to signature
1 parent 115b807 commit 8741ba9

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ export type Call = {
66
};
77

88
export type ExternalApiUsage = {
9-
externalApiInfo: string;
9+
/**
10+
* Contains the full method signature, e.g. `org.sql2o.Connection#createQuery(String)`
11+
*/
12+
signature: string;
1013
packageName: string;
1114
typeName: string;
1215
methodName: string;

extensions/ql-vscode/src/view/data-extensions-editor/DataExtensionsEditor.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ export function DataExtensionsEditor(): JSX.Element {
7878
const methodsByApiName = new Map<string, ExternalApiUsage>();
7979

8080
results?.tuples.forEach((tuple) => {
81-
const externalApiInfo = tuple[0] as string;
81+
const signature = tuple[0] as string;
8282
const supported = tuple[1] as boolean;
8383
const usage = tuple[2] as Call;
8484

85-
const [packageWithType, methodDeclaration] = externalApiInfo.split("#");
85+
const [packageWithType, methodDeclaration] = signature.split("#");
8686

8787
const packageName = packageWithType.substring(
8888
0,
@@ -100,9 +100,9 @@ export function DataExtensionsEditor(): JSX.Element {
100100
methodDeclaration.indexOf("("),
101101
);
102102

103-
if (!methodsByApiName.has(externalApiInfo)) {
104-
methodsByApiName.set(externalApiInfo, {
105-
externalApiInfo,
103+
if (!methodsByApiName.has(signature)) {
104+
methodsByApiName.set(signature, {
105+
signature,
106106
packageName,
107107
typeName,
108108
methodName,
@@ -112,7 +112,7 @@ export function DataExtensionsEditor(): JSX.Element {
112112
});
113113
}
114114

115-
const method = methodsByApiName.get(externalApiInfo)!;
115+
const method = methodsByApiName.get(signature)!;
116116
method.usages.push(usage);
117117
});
118118

@@ -136,7 +136,7 @@ export function DataExtensionsEditor(): JSX.Element {
136136
(method: ExternalApiUsage, model: ModeledMethod) => {
137137
setModeledMethods((oldModeledMethods) => ({
138138
...oldModeledMethods,
139-
[method.externalApiInfo]: model,
139+
[method.signature]: model,
140140
}));
141141
},
142142
[],
@@ -188,9 +188,9 @@ export function DataExtensionsEditor(): JSX.Element {
188188
</VSCodeDataGridRow>
189189
{methods.map((method) => (
190190
<MethodRow
191-
key={method.externalApiInfo}
191+
key={method.signature}
192192
method={method}
193-
model={modeledMethods[method.externalApiInfo]}
193+
model={modeledMethods[method.signature]}
194194
onChange={onChange}
195195
/>
196196
))}

0 commit comments

Comments
 (0)