Skip to content

Commit 427c1b5

Browse files
committed
Added ref to the source file in the TreeNode
1 parent dc12a4e commit 427c1b5

File tree

9 files changed

+14
-26
lines changed

9 files changed

+14
-26
lines changed

rocket-chatter-ingestion-server/src/process/prepare/processor/syntax/classes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export namespace Classes {
1010
"Class",
1111
"",
1212
n.loc?.start.line ?? 0,
13-
n.loc?.start.column ?? 0
13+
n.loc?.start.column ?? 0,
14+
""
1415
)
1516

1617
// Check for type parameters

rocket-chatter-ingestion-server/src/process/prepare/processor/syntax/enums.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export namespace Enums {
1010
"Enum",
1111
"",
1212
n.loc?.start.line ?? 0,
13-
n.loc?.start.column ?? 0
13+
n.loc?.start.column ?? 0,
14+
""
1415
)
1516

1617
// Check for external references while initializing the enum members

rocket-chatter-ingestion-server/src/process/prepare/processor/syntax/functions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export namespace Functions {
1212
"Function",
1313
n.body.body.map((e) => print(e).code).join("\n"),
1414
n.loc?.start.line ?? 0,
15-
n.loc?.start.column ?? 0
15+
n.loc?.start.column ?? 0,
16+
""
1617
)
1718

1819
// Check for type parameters

rocket-chatter-ingestion-server/src/process/prepare/processor/syntax/interface.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export namespace Interface {
1111
"Interface",
1212
(n.body as any).body.map((e: any) => print(e).code).join("\n"),
1313
n.loc?.start.line ?? 0,
14-
n.loc?.start.column ?? 0
14+
n.loc?.start.column ?? 0,
15+
""
1516
)
1617

1718
// Check for type parameters

rocket-chatter-ingestion-server/src/process/prepare/processor/syntax/namespaces.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export namespace Namespaces {
1212
"Namespace",
1313
"",
1414
n.loc?.start.line ?? 0,
15-
n.loc?.start.column ?? 0
15+
n.loc?.start.column ?? 0,
16+
""
1617
)
1718

1819
const body = ((n as any).declaration?.body?.body ??

rocket-chatter-ingestion-server/src/process/prepare/processor/syntax/typeAlias.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export namespace TypeAlias {
99
"TypeAlias",
1010
"",
1111
n.loc?.start.line ?? 0,
12-
n.loc?.start.column ?? 0
12+
n.loc?.start.column ?? 0,
13+
""
1314
)
1415

1516
// Check for type parameters

rocket-chatter-ingestion-server/src/process/prepare/processor/syntax/variableDeclarations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export namespace VariableDeclarations {
1515
"variable",
1616
"",
1717
n.loc?.start.line ?? 0,
18-
n.loc?.start.column ?? 0
18+
n.loc?.start.column ?? 0,
19+
""
1920
)
2021

2122
// For variables declared using other variables

rocket-chatter-ingestion-server/src/process/prepare/sourceFile.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,4 @@ export class SourceFile implements ISourceFile {
1818
getFullPath(): string {
1919
return this._path
2020
}
21-
22-
registerSyntax(node: TreeNode): void {
23-
const nodeID = `${this._path}:${node.getID()}`
24-
this._syntaxNodes[nodeID] = node
25-
}
26-
27-
hasSyntax(nodeID: string): boolean {
28-
return nodeID in this._syntaxNodes
29-
}
30-
31-
getSyntaxNode(nodeID: string): TreeNode {
32-
return this._syntaxNodes[nodeID]
33-
}
3421
}

rocket-chatter-ingestion-server/src/process/prepare/sourceFile.types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { TreeNode } from "./processor/core/treeNode"
2-
31
export enum SourceFileType {
42
// TypeScript
53
TypeScript,
@@ -16,8 +14,4 @@ export enum SourceFileType {
1614
export interface ISourceFile {
1715
read(): string
1816
getFullPath(): string
19-
20-
registerSyntax(node: TreeNode): void
21-
hasSyntax(nodeID: string): boolean
22-
getSyntaxNode(nodeID: string): TreeNode
2317
}

0 commit comments

Comments
 (0)