@abaplint/core 2.102.42 → 2.102.44

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.
@@ -3678,6 +3678,7 @@ export declare interface ISpaghettiScopeNode {
3678
3678
  };
3679
3679
  findClassDefinition(name: string): IClassDefinition | undefined;
3680
3680
  listClassDefinitions(): IClassDefinition[];
3681
+ listInterfaceDefinitions(): IInterfaceDefinition[];
3681
3682
  findFormDefinition(name: string): IFormDefinition | undefined;
3682
3683
  listFormDefinitions(): IFormDefinition[];
3683
3684
  findInterfaceDefinition(name: string): IInterfaceDefinition | undefined;
@@ -5352,6 +5353,7 @@ export declare class SpaghettiScopeNode extends ScopeData implements ISpaghettiS
5352
5353
  findDeferred(name: string): Identifier | undefined;
5353
5354
  findClassDefinition(name: string): IClassDefinition | undefined;
5354
5355
  listClassDefinitions(): IClassDefinition[];
5356
+ listInterfaceDefinitions(): IInterfaceDefinition[];
5355
5357
  findFormDefinition(name: string): IFormDefinition | undefined;
5356
5358
  listFormDefinitions(): IFormDefinition[];
5357
5359
  findInterfaceDefinition(name: string): IInterfaceDefinition | undefined;
@@ -305,7 +305,8 @@ class TypeUtils {
305
305
  }
306
306
  }
307
307
  else if (source instanceof basic_1.IntegerType) {
308
- if (target instanceof basic_1.StringType) {
308
+ if (target instanceof basic_1.StringType
309
+ || target instanceof basic_1.PackedType) {
309
310
  return false;
310
311
  }
311
312
  else if (target instanceof basic_1.Integer8Type) {
@@ -86,6 +86,15 @@ class SpaghettiScopeNode extends ScopeData {
86
86
  }
87
87
  return ret;
88
88
  }
89
+ listInterfaceDefinitions() {
90
+ let search = this;
91
+ const ret = [];
92
+ while (search !== undefined) {
93
+ ret.push(...Object.values(search.getData().idefs));
94
+ search = search.getParent();
95
+ }
96
+ return ret;
97
+ }
89
98
  findFormDefinition(name) {
90
99
  let search = this;
91
100
  const upper = name.toUpperCase();
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LSPLookup = void 0;
4
+ /* eslint-disable max-len */
4
5
  const LServer = require("vscode-languageserver-types");
5
6
  const Statements = require("../abap/2_statements/statements");
6
7
  const Expressions = require("../abap/2_statements/expressions");
@@ -83,13 +84,14 @@ class LSPLookup {
83
84
  }
84
85
  return { hover: hoverValue, definition: location, implementation: location, definitionId: variable, scope: bottomScope };
85
86
  }
86
- for (const c of bottomScope.listClassDefinitions()) {
87
+ // TODO: this can be optimized, no need to loop through all the defintions, the scope knows the name of the object?
88
+ for (const c of [...bottomScope.listClassDefinitions(), ...bottomScope.listInterfaceDefinitions()]) {
87
89
  for (const m of ((_a = c.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
88
90
  for (const p of ((_b = m.getParameters()) === null || _b === void 0 ? void 0 : _b.getAll()) || []) {
89
91
  if (p.getStart().equals(cursor.token.getStart())) {
90
92
  const found = _lsp_utils_1.LSPUtils.identiferToLocation(p);
91
93
  return {
92
- hover: "Method Parameter, " + cursor.token.getStr(),
94
+ hover: "Method Parameter: " + cursor.token.getStr().replace("!", ""),
93
95
  definition: found,
94
96
  definitionId: p,
95
97
  implementation: undefined,
@@ -271,11 +273,12 @@ class LSPLookup {
271
273
  };
272
274
  }
273
275
  static findMethodDefinition(found, scope) {
274
- var _a, _b, _c, _d;
276
+ var _a, _b, _c, _d, _e, _f, _g;
275
277
  if (scope === undefined) {
276
278
  return undefined;
277
279
  }
278
- if (scope.getIdentifier().stype !== _scope_type_1.ScopeType.ClassDefinition
280
+ if ((scope.getIdentifier().stype !== _scope_type_1.ScopeType.ClassDefinition
281
+ && scope.getIdentifier().stype !== _scope_type_1.ScopeType.Interface)
279
282
  || !(found.snode.get() instanceof Statements.MethodDef)) {
280
283
  return undefined;
281
284
  }
@@ -291,8 +294,14 @@ class LSPLookup {
291
294
  || nameToken.getStart().getRow() !== found.token.getStart().getRow()) {
292
295
  return undefined;
293
296
  }
294
- const def = (_d = (_c = (_b = scope.getParent()) === null || _b === void 0 ? void 0 : _b.findClassDefinition(scope.getIdentifier().sname)) === null || _c === void 0 ? void 0 : _c.getMethodDefinitions()) === null || _d === void 0 ? void 0 : _d.getByName(nameToken.getStr());
295
- return def;
297
+ if (scope.getIdentifier().stype === _scope_type_1.ScopeType.ClassDefinition) {
298
+ const def = (_d = (_c = (_b = scope.getParent()) === null || _b === void 0 ? void 0 : _b.findClassDefinition(scope.getIdentifier().sname)) === null || _c === void 0 ? void 0 : _c.getMethodDefinitions()) === null || _d === void 0 ? void 0 : _d.getByName(nameToken.getStr());
299
+ return def;
300
+ }
301
+ else {
302
+ const def = (_g = (_f = (_e = scope.getParent()) === null || _e === void 0 ? void 0 : _e.findInterfaceDefinition(scope.getIdentifier().sname)) === null || _f === void 0 ? void 0 : _f.getMethodDefinitions()) === null || _g === void 0 ? void 0 : _g.getByName(nameToken.getStr());
303
+ return def;
304
+ }
296
305
  }
297
306
  static findFunctionModule(found) {
298
307
  if (!(found.snode.get() instanceof Statements.CallFunction)) {
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.102.42";
68
+ return "2.102.44";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
@@ -142,7 +142,8 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
142
142
  if (statement.get() instanceof _statement_1.Comment) {
143
143
  continue;
144
144
  }
145
- else if (statement.get() instanceof Statements.EndIf) {
145
+ else if (statement.get() instanceof Statements.EndIf
146
+ || statement.get() instanceof Statements.EndTestSeam) {
146
147
  continue;
147
148
  }
148
149
  else {
@@ -169,7 +170,8 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
169
170
  return true;
170
171
  }
171
172
  }
172
- else if (statement.get() instanceof Statements.EndIf) {
173
+ else if (statement.get() instanceof Statements.EndIf
174
+ || statement.get() instanceof Statements.EndTestSeam) {
173
175
  continue;
174
176
  }
175
177
  else {
@@ -37,7 +37,12 @@ class CloudTypes {
37
37
  }
38
38
  run(obj) {
39
39
  if (this.reg.getConfig().getVersion() !== version_1.Version.Cloud
40
+ || obj instanceof Objects.ApplicationJobCatalogEntry
41
+ || obj instanceof Objects.ApplicationJobTemplate
40
42
  || obj instanceof Objects.AssignmentServiceToAuthorizationGroup
43
+ || obj instanceof Objects.ATCCheckCategory
44
+ || obj instanceof Objects.ATCCheckObject
45
+ || obj instanceof Objects.ATCCheckVariant
41
46
  || obj instanceof Objects.AuthorizationCheckField
42
47
  || obj instanceof Objects.AuthorizationObject
43
48
  || obj instanceof Objects.AuthorizationObjectExtension
@@ -45,11 +50,7 @@ class CloudTypes {
45
50
  || obj instanceof Objects.BusinessCatalog
46
51
  || obj instanceof Objects.BusinessCatalogAppAssignment
47
52
  || obj instanceof Objects.CDSMetadataExtension
48
- || obj instanceof Objects.RestrictionField
49
53
  || obj instanceof Objects.Class
50
- || obj instanceof Objects.OutboundService
51
- || obj instanceof Objects.ApplicationJobCatalogEntry
52
- || obj instanceof Objects.ApplicationJobTemplate
53
54
  || obj instanceof Objects.CommunicationScenario
54
55
  || obj instanceof Objects.DataControl
55
56
  || obj instanceof Objects.DataDefinition
@@ -61,11 +62,11 @@ class CloudTypes {
61
62
  || obj instanceof Objects.InboundService
62
63
  || obj instanceof Objects.Interface
63
64
  || obj instanceof Objects.LockObject
64
- || obj instanceof Objects.ATCCheckCategory
65
- || obj instanceof Objects.ATCCheckObject
66
- || obj instanceof Objects.ATCCheckVariant
67
65
  || obj instanceof Objects.MessageClass
66
+ || obj instanceof Objects.NumberRange
67
+ || obj instanceof Objects.OutboundService
68
68
  || obj instanceof Objects.Package
69
+ || obj instanceof Objects.RestrictionField
69
70
  || obj instanceof Objects.RestrictionType
70
71
  || obj instanceof Objects.ServiceBinding
71
72
  || obj instanceof Objects.ServiceDefinition
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.102.42",
3
+ "version": "2.102.44",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",