@abaplint/core 2.113.23 → 2.113.24

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.
@@ -115,6 +115,7 @@ export declare abstract class AbstractType {
115
115
  /** fully qualified symbolic name of the type */
116
116
  getQualifiedName(): string | undefined;
117
117
  getRTTIName(): string | undefined;
118
+ getDescription(): string | undefined;
118
119
  getConversionExit(): string | undefined;
119
120
  getDDICName(): string | undefined;
120
121
  abstract toText(level: number): string;
@@ -130,6 +131,7 @@ declare type AbstractTypeData = {
130
131
  derivedFromConstant?: boolean;
131
132
  ddicName?: string;
132
133
  RTTIName?: string;
134
+ description?: string;
133
135
  };
134
136
 
135
137
  declare class ActivationVariant extends AbstractObject {
@@ -1632,7 +1634,16 @@ declare class DDIC {
1632
1634
  lookupTable(name: string | undefined): AbstractType;
1633
1635
  private lookupView;
1634
1636
  lookupTableType(name: string | undefined): ILookupResult;
1635
- textToType(text: string | undefined, length: string | undefined, decimals: string | undefined, infoText: string, qualifiedName?: string, conversionExit?: string, ddicName?: string): AbstractType;
1637
+ textToType(input: {
1638
+ text: string | undefined;
1639
+ length: string | undefined;
1640
+ decimals: string | undefined;
1641
+ infoText: string;
1642
+ qualifiedName?: string;
1643
+ conversionExit?: string;
1644
+ ddicName?: string;
1645
+ description?: string;
1646
+ }): AbstractType;
1636
1647
  }
1637
1648
 
1638
1649
  declare enum DDLKind {
@@ -17,6 +17,10 @@ class AbstractType {
17
17
  var _a;
18
18
  return (_a = this.data) === null || _a === void 0 ? void 0 : _a.RTTIName;
19
19
  }
20
+ getDescription() {
21
+ var _a;
22
+ return (_a = this.data) === null || _a === void 0 ? void 0 : _a.description;
23
+ }
20
24
  getConversionExit() {
21
25
  var _a;
22
26
  return (_a = this.data) === null || _a === void 0 ? void 0 : _a.conversionExit;
package/build/src/ddic.js CHANGED
@@ -304,9 +304,15 @@ class DDIC {
304
304
  return { type: new Types.VoidType(name) };
305
305
  }
306
306
  }
307
- textToType(text, length, decimals, infoText, qualifiedName, conversionExit, ddicName) {
307
+ textToType(input) {
308
308
  // todo: support short strings, and length of different integers, NUMC vs CHAR, min/max length
309
- switch (text) {
309
+ const extra = {
310
+ qualifiedName: input.qualifiedName,
311
+ conversionExit: input.conversionExit,
312
+ ddicName: input.ddicName,
313
+ description: input.description,
314
+ };
315
+ switch (input.text) {
310
316
  case "DEC": // 1 <= len <= 31
311
317
  case "D16F": // 1 <= len <= 31
312
318
  case "D16D":
@@ -315,45 +321,45 @@ class DDIC {
315
321
  case "DF34_DEC": // 1 <= len <= 31
316
322
  case "CURR": // 1 <= len <= 31
317
323
  case "QUAN": // 1 <= len <= 31
318
- if (length === undefined) {
319
- return new Types.UnknownType(text + " unknown length, " + infoText, infoText);
324
+ if (input.length === undefined) {
325
+ return new Types.UnknownType(input.text + " unknown length, " + input.infoText, input.infoText);
320
326
  }
321
- else if (decimals === undefined) {
322
- return new Types.PackedType(parseInt(length, 10), 0, { qualifiedName, conversionExit, ddicName });
327
+ else if (input.decimals === undefined) {
328
+ return new Types.PackedType(parseInt(input.length, 10), 0, extra);
323
329
  }
324
- return new Types.PackedType(parseInt(length, 10), parseInt(decimals, 10), { qualifiedName, conversionExit, ddicName });
330
+ return new Types.PackedType(parseInt(input.length, 10), parseInt(input.decimals, 10), extra);
325
331
  case "ACCP":
326
- return new Types.CharacterType(6, { qualifiedName, conversionExit, ddicName }); // YYYYMM
332
+ return new Types.CharacterType(6, extra); // YYYYMM
327
333
  case "LANG":
328
- return new Types.CharacterType(1, { qualifiedName, conversionExit, ddicName });
334
+ return new Types.CharacterType(1, extra);
329
335
  case "CLNT":
330
- return new Types.CharacterType(3, { qualifiedName, conversionExit, ddicName });
336
+ return new Types.CharacterType(3, extra);
331
337
  case "CUKY":
332
- return new Types.CharacterType(5, { qualifiedName, conversionExit, ddicName });
338
+ return new Types.CharacterType(5, extra);
333
339
  case "UNIT": // 2 <= len <= 3
334
- return new Types.CharacterType(3, { qualifiedName, conversionExit, ddicName });
340
+ return new Types.CharacterType(3, extra);
335
341
  case "UTCLONG":
336
- return new Types.CharacterType(27, { qualifiedName, conversionExit, ddicName });
342
+ return new Types.CharacterType(27, extra);
337
343
  case "NUMC": // 1 <= len <= 255
338
- if (length === undefined) {
339
- return new Types.UnknownType(text + " unknown length", infoText);
344
+ if (input.length === undefined) {
345
+ return new Types.UnknownType(input.text + " unknown length", input.infoText);
340
346
  }
341
- return new Types.NumericType(parseInt(length, 10), qualifiedName);
347
+ return new Types.NumericType(parseInt(input.length, 10), input.qualifiedName);
342
348
  case "CHAR": // 1 <= len <= 30000 (1333 for table fields)
343
349
  case "LCHR": // 256 <= len <= 32000
344
- if (length === undefined) {
345
- return new Types.UnknownType(text + " unknown length", infoText);
350
+ if (input.length === undefined) {
351
+ return new Types.UnknownType(input.text + " unknown length", input.infoText);
346
352
  }
347
- return new Types.CharacterType(parseInt(length, 10), { qualifiedName, conversionExit, ddicName });
353
+ return new Types.CharacterType(parseInt(input.length, 10), extra);
348
354
  case "RAW": // 1 <= len <= 32000
349
355
  case "LRAW": // 256 <= len <= 32000
350
- if (length === undefined) {
351
- return new Types.UnknownType(text + " unknown length", infoText);
356
+ if (input.length === undefined) {
357
+ return new Types.UnknownType(input.text + " unknown length", input.infoText);
352
358
  }
353
- return new Types.HexType(parseInt(length, 10), qualifiedName);
359
+ return new Types.HexType(parseInt(input.length, 10), input.qualifiedName);
354
360
  case "TIMN": // Native HANA
355
361
  case "TIMS":
356
- return new Types.TimeType({ qualifiedName: qualifiedName }); //HHMMSS
362
+ return new Types.TimeType({ qualifiedName: input.qualifiedName }); //HHMMSS
357
363
  case "DECFLOAT16": // len = 16
358
364
  case "DECFLOAT34": // len = 34
359
365
  case "D16R": // len = 16
@@ -361,37 +367,37 @@ class DDIC {
361
367
  case "DF16_RAW": // len = 16
362
368
  case "DF34_RAW": // len = 34
363
369
  case "FLTP": // len = 16
364
- if (length === undefined) {
365
- return new Types.UnknownType(text + " unknown length", infoText);
370
+ if (input.length === undefined) {
371
+ return new Types.UnknownType(input.text + " unknown length", input.infoText);
366
372
  }
367
- return new Types.FloatingPointType(parseInt(length, 10), qualifiedName);
373
+ return new Types.FloatingPointType(parseInt(input.length, 10), input.qualifiedName);
368
374
  case "DATN": // Native HANA
369
375
  case "DATS":
370
- return new Types.DateType({ qualifiedName: qualifiedName }); //YYYYMMDD
376
+ return new Types.DateType({ qualifiedName: input.qualifiedName }); //YYYYMMDD
371
377
  case "INT1":
372
378
  case "INT2":
373
379
  case "INT4":
374
- return Types.IntegerType.get({ qualifiedName: qualifiedName });
380
+ return Types.IntegerType.get({ qualifiedName: input.qualifiedName });
375
381
  case "INT8":
376
- return new Types.Integer8Type({ qualifiedName: qualifiedName });
382
+ return new Types.Integer8Type({ qualifiedName: input.qualifiedName });
377
383
  case "SSTR": // 1 <= len <= 1333
378
384
  case "SSTRING": // 1 <= len <= 1333
379
385
  case "STRG": // 256 <= len
380
386
  case "STRING": // 256 <= len
381
- return Types.StringType.get({ qualifiedName: qualifiedName });
387
+ return Types.StringType.get({ qualifiedName: input.qualifiedName });
382
388
  case "RSTR": // 256 <= len
383
389
  case "RAWSTRING": // 256 <= len
384
390
  case "GEOM_EWKB":
385
- return new Types.XStringType({ qualifiedName: qualifiedName });
391
+ return new Types.XStringType({ qualifiedName: input.qualifiedName });
386
392
  case "D16S":
387
393
  case "D34S":
388
394
  case "DF16_SCL":
389
395
  case "DF34_SCL":
390
396
  case "PREC":
391
397
  case "VARC":
392
- return new Types.UnknownType(text + " is an obsolete data type", infoText);
398
+ return new Types.UnknownType(input.text + " is an obsolete data type", input.infoText);
393
399
  default:
394
- return new Types.UnknownType(text + " unknown", infoText);
400
+ return new Types.UnknownType(input.text + " unknown", input.infoText);
395
401
  }
396
402
  }
397
403
  }
@@ -185,6 +185,9 @@ class LSPLookup {
185
185
  if (variable.getType().getDDICName() !== undefined) {
186
186
  value += "\n\nDDIC Name: ```" + variable.getType().getDDICName() + "```";
187
187
  }
188
+ if (variable.getType().getDescription() !== undefined) {
189
+ value += "\n\nDescription: " + variable.getType().getDescription();
190
+ }
188
191
  return value;
189
192
  }
190
193
  static referenceHover(ref, scope, reg) {
@@ -38,6 +38,7 @@ class DataElement extends _abstract_object_1.AbstractObject {
38
38
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.texts;
39
39
  }
40
40
  parseType(reg) {
41
+ var _a;
41
42
  const references = [];
42
43
  let lookup = undefined;
43
44
  if (this.parsedXML === undefined) {
@@ -66,7 +67,16 @@ class DataElement extends _abstract_object_1.AbstractObject {
66
67
  lookup = { type: new Types.UnknownType("DATATYPE unexpectely empty in " + this.getName()) };
67
68
  }
68
69
  else {
69
- lookup = { type: ddic.textToType(this.parsedXML.datatype, this.parsedXML.leng, this.parsedXML.decimals, this.getName(), this.getName(), undefined, this.getName()) };
70
+ lookup = { type: ddic.textToType({
71
+ text: this.parsedXML.datatype,
72
+ length: this.parsedXML.leng,
73
+ decimals: this.parsedXML.decimals,
74
+ infoText: this.getName(),
75
+ qualifiedName: this.getName(),
76
+ conversionExit: undefined,
77
+ ddicName: this.getName(),
78
+ description: (_a = this.parsedXML.texts) === null || _a === void 0 ? void 0 : _a.heading,
79
+ }) };
70
80
  }
71
81
  }
72
82
  }
@@ -37,7 +37,15 @@ class Domain extends _abstract_object_1.AbstractObject {
37
37
  return new Types.UnknownType("Domain " + this.getName() + " parser error", this.getName());
38
38
  }
39
39
  const ddic = new ddic_1.DDIC(reg);
40
- return ddic.textToType(this.parsedXML.datatype, this.parsedXML.length, this.parsedXML.decimals, this.getName(), dataElement, this.parsedXML.conversionExit, dataElement);
40
+ return ddic.textToType({
41
+ text: this.parsedXML.datatype,
42
+ length: this.parsedXML.length,
43
+ decimals: this.parsedXML.decimals,
44
+ infoText: this.getName(),
45
+ qualifiedName: dataElement,
46
+ conversionExit: this.parsedXML.conversionExit,
47
+ ddicName: dataElement,
48
+ });
41
49
  }
42
50
  parse() {
43
51
  var _a, _b, _c, _d, _e, _f, _g;
@@ -221,7 +221,12 @@ class Table extends _abstract_object_1.AbstractObject {
221
221
  const length = field.LENG ? field.LENG : field.INTLEN;
222
222
  components.push({
223
223
  name: field.FIELDNAME,
224
- type: ddic.textToType(datatype, length, field.DECIMALS, this.getName() + "-" + field.FIELDNAME)
224
+ type: ddic.textToType({
225
+ text: datatype,
226
+ length: length,
227
+ decimals: field.DECIMALS,
228
+ infoText: this.getName() + "-" + field.FIELDNAME,
229
+ })
225
230
  });
226
231
  }
227
232
  else {
@@ -140,7 +140,12 @@ class TableType extends _abstract_object_1.AbstractObject {
140
140
  type = new Types.UnknownType("Table Type, empty DATATYPE" + this.getName(), this.getName());
141
141
  }
142
142
  else {
143
- const row = ddic.textToType(this.parsedXML.datatype, this.parsedXML.leng, this.parsedXML.decimals, this.getName());
143
+ const row = ddic.textToType({
144
+ text: this.parsedXML.datatype,
145
+ length: this.parsedXML.leng,
146
+ decimals: this.parsedXML.decimals,
147
+ infoText: this.getName(),
148
+ });
144
149
  type = new Types.TableType(row, tableOptions, this.getName());
145
150
  }
146
151
  }
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.23";
70
+ return "2.113.24";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.23",
3
+ "version": "2.113.24",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",