@abaplint/core 2.93.75 → 2.93.77

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.
@@ -593,14 +593,14 @@ class BasicTypes {
593
593
  this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
594
594
  }
595
595
  else {
596
- return new Types.UnknownType("Not a object reference, " + className + ", " + id.constructor.name);
596
+ return new Types.UnknownType("Not an object reference, " + className + ", " + id.constructor.name);
597
597
  }
598
598
  }
599
599
  else if (foo === undefined) {
600
600
  return new Types.UnknownType(className + " not found in scope");
601
601
  }
602
602
  else {
603
- return new Types.UnknownType("Not a object reference, " + className + ", " + foo.constructor.name);
603
+ return new Types.UnknownType("Not an object reference, " + className + ", " + foo.constructor.name);
604
604
  }
605
605
  }
606
606
  else {
@@ -11,7 +11,7 @@ class AttributeChain {
11
11
  return inputContext;
12
12
  }
13
13
  else if (!(inputContext instanceof object_reference_type_1.ObjectReferenceType)) {
14
- throw new Error("Not a object reference(AttributeChain)");
14
+ throw new Error("Not an object reference(AttributeChain)");
15
15
  }
16
16
  const children = node.getChildren().slice();
17
17
  const first = children[0];
@@ -54,7 +54,7 @@ class AttributeName {
54
54
  }
55
55
  }
56
56
  else {
57
- throw new Error("Not a object reference, attribute name");
57
+ throw new Error("Not an object reference, attribute name");
58
58
  }
59
59
  return ret;
60
60
  }
@@ -67,7 +67,7 @@ class FieldChain {
67
67
  if (!(context instanceof basic_1.ObjectReferenceType)
68
68
  && !(context instanceof basic_1.DataReference)
69
69
  && !(context instanceof basic_1.VoidType)) {
70
- throw new Error("Not a object reference, field chain");
70
+ throw new Error("Not an object reference, field chain");
71
71
  }
72
72
  }
73
73
  else if (current.get() instanceof expressions_1.Dereference) {
@@ -47,7 +47,7 @@ class MethodSource {
47
47
  return context;
48
48
  }
49
49
  else {
50
- throw new Error("MethodSource, not a object reference, " + node.concatTokens());
50
+ throw new Error("MethodSource, not an object reference, " + node.concatTokens());
51
51
  }
52
52
  }
53
53
  else if (last instanceof nodes_1.ExpressionNode && last.get() instanceof Expressions.Dynamic) {
@@ -52,14 +52,16 @@ class Target {
52
52
  if (!(context instanceof basic_1.ObjectReferenceType)
53
53
  && !(context instanceof basic_1.DataReference)
54
54
  && !(context instanceof basic_1.VoidType)) {
55
- throw new Error("Not a object reference, target");
55
+ throw new Error("Not an object reference, target");
56
56
  }
57
57
  }
58
58
  else if (current.get() instanceof expressions_1.Dereference) {
59
- if (!(context instanceof basic_1.DataReference)) {
60
- throw new Error("Not a object reference, target");
59
+ if (!(context instanceof basic_1.DataReference) && !(context instanceof basic_1.VoidType)) {
60
+ throw new Error("Not an object reference, target");
61
+ }
62
+ if (!(context instanceof basic_1.VoidType)) {
63
+ context = context.getType();
61
64
  }
62
- context = context.getType();
63
65
  }
64
66
  else if (current.get() instanceof Expressions.ComponentName) {
65
67
  context = new component_name_1.ComponentName().runSyntax(context, current);
@@ -46,7 +46,7 @@ class CreateObject {
46
46
  else if (!(found instanceof basic_1.ObjectReferenceType)
47
47
  && !(found instanceof basic_1.AnyType)
48
48
  && !(found instanceof basic_1.GenericObjectReferenceType)) {
49
- throw new Error("Target must be a object reference");
49
+ throw new Error("Target must be an object reference");
50
50
  }
51
51
  else if (found instanceof basic_1.GenericObjectReferenceType && type === undefined) {
52
52
  throw new Error("Generic type, cannot be instantiated");
@@ -6,22 +6,18 @@ const _identifier_1 = require("../abap/4_file_information/_identifier");
6
6
  const _abap_object_1 = require("../objects/_abap_object");
7
7
  const position_1 = require("../position");
8
8
  const LServer = require("vscode-languageserver-types");
9
- function getABAPObjects(reg) {
10
- const ret = [];
11
- for (const o of reg.getObjects()) {
12
- if (o instanceof _abap_object_1.ABAPObject) {
13
- ret.push(o);
14
- }
15
- }
16
- return ret;
17
- }
18
9
  class LSPUtils {
19
- static getABAPFile(reg, name) {
20
- const obj = getABAPObjects(reg);
21
- for (const o of obj) {
22
- for (const file of o.getABAPFiles()) {
23
- if (file.getFilename().toUpperCase() === name.toUpperCase()) {
24
- return file;
10
+ static getABAPFile(reg, filename) {
11
+ const file = reg.getFileByName(filename);
12
+ if (file === undefined) {
13
+ return undefined;
14
+ }
15
+ const obj = reg.findObjectForFile(file);
16
+ obj === null || obj === void 0 ? void 0 : obj.parse();
17
+ if (obj instanceof _abap_object_1.ABAPObject) {
18
+ for (const abapfile of obj.getABAPFiles()) {
19
+ if (abapfile.getFilename().toUpperCase() === filename.toUpperCase()) {
20
+ return abapfile;
25
21
  }
26
22
  }
27
23
  }
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.75";
66
+ return "2.93.77";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.75",
3
+ "version": "2.93.77",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -46,11 +46,11 @@
46
46
  },
47
47
  "homepage": "https://abaplint.org",
48
48
  "devDependencies": {
49
- "@microsoft/api-extractor": "^7.33.5",
50
- "@types/chai": "^4.3.3",
49
+ "@microsoft/api-extractor": "^7.33.6",
50
+ "@types/chai": "^4.3.4",
51
51
  "@types/mocha": "^10.0.0",
52
52
  "@types/node": "^18.11.9",
53
- "chai": "^4.3.6",
53
+ "chai": "^4.3.7",
54
54
  "eslint": "^8.27.0",
55
55
  "mocha": "^10.1.0",
56
56
  "c8": "^7.12.0",