Skip to content

Commit 3f76047

Browse files
committed
Removed line & numbers column numbers for now as they were creating mess & were not accurate
1 parent 4d92b81 commit 3f76047

File tree

8 files changed

+5
-45
lines changed

8 files changed

+5
-45
lines changed

rocket-chatter-ingestion-server/src/process/prepare/processor/core/treeNode.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ export class TreeNode {
33
type: string = ""
44
body: string = ""
55

6-
lineNumber: number
7-
columnNumber: number
86
sourceFileRelativePath: string
97

108
uses: {
@@ -16,15 +14,11 @@ export class TreeNode {
1614
name: string,
1715
type: string,
1816
body: string,
19-
lineNumber: number,
20-
columnNumber: number,
2117
sourceFilePath: string
2218
) {
2319
this.name = name
2420
this.type = type
2521
this.body = body
26-
this.lineNumber = lineNumber
27-
this.columnNumber = columnNumber
2822
this.sourceFileRelativePath = sourceFilePath
2923
}
3024

@@ -33,7 +27,7 @@ export class TreeNode {
3327
}
3428

3529
getID(): string {
36-
return `${this.sourceFileRelativePath}:${this.name}:${this.type}:${this.lineNumber}:${this.columnNumber}`
30+
return `${this.sourceFileRelativePath}:${this.name}:${this.type}`
3731
}
3832

3933
pushUse(...uses: { name: string; type: string }[]) {

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ import { Functions } from "./functions"
55

66
export namespace Classes {
77
export function Handle(n: namedTypes.ClassDeclaration) {
8-
const node = new TreeNode(
9-
n.id?.name.toString() ?? "",
10-
"Class",
11-
"",
12-
n.loc?.start.line ?? 0,
13-
n.loc?.start.column ?? 0,
14-
""
15-
)
8+
const node = new TreeNode(n.id?.name.toString() ?? "", "Class", "", "")
169

1710
// Check for type parameters
1811
const typeParameters: string[] = []

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ import { Functions } from "./functions"
55

66
export namespace Enums {
77
export function Handle(n: namedTypes.EnumDeclaration) {
8-
const node = new TreeNode(
9-
n.id?.name.toString() ?? "",
10-
"Enum",
11-
"",
12-
n.loc?.start.line ?? 0,
13-
n.loc?.start.column ?? 0,
14-
""
15-
)
8+
const node = new TreeNode(n.id?.name.toString() ?? "", "Enum", "", "")
169

1710
// Check for external references while initializing the enum members
1811
for (const m of (n as any).members as namedTypes.TSEnumMember[]) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export namespace Functions {
1111
n.id?.name.toString() ?? "",
1212
"Function",
1313
n.body.body.map((e) => print(e).code).join("\n"),
14-
n.loc?.start.line ?? 0,
15-
n.loc?.start.column ?? 0,
1614
""
1715
)
1816

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ export namespace Interface {
1010
n.id?.name.toString() ?? "",
1111
"Interface",
1212
(n.body as any).body.map((e: any) => print(e).code).join("\n"),
13-
n.loc?.start.line ?? 0,
14-
n.loc?.start.column ?? 0,
1513
""
1614
)
1715

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export namespace Namespaces {
1111
(n.id as any)?.name.toString() ?? "",
1212
"Namespace",
1313
"",
14-
n.loc?.start.line ?? 0,
15-
n.loc?.start.column ?? 0,
1614
""
1715
)
1816

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ import { TypeAnnotation } from "../core/typeAnnotation"
44

55
export namespace TypeAlias {
66
export function Handle(n: namedTypes.TSTypeAliasDeclaration) {
7-
const node = new TreeNode(
8-
n.id?.name.toString() ?? "",
9-
"TypeAlias",
10-
"",
11-
n.loc?.start.line ?? 0,
12-
n.loc?.start.column ?? 0,
13-
""
14-
)
7+
const node = new TreeNode(n.id?.name.toString() ?? "", "TypeAlias", "", "")
158

169
// Check for type parameters
1710
const typeParameters: string[] = []

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,7 @@ export namespace VariableDeclarations {
1010
// For variable declarations
1111
for (const d of n.declarations) {
1212
if (namedTypes.VariableDeclarator.check(d)) {
13-
const node = new TreeNode(
14-
(d.id as any).name,
15-
"variable",
16-
"",
17-
n.loc?.start.line ?? 0,
18-
n.loc?.start.column ?? 0,
19-
""
20-
)
13+
const node = new TreeNode((d.id as any).name, "variable", "", "")
2114

2215
// For variables declared using other variables
2316
if (namedTypes.Identifier.check(d.init)) {

0 commit comments

Comments
 (0)