xray16 1.3.2 → 1.3.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.
package/package.json
CHANGED
|
@@ -18,10 +18,10 @@ const plugin = {
|
|
|
18
18
|
filename = filename.slice(0, -3) + ".script";
|
|
19
19
|
}
|
|
20
20
|
if (filename.startsWith("index.")) {
|
|
21
|
-
filename = `${path.basename(path.dirname(node.fileName))}
|
|
21
|
+
filename = `${path.basename(path.dirname(node.fileName))}@${filename}`;
|
|
22
22
|
}
|
|
23
23
|
return (0, sourceFile_1.transformSourceFileNode)(typescript_1.factory.updateSourceFile(node, [
|
|
24
|
-
(0, tracy_1.createTraceZoneBeginNExpression)(`file::${filename}
|
|
24
|
+
(0, tracy_1.createTraceZoneBeginNExpression)(`lua::file::${filename}`),
|
|
25
25
|
...node.statements,
|
|
26
26
|
(0, tracy_1.createTraceZoneEndExpression)(),
|
|
27
27
|
], node.isDeclarationFile, node.referencedFiles, node.typeReferenceDirectives, node.hasNoDefaultLib, node.libReferenceDirectives), context);
|
package/plugins/utils/tracy.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArrowFunction,
|
|
1
|
+
import { ArrowFunction, ExpressionStatement, FunctionDeclaration, MethodDeclaration, Node, NodeArray, Statement } from "typescript";
|
|
2
2
|
export declare function isTraceBeginExpression(node: Node): boolean;
|
|
3
3
|
export declare function isTraceEndExpression(node: Node): boolean;
|
|
4
4
|
export declare function createTraceZoneBeginExpression(): ExpressionStatement;
|
|
@@ -9,5 +9,5 @@ export declare function remapStatementsWithZoneEnd<T extends {
|
|
|
9
9
|
statements: NodeArray<Statement>;
|
|
10
10
|
}>(target: T): Array<Statement>;
|
|
11
11
|
export declare function transformNestedStatementsToInjectEndZones(statement?: Statement): Statement;
|
|
12
|
-
export declare function transformWithInjectedZones<T extends FunctionDeclaration | MethodDeclaration
|
|
12
|
+
export declare function transformWithInjectedZones<T extends FunctionDeclaration | MethodDeclaration>(node: T, parentName?: string): T;
|
|
13
13
|
export declare function transformArrowFunctionWithInjectedZones<T extends ArrowFunction>(node: T, name: string): T;
|
package/plugins/utils/tracy.js
CHANGED
|
@@ -120,7 +120,7 @@ function transformWithInjectedZones(node, parentName) {
|
|
|
120
120
|
}
|
|
121
121
|
const statements = remapStatementsWithZoneEnd(node.body).map(transformNestedStatementsToInjectEndZones);
|
|
122
122
|
// Zone start declaration.
|
|
123
|
-
statements.unshift(createTraceZoneBeginNExpression(
|
|
123
|
+
statements.unshift(createTraceZoneBeginNExpression(`lua::${(0, typescript_1.isMethodDeclaration)(node) ? "method" : "function"}::${parentName ? `${parentName}::` : ""}${name}`));
|
|
124
124
|
// Zone end declaration without explicit return.
|
|
125
125
|
if (!hasReturnStatement) {
|
|
126
126
|
statements.push(createTraceZoneEndExpression());
|
|
@@ -128,9 +128,6 @@ function transformWithInjectedZones(node, parentName) {
|
|
|
128
128
|
if ((0, typescript_1.isMethodDeclaration)(node)) {
|
|
129
129
|
return typescript_1.factory.updateMethodDeclaration(node, node.modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, typescript_1.factory.updateBlock(node.body, statements));
|
|
130
130
|
}
|
|
131
|
-
else if ((0, typescript_1.isConstructorDeclaration)(node)) {
|
|
132
|
-
return typescript_1.factory.updateConstructorDeclaration(node, node.modifiers, node.parameters, typescript_1.factory.updateBlock(node.body, statements));
|
|
133
|
-
}
|
|
134
131
|
else {
|
|
135
132
|
return typescript_1.factory.updateFunctionDeclaration(node, node.modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, typescript_1.factory.updateBlock(node.body, statements));
|
|
136
133
|
}
|
|
@@ -146,7 +143,7 @@ function transformArrowFunctionWithInjectedZones(node, name) {
|
|
|
146
143
|
}
|
|
147
144
|
const statements = remapStatementsWithZoneEnd(node.body).map(transformNestedStatementsToInjectEndZones);
|
|
148
145
|
// Zone start declaration.
|
|
149
|
-
statements.unshift(createTraceZoneBeginNExpression(
|
|
146
|
+
statements.unshift(createTraceZoneBeginNExpression(`lua::function::${name}`));
|
|
150
147
|
// Zone end declaration without explicit return.
|
|
151
148
|
if (!hasReturnStatement) {
|
|
152
149
|
statements.push(createTraceZoneEndExpression());
|