@lcap/nasl-language-server-core 4.4.1-rc.5 → 4.4.2-rc.2
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/out/checker.d.ts.map +1 -1
- package/out/checker.js +12 -1
- package/out/checker.js.map +1 -1
- package/out/typer/dispatch-call.d.ts.map +1 -1
- package/out/typer/dispatch-call.js +7 -1
- package/out/typer/dispatch-call.js.map +1 -1
- package/out/typer/dispatch-def.d.ts.map +1 -1
- package/out/typer/dispatch-def.js +1 -0
- package/out/typer/dispatch-def.js.map +1 -1
- package/out/typer/dispatch-expr.d.ts.map +1 -1
- package/out/typer/dispatch-expr.js +2 -1
- package/out/typer/dispatch-expr.js.map +1 -1
- package/out/typer/overload-helper.d.ts +1 -1
- package/out/typer/overload-helper.d.ts.map +1 -1
- package/out/typer/overload-helper.js +13 -2
- package/out/typer/overload-helper.js.map +1 -1
- package/out/typer/subster.d.ts.map +1 -1
- package/out/typer/subster.js +11 -4
- package/out/typer/subster.js.map +1 -1
- package/out/utils/parseTsClassType.d.ts.map +1 -1
- package/out/utils/parseTsClassType.js +2 -2
- package/out/utils/parseTsClassType.js.map +1 -1
- package/package.json +5 -5
package/out/checker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAC4C,QAAQ,EAC5B,IAAI,EAQ+E,GAAG,EAMxH,QAAQ,EAGT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACgE,cAAc,EAGpF,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAK5C,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAYpE,oBAAY,QAAQ;IAClB,IAAI,YAAY;IAChB,KAAK,UAAU;CAChB;AAED,MAAM,MA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AAK,UAAU,EAAE,KAC3D,kBAAkB,GAAG,IAAI;EAwF7B;AAqED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACrC,mBAAmB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACvC,qBAAqB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC1C;AAMD,eAAO,MAAM,6BAA6B,aAC9B,UAAU,+DAGnB,MAAM,gBAAgB,CAyCxB,CAAC;AAMF,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/out/checker.js
CHANGED
|
@@ -285,6 +285,7 @@ function createErrorDiagnoser(context) {
|
|
|
285
285
|
Param: 'getVarExistingNames',
|
|
286
286
|
Return: 'getVarExistingNames',
|
|
287
287
|
Variable: 'getVarExistingNames',
|
|
288
|
+
Identifier: 'getPropertyExistingNames',
|
|
288
289
|
Enum: 'getEnumExistingNames',
|
|
289
290
|
EnumItem: 'getEnumItemExistingNames',
|
|
290
291
|
EnumItemInteger: 'getEnumItemExistingNames',
|
|
@@ -499,7 +500,8 @@ function createErrorDiagnoser(context) {
|
|
|
499
500
|
conceptValidator = nasl_concepts_1.staticRules['EnumItemInteger'];
|
|
500
501
|
validatorMapKey = 'EnumItemInteger';
|
|
501
502
|
}
|
|
502
|
-
else if (concept === 'StructureProperty' && node
|
|
503
|
+
else if ((concept === 'StructureProperty' && node.parentNode?.concept !== 'Structure')
|
|
504
|
+
|| (concept === 'Identifier' && node.parentNode?.concept === 'NewComposite')) {
|
|
503
505
|
conceptValidator = nasl_concepts_1.staticRules['TypeStructureProperty'];
|
|
504
506
|
validatorMapKey = 'TypeStructureProperty';
|
|
505
507
|
}
|
|
@@ -4147,6 +4149,9 @@ function createErrorDiagnoser(context) {
|
|
|
4147
4149
|
*/
|
|
4148
4150
|
function* checkNewList(node) {
|
|
4149
4151
|
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
4152
|
+
if (node.typeAnnotation) {
|
|
4153
|
+
yield* checkNode(node.typeAnnotation);
|
|
4154
|
+
}
|
|
4150
4155
|
// 匿名函数返回值有可能是newList,需要过滤。代码来源:AnonymousFunction.__ts
|
|
4151
4156
|
const grandParent = node.parentNode?.parentNode?.parentNode;
|
|
4152
4157
|
if (isEntityUpdate(grandParent)) {
|
|
@@ -4184,6 +4189,9 @@ function createErrorDiagnoser(context) {
|
|
|
4184
4189
|
*/
|
|
4185
4190
|
function* checkNewMap(node) {
|
|
4186
4191
|
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
4192
|
+
if (node.typeAnnotation) {
|
|
4193
|
+
yield* checkNode(node.typeAnnotation);
|
|
4194
|
+
}
|
|
4187
4195
|
if (node.keys?.length) {
|
|
4188
4196
|
yield* (0, nasl_utils_1.wrapForEachToGenerator)(node.keys, function* (node) {
|
|
4189
4197
|
yield* checkNode(node);
|
|
@@ -4222,6 +4230,9 @@ function createErrorDiagnoser(context) {
|
|
|
4222
4230
|
*/
|
|
4223
4231
|
function* checkNewComposite(node) {
|
|
4224
4232
|
yield* semantic_rules_1.ExtraSemanticRules.rejectFileTypes(node, env, error);
|
|
4233
|
+
if (node.typeAnnotation) {
|
|
4234
|
+
yield* checkNode(node.typeAnnotation);
|
|
4235
|
+
}
|
|
4225
4236
|
ensureNodeKeyExists(node, 'typeAnnotation');
|
|
4226
4237
|
const type = env.getType(node);
|
|
4227
4238
|
if (node.properties?.length) {
|