@abaplint/transpiler 2.3.112 → 2.3.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/traversal.js +9 -2
- package/package.json +1 -1
package/build/src/traversal.js
CHANGED
|
@@ -180,6 +180,7 @@ class Traversal {
|
|
|
180
180
|
}
|
|
181
181
|
findMethodReference(token, scope) {
|
|
182
182
|
var _a, _b;
|
|
183
|
+
let candidate = undefined;
|
|
183
184
|
if (scope === undefined) {
|
|
184
185
|
return undefined;
|
|
185
186
|
}
|
|
@@ -191,7 +192,13 @@ class Traversal {
|
|
|
191
192
|
if (((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooType) === "INTF") {
|
|
192
193
|
name = r.extra.ooName + "$" + name;
|
|
193
194
|
}
|
|
194
|
-
|
|
195
|
+
candidate = { def: r.resolved, name };
|
|
196
|
+
if (token.getStart() instanceof abaplint.VirtualPosition
|
|
197
|
+
&& name.toLowerCase().includes(token.getStr().toLowerCase()) === false) {
|
|
198
|
+
// if its macros and they are nested everything can go wrong, so try looking for a better candidate
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
return candidate;
|
|
195
202
|
}
|
|
196
203
|
else if (r.referenceType === abaplint.ReferenceType.BuiltinMethodReference
|
|
197
204
|
&& r.position.getStart().equals(token.getStart())) {
|
|
@@ -200,7 +207,7 @@ class Traversal {
|
|
|
200
207
|
return { def, name };
|
|
201
208
|
}
|
|
202
209
|
}
|
|
203
|
-
return
|
|
210
|
+
return candidate;
|
|
204
211
|
}
|
|
205
212
|
isBuiltinVariable(token) {
|
|
206
213
|
const scope = this.findCurrentScopeByToken(token);
|