@katana-project/laser 0.1.0
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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/resolver.d.ts +21 -0
- package/dist/resolver.js +190 -0
- package/dist/tree-utils.d.ts +7 -0
- package/dist/tree-utils.js +70 -0
- package/dist/unit.d.ts +20 -0
- package/dist/unit.js +98 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matouš Kučera
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SyntaxNode, Tree } from "@lezer/common";
|
|
2
|
+
import { CompilationUnit } from "./unit.js";
|
|
3
|
+
export interface TypeReference {
|
|
4
|
+
name: string;
|
|
5
|
+
node: SyntaxNode;
|
|
6
|
+
}
|
|
7
|
+
export interface ResolvedType {
|
|
8
|
+
kind: "declared" | "imported" | "builtin" | "unresolved";
|
|
9
|
+
name: string;
|
|
10
|
+
qualifiedName?: string;
|
|
11
|
+
declaration?: SyntaxNode;
|
|
12
|
+
ref: TypeReference;
|
|
13
|
+
}
|
|
14
|
+
export declare const resolveTypeReference: (typeRef: TypeReference, unit: CompilationUnit) => ResolvedType;
|
|
15
|
+
export interface TypeReferenceResolver {
|
|
16
|
+
unit: CompilationUnit;
|
|
17
|
+
resolveAt(offset: number): ResolvedType | null;
|
|
18
|
+
resolveReferenceAt(offset: number): TypeReference | null;
|
|
19
|
+
resolveAll(): ResolvedType[];
|
|
20
|
+
}
|
|
21
|
+
export declare const createTypeReferenceResolver: (tree: Tree, source: string) => TypeReferenceResolver;
|
package/dist/resolver.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { getNodeStack } from "./tree-utils.js";
|
|
2
|
+
import { parseUnit } from "./unit.js";
|
|
3
|
+
const BUILTIN_TYPES = new Set(["byte", "short", "int", "long", "char", "float", "double", "boolean", "void"]);
|
|
4
|
+
const ALLOWED_PARENTS = new Set([
|
|
5
|
+
"TypeName",
|
|
6
|
+
"ScopedTypeName",
|
|
7
|
+
"PrimitiveType",
|
|
8
|
+
"void",
|
|
9
|
+
"Identifier",
|
|
10
|
+
"ScopedIdentifier",
|
|
11
|
+
"Definition",
|
|
12
|
+
"FieldAccess",
|
|
13
|
+
]);
|
|
14
|
+
const getTypeName = (node, source) => {
|
|
15
|
+
switch (node.name) {
|
|
16
|
+
case "TypeName":
|
|
17
|
+
case "ScopedTypeName": {
|
|
18
|
+
if (node.parent && ALLOWED_PARENTS.has(node.parent.type.name)) {
|
|
19
|
+
return getTypeName(node.parent, source);
|
|
20
|
+
}
|
|
21
|
+
return source.slice(node.from, node.to);
|
|
22
|
+
}
|
|
23
|
+
case "PrimitiveType":
|
|
24
|
+
case "void": {
|
|
25
|
+
return source.slice(node.from, node.to);
|
|
26
|
+
}
|
|
27
|
+
case "Identifier":
|
|
28
|
+
case "ScopedIdentifier": {
|
|
29
|
+
if (node.parent) {
|
|
30
|
+
if (ALLOWED_PARENTS.has(node.parent.type.name)) {
|
|
31
|
+
return getTypeName(node.parent, source);
|
|
32
|
+
}
|
|
33
|
+
else if (node.parent.name !== "MarkerAnnotation" &&
|
|
34
|
+
node.parent.name !== "Annotation" &&
|
|
35
|
+
node.parent.name !== "AnnotationTypeDeclaration") {
|
|
36
|
+
// only allow getting Identifier-based type names from annotations
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return source.slice(node.from, node.to);
|
|
41
|
+
}
|
|
42
|
+
case "Definition": {
|
|
43
|
+
if (node.parent.name !== "EnumDeclaration" &&
|
|
44
|
+
node.parent.name !== "ClassDeclaration" &&
|
|
45
|
+
node.parent.name !== "ConstructorDeclaration" &&
|
|
46
|
+
node.parent.name !== "InterfaceDeclaration" &&
|
|
47
|
+
node.parent.name !== "LocalVariableDeclaration") {
|
|
48
|
+
// only allow getting Definition-based type names from these declarations
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return source.slice(node.from, node.to);
|
|
52
|
+
}
|
|
53
|
+
case "FieldAccess": {
|
|
54
|
+
if (node.parent?.name === "FieldAccess" || node.firstChild.name !== "Identifier") {
|
|
55
|
+
// pointing at a field, inner class access or a different expression, we can't resolve that
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return source.slice(node.firstChild.from, node.firstChild.to);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
};
|
|
63
|
+
const findTypeReference = (nodes, source) => {
|
|
64
|
+
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
65
|
+
const node = nodes[i];
|
|
66
|
+
const name = getTypeName(node, source);
|
|
67
|
+
if (name) {
|
|
68
|
+
return {
|
|
69
|
+
name,
|
|
70
|
+
node,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
const collectAllTypeReferences = (node, source, refs) => {
|
|
77
|
+
const name = getTypeName(node, source);
|
|
78
|
+
if (name) {
|
|
79
|
+
const existing = refs.find((r) => r.node === node);
|
|
80
|
+
if (!existing) {
|
|
81
|
+
refs.push({
|
|
82
|
+
name,
|
|
83
|
+
node,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// enter node, as we didn't find a type reference here
|
|
89
|
+
let child = node.firstChild;
|
|
90
|
+
while (child) {
|
|
91
|
+
collectAllTypeReferences(child, source, refs);
|
|
92
|
+
child = child.nextSibling;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const resolveInUnit = (typeName, unit) => {
|
|
97
|
+
for (const cls of unit.types) {
|
|
98
|
+
if (cls.name === typeName || cls.qualifiedName === typeName) {
|
|
99
|
+
return cls;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
};
|
|
104
|
+
const resolveImported = (typeRef, unit) => {
|
|
105
|
+
const parts = typeRef.name.split(".");
|
|
106
|
+
const firstPart = parts[0];
|
|
107
|
+
for (const imp of unit.imports) {
|
|
108
|
+
if (!imp.isWildcard) {
|
|
109
|
+
const importParts = imp.importedName.split(".");
|
|
110
|
+
const importedClass = importParts[importParts.length - 1];
|
|
111
|
+
if (importedClass === firstPart) {
|
|
112
|
+
return {
|
|
113
|
+
kind: "imported",
|
|
114
|
+
name: typeRef.name,
|
|
115
|
+
qualifiedName: imp.importedName,
|
|
116
|
+
ref: typeRef,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
};
|
|
123
|
+
export const resolveTypeReference = (typeRef, unit) => {
|
|
124
|
+
const typeName = typeRef.name;
|
|
125
|
+
if (BUILTIN_TYPES.has(typeName)) {
|
|
126
|
+
return {
|
|
127
|
+
kind: "builtin",
|
|
128
|
+
name: typeName,
|
|
129
|
+
ref: typeRef,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
const localResolved = resolveInUnit(typeName, unit);
|
|
133
|
+
if (localResolved) {
|
|
134
|
+
return {
|
|
135
|
+
kind: "declared",
|
|
136
|
+
name: localResolved.name,
|
|
137
|
+
qualifiedName: localResolved.qualifiedName,
|
|
138
|
+
declaration: localResolved.node,
|
|
139
|
+
ref: typeRef,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const importedResolved = resolveImported(typeRef, unit);
|
|
143
|
+
if (importedResolved) {
|
|
144
|
+
return importedResolved;
|
|
145
|
+
}
|
|
146
|
+
if (unit.packageName) {
|
|
147
|
+
const qualifiedName = `${unit.packageName}.${typeName}`;
|
|
148
|
+
const resolved = resolveInUnit(qualifiedName, unit);
|
|
149
|
+
if (resolved) {
|
|
150
|
+
return {
|
|
151
|
+
kind: "imported",
|
|
152
|
+
name: resolved.name,
|
|
153
|
+
qualifiedName: resolved.qualifiedName,
|
|
154
|
+
declaration: resolved.node,
|
|
155
|
+
ref: typeRef,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
kind: "unresolved",
|
|
161
|
+
name: typeName,
|
|
162
|
+
ref: typeRef,
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
export const createTypeReferenceResolver = (tree, source) => {
|
|
166
|
+
const unit = parseUnit(tree.topNode, source);
|
|
167
|
+
return {
|
|
168
|
+
unit,
|
|
169
|
+
resolveAt: (offset) => {
|
|
170
|
+
const nodes = getNodeStack(tree, offset);
|
|
171
|
+
if (!nodes)
|
|
172
|
+
return null;
|
|
173
|
+
const typeRef = findTypeReference(nodes, source);
|
|
174
|
+
if (!typeRef)
|
|
175
|
+
return null;
|
|
176
|
+
return resolveTypeReference(typeRef, unit);
|
|
177
|
+
},
|
|
178
|
+
resolveReferenceAt: (offset) => {
|
|
179
|
+
const nodes = getNodeStack(tree, offset);
|
|
180
|
+
if (!nodes)
|
|
181
|
+
return null;
|
|
182
|
+
return findTypeReference(nodes, source);
|
|
183
|
+
},
|
|
184
|
+
resolveAll: () => {
|
|
185
|
+
const refs = [];
|
|
186
|
+
collectAllTypeReferences(tree.topNode, source, refs);
|
|
187
|
+
return refs.map((ref) => resolveTypeReference(ref, unit));
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SyntaxNode, Tree } from "@lezer/common";
|
|
2
|
+
export declare const getNodeStack: (tree: Tree, offset: number) => SyntaxNode[] | null;
|
|
3
|
+
export declare const getChildren: (node: SyntaxNode) => SyntaxNode[];
|
|
4
|
+
export declare const findChild: (node: SyntaxNode, predicate: (child: SyntaxNode) => boolean) => SyntaxNode | null;
|
|
5
|
+
export declare const findChildren: (node: SyntaxNode, predicate: (child: SyntaxNode) => boolean) => SyntaxNode[];
|
|
6
|
+
export declare const findDescendant: (node: SyntaxNode, predicate: (node: SyntaxNode) => boolean) => SyntaxNode | null;
|
|
7
|
+
export declare const findDescendants: (node: SyntaxNode, predicate: (node: SyntaxNode) => boolean) => SyntaxNode[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const getNodeStack = (tree, offset) => {
|
|
2
|
+
if (offset < 0 || offset > tree.length)
|
|
3
|
+
return null;
|
|
4
|
+
let node = tree.resolveInner(offset, 1);
|
|
5
|
+
if (!node)
|
|
6
|
+
return null;
|
|
7
|
+
const nodes = [];
|
|
8
|
+
let current = node;
|
|
9
|
+
while (current) {
|
|
10
|
+
nodes.unshift(current);
|
|
11
|
+
current = current.parent;
|
|
12
|
+
}
|
|
13
|
+
return nodes.length > 0 ? nodes : null;
|
|
14
|
+
};
|
|
15
|
+
export const getChildren = (node) => {
|
|
16
|
+
const children = [];
|
|
17
|
+
let child = node.firstChild;
|
|
18
|
+
while (child) {
|
|
19
|
+
children.push(child);
|
|
20
|
+
child = child.nextSibling;
|
|
21
|
+
}
|
|
22
|
+
return children;
|
|
23
|
+
};
|
|
24
|
+
export const findChild = (node, predicate) => {
|
|
25
|
+
let child = node.firstChild;
|
|
26
|
+
while (child) {
|
|
27
|
+
if (predicate(child)) {
|
|
28
|
+
return child;
|
|
29
|
+
}
|
|
30
|
+
child = child.nextSibling;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
};
|
|
34
|
+
export const findChildren = (node, predicate) => {
|
|
35
|
+
const result = [];
|
|
36
|
+
let child = node.firstChild;
|
|
37
|
+
while (child) {
|
|
38
|
+
if (predicate(child)) {
|
|
39
|
+
result.push(child);
|
|
40
|
+
}
|
|
41
|
+
child = child.nextSibling;
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
export const findDescendant = (node, predicate) => {
|
|
46
|
+
if (predicate(node)) {
|
|
47
|
+
return node;
|
|
48
|
+
}
|
|
49
|
+
let child = node.firstChild;
|
|
50
|
+
while (child) {
|
|
51
|
+
const found = findDescendant(child, predicate);
|
|
52
|
+
if (found) {
|
|
53
|
+
return found;
|
|
54
|
+
}
|
|
55
|
+
child = child.nextSibling;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
};
|
|
59
|
+
export const findDescendants = (node, predicate) => {
|
|
60
|
+
const result = [];
|
|
61
|
+
if (predicate(node)) {
|
|
62
|
+
result.push(node);
|
|
63
|
+
}
|
|
64
|
+
let child = node.firstChild;
|
|
65
|
+
while (child) {
|
|
66
|
+
result.push(...findDescendants(child, predicate));
|
|
67
|
+
child = child.nextSibling;
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
};
|
package/dist/unit.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SyntaxNode } from "@lezer/common";
|
|
2
|
+
export interface ImportInfo {
|
|
3
|
+
importedName: string;
|
|
4
|
+
isStatic: boolean;
|
|
5
|
+
isWildcard: boolean;
|
|
6
|
+
node: SyntaxNode;
|
|
7
|
+
}
|
|
8
|
+
export interface TypeInfo {
|
|
9
|
+
kind: "class" | "interface" | "enum" | "annotation" | "module";
|
|
10
|
+
name: string;
|
|
11
|
+
qualifiedName: string;
|
|
12
|
+
node: SyntaxNode;
|
|
13
|
+
typeParameters: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface CompilationUnit {
|
|
16
|
+
packageName: string | null;
|
|
17
|
+
imports: ImportInfo[];
|
|
18
|
+
types: TypeInfo[];
|
|
19
|
+
}
|
|
20
|
+
export declare const parseUnit: (root: SyntaxNode, source: string) => CompilationUnit;
|
package/dist/unit.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { findChild } from "./tree-utils.js";
|
|
2
|
+
const extractTypeParameters = (node, source) => {
|
|
3
|
+
const typeParamsNode = findChild(node, (c) => c.name === "TypeParameters");
|
|
4
|
+
if (!typeParamsNode) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const params = [];
|
|
8
|
+
let child = typeParamsNode.firstChild;
|
|
9
|
+
while (child) {
|
|
10
|
+
if (child.name === "TypeParameter") {
|
|
11
|
+
const def = findChild(child, (c) => c.name === "Definition");
|
|
12
|
+
if (def) {
|
|
13
|
+
params.push(source.slice(def.from, def.to));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
child = child.nextSibling;
|
|
17
|
+
}
|
|
18
|
+
return params;
|
|
19
|
+
};
|
|
20
|
+
export const parseUnit = (root, source) => {
|
|
21
|
+
const unit = {
|
|
22
|
+
packageName: null,
|
|
23
|
+
imports: [],
|
|
24
|
+
types: [],
|
|
25
|
+
};
|
|
26
|
+
const processNode = (node, qualifiedPrefix) => {
|
|
27
|
+
if (node.name === "PackageDeclaration") {
|
|
28
|
+
const nameNode = findChild(node, (c) => c.name === "Identifier" || c.name === "ScopedIdentifier");
|
|
29
|
+
if (nameNode) {
|
|
30
|
+
unit.packageName = source.slice(nameNode.from, nameNode.to);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (node.name === "ImportDeclaration") {
|
|
34
|
+
const isStatic = !!findChild(node, (c) => c.name === "static");
|
|
35
|
+
const isWildcard = !!findChild(node, (c) => c.name === "Asterisk");
|
|
36
|
+
const nameNode = findChild(node, (c) => c.name === "Identifier" || c.name === "ScopedIdentifier");
|
|
37
|
+
if (nameNode) {
|
|
38
|
+
const importedName = source.slice(nameNode.from, nameNode.to);
|
|
39
|
+
if (importedName) {
|
|
40
|
+
unit.imports.push({
|
|
41
|
+
importedName,
|
|
42
|
+
isStatic,
|
|
43
|
+
isWildcard,
|
|
44
|
+
node,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else if (node.name === "ClassDeclaration" ||
|
|
50
|
+
node.name === "InterfaceDeclaration" ||
|
|
51
|
+
node.name === "EnumDeclaration" ||
|
|
52
|
+
node.name === "AnnotationTypeDeclaration" ||
|
|
53
|
+
node.name === "ModuleDeclaration") {
|
|
54
|
+
const defNode = findChild(node, (c) => c.name === "Definition" || c.name === "Identifier");
|
|
55
|
+
if (defNode) {
|
|
56
|
+
const name = source.slice(defNode.from, defNode.to);
|
|
57
|
+
const qualifiedName = qualifiedPrefix ? `${qualifiedPrefix}.${name}` : name;
|
|
58
|
+
const typeParameters = extractTypeParameters(node, source);
|
|
59
|
+
unit.types.push({
|
|
60
|
+
kind: node.name === "ClassDeclaration"
|
|
61
|
+
? "class"
|
|
62
|
+
: node.name === "InterfaceDeclaration"
|
|
63
|
+
? "interface"
|
|
64
|
+
: node.name === "EnumDeclaration"
|
|
65
|
+
? "enum"
|
|
66
|
+
: node.name === "AnnotationTypeDeclaration"
|
|
67
|
+
? "annotation"
|
|
68
|
+
: "module",
|
|
69
|
+
name,
|
|
70
|
+
qualifiedName,
|
|
71
|
+
node,
|
|
72
|
+
typeParameters,
|
|
73
|
+
});
|
|
74
|
+
const classBody = findChild(node, (c) => c.name === "ClassBody" ||
|
|
75
|
+
c.name === "InterfaceBody" ||
|
|
76
|
+
c.name === "AnnotationTypeBody" ||
|
|
77
|
+
c.name === "ModuleBody" ||
|
|
78
|
+
c.name === "EnumBody");
|
|
79
|
+
if (classBody) {
|
|
80
|
+
let child = classBody.firstChild;
|
|
81
|
+
while (child) {
|
|
82
|
+
processNode(child, qualifiedName);
|
|
83
|
+
child = child.nextSibling;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
let child = node.firstChild;
|
|
90
|
+
while (child) {
|
|
91
|
+
processNode(child, qualifiedPrefix);
|
|
92
|
+
child = child.nextSibling;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
processNode(root, "");
|
|
97
|
+
return unit;
|
|
98
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@katana-project/laser",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"author": "katana-project",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"description": "A Java source code analysis engine, built on the Lezer parser.",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"./dist/**/*",
|
|
16
|
+
"package.json",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc --project tsconfig.build.json",
|
|
22
|
+
"test": "mocha",
|
|
23
|
+
"format": "prettier . --write"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@lezer/common": "^1.5.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@lezer/java": "^1.1.3",
|
|
30
|
+
"@types/chai": "^5.2.3",
|
|
31
|
+
"@types/mocha": "^10.0.10",
|
|
32
|
+
"@types/node": "^25.0.5",
|
|
33
|
+
"chai": "^6.2.2",
|
|
34
|
+
"mocha": "^11.7.5",
|
|
35
|
+
"prettier": "^3.7.4",
|
|
36
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
37
|
+
"tsx": "^4.21.0",
|
|
38
|
+
"typescript": "^5.9.3"
|
|
39
|
+
},
|
|
40
|
+
"packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48"
|
|
41
|
+
}
|