@lcap/nasl-language-server-core 4.3.0-beta.1 → 4.3.0-beta.4

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.
Files changed (97) hide show
  1. package/out/checker.d.ts +6 -0
  2. package/out/checker.d.ts.map +1 -1
  3. package/out/checker.js +24 -3
  4. package/out/checker.js.map +1 -1
  5. package/out/index.d.ts +1 -0
  6. package/out/index.d.ts.map +1 -1
  7. package/out/index.js +1 -0
  8. package/out/index.js.map +1 -1
  9. package/out/reference-manager/build-q-name-def.d.ts.map +1 -1
  10. package/out/reference-manager/build-q-name-def.js +0 -9
  11. package/out/reference-manager/build-q-name-def.js.map +1 -1
  12. package/out/reference-manager/builtin-q-name.d.ts.map +1 -1
  13. package/out/reference-manager/builtin-q-name.js +1 -5
  14. package/out/reference-manager/builtin-q-name.js.map +1 -1
  15. package/out/reference-manager/reference-manager.d.ts.map +1 -1
  16. package/out/reference-manager/reference-manager.js +4 -1
  17. package/out/reference-manager/reference-manager.js.map +1 -1
  18. package/out/reference-manager/symbol-type.d.ts +1 -1
  19. package/out/reference-manager/symbol-type.d.ts.map +1 -1
  20. package/out/reference-manager/symbol-type.js.map +1 -1
  21. package/out/typer/collectGlobalDefs.d.ts.map +1 -1
  22. package/out/typer/collectGlobalDefs.js +3 -1
  23. package/out/typer/collectGlobalDefs.js.map +1 -1
  24. package/out/typer/component-def-manager/utils.d.ts.map +1 -1
  25. package/out/typer/component-def-manager/utils.js +4 -2
  26. package/out/typer/component-def-manager/utils.js.map +1 -1
  27. package/out/typer/dispatch-call.d.ts.map +1 -1
  28. package/out/typer/dispatch-call.js +177 -26
  29. package/out/typer/dispatch-call.js.map +1 -1
  30. package/out/typer/dispatch-def.d.ts.map +1 -1
  31. package/out/typer/dispatch-def.js +6 -2
  32. package/out/typer/dispatch-def.js.map +1 -1
  33. package/out/typer/dispatch-expr.d.ts +4 -2
  34. package/out/typer/dispatch-expr.d.ts.map +1 -1
  35. package/out/typer/dispatch-expr.js +111 -18
  36. package/out/typer/dispatch-expr.js.map +1 -1
  37. package/out/typer/dispatch-stmt.d.ts.map +1 -1
  38. package/out/typer/dispatch-stmt.js +1 -0
  39. package/out/typer/dispatch-stmt.js.map +1 -1
  40. package/out/typer/dispatch-view.js +1 -1
  41. package/out/typer/dispatch-view.js.map +1 -1
  42. package/out/typer/oql-checker/chain-call-transformer.d.ts +21 -0
  43. package/out/typer/oql-checker/chain-call-transformer.d.ts.map +1 -0
  44. package/out/typer/oql-checker/chain-call-transformer.js +150 -0
  45. package/out/typer/oql-checker/chain-call-transformer.js.map +1 -0
  46. package/out/typer/oql-checker/ts-parser.d.ts +46 -0
  47. package/out/typer/oql-checker/ts-parser.d.ts.map +1 -0
  48. package/out/typer/oql-checker/ts-parser.js +706 -0
  49. package/out/typer/oql-checker/ts-parser.js.map +1 -0
  50. package/out/typer/oql-checker/ts-printer.d.ts +3 -0
  51. package/out/typer/oql-checker/ts-printer.d.ts.map +1 -0
  52. package/out/typer/oql-checker/ts-printer.js +37 -0
  53. package/out/typer/oql-checker/ts-printer.js.map +1 -0
  54. package/out/typer/overload-helper.d.ts +17 -6
  55. package/out/typer/overload-helper.d.ts.map +1 -1
  56. package/out/typer/overload-helper.js +393 -76
  57. package/out/typer/overload-helper.js.map +1 -1
  58. package/out/typer/subster.d.ts.map +1 -1
  59. package/out/typer/subster.js +70 -2
  60. package/out/typer/subster.js.map +1 -1
  61. package/out/typer/type-manager.js +4 -4
  62. package/out/typer/type-manager.js.map +1 -1
  63. package/out/typer/type-predicate.d.ts +9 -0
  64. package/out/typer/type-predicate.d.ts.map +1 -1
  65. package/out/typer/type-predicate.js +14 -1
  66. package/out/typer/type-predicate.js.map +1 -1
  67. package/out/typer/typer.d.ts +13 -3
  68. package/out/typer/typer.d.ts.map +1 -1
  69. package/out/typer/typer.js +21 -5
  70. package/out/typer/typer.js.map +1 -1
  71. package/out/typer/unifier.d.ts.map +1 -1
  72. package/out/typer/unifier.js +4 -5
  73. package/out/typer/unifier.js.map +1 -1
  74. package/out/utils/debug.d.ts +6 -0
  75. package/out/utils/debug.d.ts.map +1 -0
  76. package/out/utils/debug.js +62 -0
  77. package/out/utils/debug.js.map +1 -0
  78. package/out/utils/file-node-cache.d.ts.map +1 -1
  79. package/out/utils/file-node-cache.js +4 -1
  80. package/out/utils/file-node-cache.js.map +1 -1
  81. package/out/utils/internal-tuple.d.ts +2 -0
  82. package/out/utils/internal-tuple.d.ts.map +1 -0
  83. package/out/utils/internal-tuple.js +29 -0
  84. package/out/utils/internal-tuple.js.map +1 -0
  85. package/out/utils/parseTsClassType.d.ts +1 -5
  86. package/out/utils/parseTsClassType.d.ts.map +1 -1
  87. package/out/utils/parseTsClassType.js +103 -66
  88. package/out/utils/parseTsClassType.js.map +1 -1
  89. package/out/utils/type-operator.d.ts +29 -1
  90. package/out/utils/type-operator.d.ts.map +1 -1
  91. package/out/utils/type-operator.js +181 -1
  92. package/out/utils/type-operator.js.map +1 -1
  93. package/out/utils/type-operators/CheckUniqueKeys.d.ts +15 -0
  94. package/out/utils/type-operators/CheckUniqueKeys.d.ts.map +1 -0
  95. package/out/utils/type-operators/CheckUniqueKeys.js +86 -0
  96. package/out/utils/type-operators/CheckUniqueKeys.js.map +1 -0
  97. package/package.json +12 -7
package/out/checker.d.ts CHANGED
@@ -42,6 +42,12 @@ export declare function createErrorDiagnoser(context: DiagnoseContext): {
42
42
  clearDiagnostics: (node?: SyntaxNode) => void;
43
43
  getDiagnostics: (node: SyntaxNode) => NodeDiagnosticsMap | undefined;
44
44
  getAllDiagnostics: () => FileDiagnosticsMap;
45
+ getDebugDiagnostics: () => {
46
+ message: string;
47
+ severity: string;
48
+ nodePath: string;
49
+ nodeConcept: string;
50
+ }[];
45
51
  error: (node: SyntaxNode, message: string, context?: ErrorContext) => void;
46
52
  };
47
53
  export interface DiagnosticRecord {
@@ -1 +1 @@
1
- {"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"m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ANGED
@@ -4384,6 +4384,26 @@ function createErrorDiagnoser(context) {
4384
4384
  function getAllDiagnostics() {
4385
4385
  return diagnosticMap;
4386
4386
  }
4387
+ function getDebugDiagnostics() {
4388
+ const diagMap = getAllDiagnostics();
4389
+ const flattenedDiags = [];
4390
+ diagMap.forEach((item) => {
4391
+ flattenedDiags.push(...[...item.entries()].flatMap((([node, xs]) => {
4392
+ return xs.flatMap((x) => {
4393
+ if (!x.message || !x.severity) {
4394
+ return [];
4395
+ }
4396
+ return [{
4397
+ message: x.message,
4398
+ severity: x.severity,
4399
+ nodePath: node.nodePath,
4400
+ nodeConcept: node.concept,
4401
+ }];
4402
+ });
4403
+ })));
4404
+ });
4405
+ return flattenedDiags;
4406
+ }
4387
4407
  return {
4388
4408
  setMetadataTypeEnable,
4389
4409
  setLatestVersionsOfSharedApp,
@@ -4392,6 +4412,7 @@ function createErrorDiagnoser(context) {
4392
4412
  clearDiagnostics,
4393
4413
  getDiagnostics,
4394
4414
  getAllDiagnostics,
4415
+ getDebugDiagnostics,
4395
4416
  error,
4396
4417
  };
4397
4418
  }
@@ -4445,7 +4466,7 @@ exports.transformDiagnosticsToRecords = transformDiagnosticsToRecords;
4445
4466
  // @ts-expect-error
4446
4467
  const toRaw = (nd) => nd.__v_raw ?? nd;
4447
4468
  // 是否来自系统内置
4448
- const isBuiltInCall = (nd) => nd.calleeNamespace.startsWith('nasl.');
4449
- // 是否来自依赖库
4450
- const getExtensionLibName = (nd) => nd.calleeNamespace.startsWith('extensions.') ? nd.calleeNamespace.split('.')[1] : undefined;
4469
+ const isBuiltInCall = (nd) => !!nd.calleeNamespace?.startsWith('nasl.');
4470
+ // 获取依赖库名
4471
+ const getExtensionLibName = (nd) => nd.calleeNamespace?.startsWith('extensions.') ? nd.calleeNamespace.split('.')[1] : undefined;
4451
4472
  //# sourceMappingURL=checker.js.map