@marko/language-tools 2.4.6 → 2.4.8

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/dist/index.js CHANGED
@@ -358,6 +358,8 @@ var Builder = class {
358
358
  );
359
359
  this.#comments = void 0;
360
360
  return import_htmljs_parser.TagType.statement;
361
+ case "server":
362
+ case "client":
361
363
  case "static":
362
364
  this.#program.static.push(
363
365
  this.#staticNode = {
@@ -386,9 +388,18 @@ var Builder = class {
386
388
  case "source":
387
389
  case "track":
388
390
  case "wbr":
391
+ case "const":
392
+ case "debug":
393
+ case "id":
394
+ case "let":
395
+ case "lifecycle":
396
+ case "log":
397
+ case "return":
389
398
  bodyType = import_htmljs_parser.TagType.void;
390
399
  break;
391
400
  case "html-comment":
401
+ case "html-script":
402
+ case "html-style":
392
403
  case "script":
393
404
  case "textarea":
394
405
  bodyType = import_htmljs_parser.TagType.text;
@@ -1119,9 +1130,12 @@ function crawlProgramScope(parsed, scriptParser) {
1119
1130
  case 16 /* AttrTag */: {
1120
1131
  if (child.var) {
1121
1132
  parentScope.bindings ??= {};
1122
- const parsedFn = scriptParser.expressionAt(child.var.value.start - 6, `${read(child.var.value)}=0`);
1133
+ const parsedFn = scriptParser.expressionAt(
1134
+ child.var.value.start - 1,
1135
+ `(${read(child.var.value)})=>0`
1136
+ );
1123
1137
  if (parsedFn) {
1124
- const lVal = parsedFn.left;
1138
+ const lVal = parsedFn.params[0];
1125
1139
  checkForMutations(parentScope, lVal);
1126
1140
  for (const id of getVarIdentifiers(
1127
1141
  parsed,
package/dist/index.mjs CHANGED
@@ -319,6 +319,8 @@ var Builder = class {
319
319
  );
320
320
  this.#comments = void 0;
321
321
  return TagType.statement;
322
+ case "server":
323
+ case "client":
322
324
  case "static":
323
325
  this.#program.static.push(
324
326
  this.#staticNode = {
@@ -347,9 +349,18 @@ var Builder = class {
347
349
  case "source":
348
350
  case "track":
349
351
  case "wbr":
352
+ case "const":
353
+ case "debug":
354
+ case "id":
355
+ case "let":
356
+ case "lifecycle":
357
+ case "log":
358
+ case "return":
350
359
  bodyType = TagType.void;
351
360
  break;
352
361
  case "html-comment":
362
+ case "html-script":
363
+ case "html-style":
353
364
  case "script":
354
365
  case "textarea":
355
366
  bodyType = TagType.text;
@@ -1080,9 +1091,12 @@ function crawlProgramScope(parsed, scriptParser) {
1080
1091
  case 16 /* AttrTag */: {
1081
1092
  if (child.var) {
1082
1093
  parentScope.bindings ??= {};
1083
- const parsedFn = scriptParser.expressionAt(child.var.value.start - 6, `${read(child.var.value)}=0`);
1094
+ const parsedFn = scriptParser.expressionAt(
1095
+ child.var.value.start - 1,
1096
+ `(${read(child.var.value)})=>0`
1097
+ );
1084
1098
  if (parsedFn) {
1085
- const lVal = parsedFn.left;
1099
+ const lVal = parsedFn.params[0];
1086
1100
  checkForMutations(parentScope, lVal);
1087
1101
  for (const id of getVarIdentifiers(
1088
1102
  parsed,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/language-tools",
3
3
  "description": "Marko Language Tools",
4
- "version": "2.4.6",
4
+ "version": "2.4.8",
5
5
  "bugs": "https://github.com/marko-js/language-server/issues/new?template=Bug_report.md",
6
6
  "peerDependencies": {
7
7
  "@marko/compiler": "^5.28.4"
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "@babel/parser": "^7.26.2",
11
11
  "@luxass/strip-json-comments": "^1.3.2",
12
- "htmljs-parser": "^5.5.2",
12
+ "htmljs-parser": "^5.5.3",
13
13
  "relative-import-path": "^1.0.0"
14
14
  },
15
15
  "devDependencies": {