@marko/language-tools 2.5.53 → 2.5.55
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
|
@@ -1061,7 +1061,7 @@ function isEmptyRange(range) {
|
|
|
1061
1061
|
var import_relative_import_path = require("relative-import-path");
|
|
1062
1062
|
|
|
1063
1063
|
// src/extractors/script/util/attach-scopes.ts
|
|
1064
|
-
var
|
|
1064
|
+
var import_compiler = require("@marko/compiler");
|
|
1065
1065
|
|
|
1066
1066
|
// src/extractors/script/util/is-text-only-script.ts
|
|
1067
1067
|
function isTextOnlyScript(tag) {
|
|
@@ -1077,6 +1077,7 @@ function isTextOnlyScript(tag) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
|
|
1079
1079
|
// src/extractors/script/util/attach-scopes.ts
|
|
1080
|
+
var VISITOR_KEYS = import_compiler.types.VISITOR_KEYS;
|
|
1080
1081
|
var ATTR_UNAMED = "value";
|
|
1081
1082
|
var Scopes = /* @__PURE__ */ new WeakMap();
|
|
1082
1083
|
var BoundAttrValueRange = /* @__PURE__ */ new WeakMap();
|
|
@@ -1613,7 +1614,7 @@ function trackMutations(node, scope, mutations, parentBlock, parentBlockShadows,
|
|
|
1613
1614
|
}
|
|
1614
1615
|
break;
|
|
1615
1616
|
}
|
|
1616
|
-
for (const key of
|
|
1617
|
+
for (const key of VISITOR_KEYS[node.type]) {
|
|
1617
1618
|
const child = node[key];
|
|
1618
1619
|
if (Array.isArray(child)) {
|
|
1619
1620
|
for (const item of child) {
|
|
@@ -1658,7 +1659,7 @@ function trackShadows(node, scope, shadows) {
|
|
|
1658
1659
|
function traverse(node, enter) {
|
|
1659
1660
|
if (!node) return;
|
|
1660
1661
|
if (enter(node)) return;
|
|
1661
|
-
for (const key of
|
|
1662
|
+
for (const key of VISITOR_KEYS[node.type]) {
|
|
1662
1663
|
const child = node[key];
|
|
1663
1664
|
if (Array.isArray(child)) {
|
|
1664
1665
|
for (const item of child) {
|
|
@@ -1941,12 +1942,8 @@ function getRuntimeOverrides(api, runtimeTypes, generics, applyGenerics, returnT
|
|
|
1941
1942
|
}
|
|
1942
1943
|
|
|
1943
1944
|
// src/extractors/script/util/script-parser.ts
|
|
1944
|
-
var
|
|
1945
|
-
var plugins = [
|
|
1946
|
-
"exportDefaultFrom",
|
|
1947
|
-
"importAssertions",
|
|
1948
|
-
"typescript"
|
|
1949
|
-
];
|
|
1945
|
+
var import_babel = require("@marko/compiler/internal/babel");
|
|
1946
|
+
var plugins = ["exportDefaultFrom", "importAssertions", "typescript"];
|
|
1950
1947
|
var ScriptParser = class {
|
|
1951
1948
|
#parsed;
|
|
1952
1949
|
constructor(parsed) {
|
|
@@ -1955,7 +1952,7 @@ var ScriptParser = class {
|
|
|
1955
1952
|
statementAt(startIndex, src) {
|
|
1956
1953
|
const pos = this.#parsed.positionAt(startIndex);
|
|
1957
1954
|
try {
|
|
1958
|
-
return (0,
|
|
1955
|
+
return (0, import_babel.parse)(src, {
|
|
1959
1956
|
plugins,
|
|
1960
1957
|
startIndex,
|
|
1961
1958
|
startLine: pos.line + 1,
|
|
@@ -1976,7 +1973,7 @@ var ScriptParser = class {
|
|
|
1976
1973
|
expressionAt(startIndex, src) {
|
|
1977
1974
|
const pos = this.#parsed.positionAt(startIndex);
|
|
1978
1975
|
try {
|
|
1979
|
-
return (0,
|
|
1976
|
+
return (0, import_babel.parseExpression)(src, {
|
|
1980
1977
|
plugins,
|
|
1981
1978
|
startIndex,
|
|
1982
1979
|
startLine: pos.line + 1,
|
package/dist/index.mjs
CHANGED
|
@@ -1021,7 +1021,7 @@ function isEmptyRange(range) {
|
|
|
1021
1021
|
import { relativeImportPath } from "relative-import-path";
|
|
1022
1022
|
|
|
1023
1023
|
// src/extractors/script/util/attach-scopes.ts
|
|
1024
|
-
import
|
|
1024
|
+
import { types as t } from "@marko/compiler";
|
|
1025
1025
|
|
|
1026
1026
|
// src/extractors/script/util/is-text-only-script.ts
|
|
1027
1027
|
function isTextOnlyScript(tag) {
|
|
@@ -1037,6 +1037,7 @@ function isTextOnlyScript(tag) {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
1039
|
// src/extractors/script/util/attach-scopes.ts
|
|
1040
|
+
var VISITOR_KEYS = t.VISITOR_KEYS;
|
|
1040
1041
|
var ATTR_UNAMED = "value";
|
|
1041
1042
|
var Scopes = /* @__PURE__ */ new WeakMap();
|
|
1042
1043
|
var BoundAttrValueRange = /* @__PURE__ */ new WeakMap();
|
|
@@ -1573,7 +1574,7 @@ function trackMutations(node, scope, mutations, parentBlock, parentBlockShadows,
|
|
|
1573
1574
|
}
|
|
1574
1575
|
break;
|
|
1575
1576
|
}
|
|
1576
|
-
for (const key of
|
|
1577
|
+
for (const key of VISITOR_KEYS[node.type]) {
|
|
1577
1578
|
const child = node[key];
|
|
1578
1579
|
if (Array.isArray(child)) {
|
|
1579
1580
|
for (const item of child) {
|
|
@@ -1618,7 +1619,7 @@ function trackShadows(node, scope, shadows) {
|
|
|
1618
1619
|
function traverse(node, enter) {
|
|
1619
1620
|
if (!node) return;
|
|
1620
1621
|
if (enter(node)) return;
|
|
1621
|
-
for (const key of
|
|
1622
|
+
for (const key of VISITOR_KEYS[node.type]) {
|
|
1622
1623
|
const child = node[key];
|
|
1623
1624
|
if (Array.isArray(child)) {
|
|
1624
1625
|
for (const item of child) {
|
|
@@ -1904,12 +1905,8 @@ function getRuntimeOverrides(api, runtimeTypes, generics, applyGenerics, returnT
|
|
|
1904
1905
|
import {
|
|
1905
1906
|
parse as parseStatement,
|
|
1906
1907
|
parseExpression
|
|
1907
|
-
} from "@babel
|
|
1908
|
-
var plugins = [
|
|
1909
|
-
"exportDefaultFrom",
|
|
1910
|
-
"importAssertions",
|
|
1911
|
-
"typescript"
|
|
1912
|
-
];
|
|
1908
|
+
} from "@marko/compiler/internal/babel";
|
|
1909
|
+
var plugins = ["exportDefaultFrom", "importAssertions", "typescript"];
|
|
1913
1910
|
var ScriptParser = class {
|
|
1914
1911
|
#parsed;
|
|
1915
1912
|
constructor(parsed) {
|
package/marko.internal.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/language-tools",
|
|
3
3
|
"description": "Marko Language Tools",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.55",
|
|
5
5
|
"bugs": "https://github.com/marko-js/language-server/issues/new?template=Bug_report.md",
|
|
6
|
-
"peerDependencies": {
|
|
7
|
-
"@marko/compiler": "^5.28.4"
|
|
8
|
-
},
|
|
9
6
|
"dependencies": {
|
|
10
|
-
"@
|
|
7
|
+
"@marko/compiler": "^5.39.53",
|
|
11
8
|
"@luxass/strip-json-comments": "^1.4.0",
|
|
12
9
|
"htmljs-parser": "^5.7.4",
|
|
13
10
|
"relative-import-path": "^1.0.0"
|
|
14
11
|
},
|
|
15
12
|
"devDependencies": {
|
|
16
|
-
"@babel/code-frame": "^7.28.6",
|
|
17
|
-
"@marko/compiler": "^5.39.49",
|
|
18
13
|
"@types/babel__code-frame": "^7.27.0",
|
|
19
14
|
"@typescript/vfs": "^1.6.2",
|
|
20
|
-
"marko": "^5.38.
|
|
15
|
+
"marko": "^5.38.21",
|
|
21
16
|
"mitata": "^1.0.34",
|
|
22
17
|
"tsx": "^4.21.0"
|
|
23
18
|
},
|