@@ -11,6 +11,7 @@ trait LocationEMT
11
11
extends AnyRef
12
12
with HasClassNameEMT
13
13
with HasClassShortNameEMT
14
+ with HasColumnNumberEMT
14
15
with HasFilenameEMT
15
16
with HasLineNumberEMT
16
17
with HasMethodFullNameEMT
@@ -26,6 +27,7 @@ trait LocationBase extends AbstractNode with StaticType[LocationEMT] {
26
27
val res = new java.util.HashMap [String , Any ]()
27
28
if ((" <empty>" : String ) != this .className) res.put(" CLASS_NAME" , this .className)
28
29
if ((" <empty>" : String ) != this .classShortName) res.put(" CLASS_SHORT_NAME" , this .classShortName)
30
+ this .columnNumber.foreach { p => res.put(" COLUMN_NUMBER" , p) }
29
31
if ((" <empty>" : String ) != this .filename) res.put(" FILENAME" , this .filename)
30
32
this .lineNumber.foreach { p => res.put(" LINE_NUMBER" , p) }
31
33
if ((" <empty>" : String ) != this .methodFullName) res.put(" METHOD_FULL_NAME" , this .methodFullName)
@@ -46,6 +48,10 @@ object Location {
46
48
47
49
val ClassShortName = " CLASS_SHORT_NAME"
48
50
51
+ /** This optional fields provides the column number of the program construct represented by the node.
52
+ */
53
+ val ColumnNumber = " COLUMN_NUMBER"
54
+
49
55
/** The path of the source file this node was generated from, relative to the root path in the meta data node. This
50
56
* field must be set but may be set to the value `<unknown>` to indicate that no source file can be associated with
51
57
* the node, e.g., because the node represents an entity known to exist because it is referenced, but for which the
@@ -75,6 +81,10 @@ object Location {
75
81
val ClassName = flatgraph.SinglePropertyKey [String ](kind = 6 , name = " CLASS_NAME" , default = " <empty>" )
76
82
val ClassShortName = flatgraph.SinglePropertyKey [String ](kind = 7 , name = " CLASS_SHORT_NAME" , default = " <empty>" )
77
83
84
+ /** This optional fields provides the column number of the program construct represented by the node.
85
+ */
86
+ val ColumnNumber = flatgraph.OptionalPropertyKey [Int ](kind = 11 , name = " COLUMN_NUMBER" )
87
+
78
88
/** The path of the source file this node was generated from, relative to the root path in the meta data node. This
79
89
* field must be set but may be set to the value `<unknown>` to indicate that no source file can be associated with
80
90
* the node, e.g., because the node represents an entity known to exist because it is referenced, but for which the
@@ -116,36 +126,38 @@ class Location(graph_4762: flatgraph.Graph, seq_4762: Int)
116
126
117
127
override def productElementName (n : Int ): String =
118
128
n match {
119
- case 0 => " className"
120
- case 1 => " classShortName"
121
- case 2 => " filename"
122
- case 3 => " lineNumber"
123
- case 4 => " methodFullName"
124
- case 5 => " methodShortName"
125
- case 6 => " nodeLabel"
126
- case 7 => " packageName"
127
- case 8 => " symbol"
128
- case 9 => " node"
129
- case _ => " "
129
+ case 0 => " className"
130
+ case 1 => " classShortName"
131
+ case 2 => " columnNumber"
132
+ case 3 => " filename"
133
+ case 4 => " lineNumber"
134
+ case 5 => " methodFullName"
135
+ case 6 => " methodShortName"
136
+ case 7 => " nodeLabel"
137
+ case 8 => " packageName"
138
+ case 9 => " symbol"
139
+ case 10 => " node"
140
+ case _ => " "
130
141
}
131
142
132
143
override def productElement (n : Int ): Any =
133
144
n match {
134
- case 0 => this .className
135
- case 1 => this .classShortName
136
- case 2 => this .filename
137
- case 3 => this .lineNumber
138
- case 4 => this .methodFullName
139
- case 5 => this .methodShortName
140
- case 6 => this .nodeLabel
141
- case 7 => this .packageName
142
- case 8 => this .symbol
143
- case 9 => this .node
144
- case _ => null
145
+ case 0 => this .className
146
+ case 1 => this .classShortName
147
+ case 2 => this .columnNumber
148
+ case 3 => this .filename
149
+ case 4 => this .lineNumber
150
+ case 5 => this .methodFullName
151
+ case 6 => this .methodShortName
152
+ case 7 => this .nodeLabel
153
+ case 8 => this .packageName
154
+ case 9 => this .symbol
155
+ case 10 => this .node
156
+ case _ => null
145
157
}
146
158
147
159
override def productPrefix = " Location"
148
- override def productArity = 10
160
+ override def productArity = 11
149
161
150
162
override def canEqual (that : Any ): Boolean = that != null && that.isInstanceOf [Location ]
151
163
}
@@ -206,6 +218,35 @@ object NewLocation {
206
218
}
207
219
}
208
220
}
221
+ object NewNodeInserter_Location_columnNumber extends flatgraph.NewNodePropertyInsertionHelper {
222
+ override def insertNewNodeProperties (
223
+ newNodes : mutable.ArrayBuffer [flatgraph.DNode ],
224
+ dst : AnyRef ,
225
+ offsets : Array [Int ]
226
+ ): Unit = {
227
+ if (newNodes.isEmpty) return
228
+ val dstCast = dst.asInstanceOf [Array [Int ]]
229
+ val seq = newNodes.head.storedRef.get.seq()
230
+ var offset = offsets(seq)
231
+ var idx = 0
232
+ while (idx < newNodes.length) {
233
+ val nn = newNodes(idx)
234
+ nn match {
235
+ case generated : NewLocation =>
236
+ generated.columnNumber match {
237
+ case Some (item) =>
238
+ dstCast(offset) = item
239
+ offset += 1
240
+ case _ =>
241
+ }
242
+ case _ =>
243
+ }
244
+ assert(seq + idx == nn.storedRef.get.seq(), " internal consistency check" )
245
+ idx += 1
246
+ offsets(idx + seq) = offset
247
+ }
248
+ }
249
+ }
209
250
object NewNodeInserter_Location_filename extends flatgraph.NewNodePropertyInsertionHelper {
210
251
override def insertNewNodeProperties (
211
252
newNodes : mutable.ArrayBuffer [flatgraph.DNode ],
@@ -433,6 +474,7 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
433
474
434
475
var className : String = " <empty>" : String
435
476
var classShortName : String = " <empty>" : String
477
+ var columnNumber : Option [Int ] = None
436
478
var filename : String = " <empty>" : String
437
479
var lineNumber : Option [Int ] = None
438
480
var methodFullName : String = " <empty>" : String
@@ -443,6 +485,8 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
443
485
var symbol : String = " <empty>" : String
444
486
def className (value : String ): this .type = { this .className = value; this }
445
487
def classShortName (value : String ): this .type = { this .classShortName = value; this }
488
+ def columnNumber (value : Int ): this .type = { this .columnNumber = Option (value); this }
489
+ def columnNumber (value : Option [Int ]): this .type = { this .columnNumber = value; this }
446
490
def filename (value : String ): this .type = { this .filename = value; this }
447
491
def lineNumber (value : Int ): this .type = { this .lineNumber = Option (value); this }
448
492
def lineNumber (value : Option [Int ]): this .type = { this .lineNumber = value; this }
@@ -456,6 +500,7 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
456
500
override def countAndVisitProperties (interface : flatgraph.BatchedUpdateInterface ): Unit = {
457
501
interface.countProperty(this , 6 , 1 )
458
502
interface.countProperty(this , 7 , 1 )
503
+ interface.countProperty(this , 11 , columnNumber.size)
459
504
interface.countProperty(this , 21 , 1 )
460
505
interface.countProperty(this , 35 , lineNumber.size)
461
506
interface.countProperty(this , 37 , 1 )
@@ -471,6 +516,7 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
471
516
val newInstance = new NewLocation
472
517
newInstance.className = this .className
473
518
newInstance.classShortName = this .classShortName
519
+ newInstance.columnNumber = this .columnNumber
474
520
newInstance.filename = this .filename
475
521
newInstance.lineNumber = this .lineNumber
476
522
newInstance.methodFullName = this .methodFullName
@@ -484,35 +530,37 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
484
530
485
531
override def productElementName (n : Int ): String =
486
532
n match {
487
- case 0 => " className"
488
- case 1 => " classShortName"
489
- case 2 => " filename"
490
- case 3 => " lineNumber"
491
- case 4 => " methodFullName"
492
- case 5 => " methodShortName"
493
- case 6 => " nodeLabel"
494
- case 7 => " packageName"
495
- case 8 => " symbol"
496
- case 9 => " node"
497
- case _ => " "
533
+ case 0 => " className"
534
+ case 1 => " classShortName"
535
+ case 2 => " columnNumber"
536
+ case 3 => " filename"
537
+ case 4 => " lineNumber"
538
+ case 5 => " methodFullName"
539
+ case 6 => " methodShortName"
540
+ case 7 => " nodeLabel"
541
+ case 8 => " packageName"
542
+ case 9 => " symbol"
543
+ case 10 => " node"
544
+ case _ => " "
498
545
}
499
546
500
547
override def productElement (n : Int ): Any =
501
548
n match {
502
- case 0 => this .className
503
- case 1 => this .classShortName
504
- case 2 => this .filename
505
- case 3 => this .lineNumber
506
- case 4 => this .methodFullName
507
- case 5 => this .methodShortName
508
- case 6 => this .nodeLabel
509
- case 7 => this .packageName
510
- case 8 => this .symbol
511
- case 9 => this .node
512
- case _ => null
549
+ case 0 => this .className
550
+ case 1 => this .classShortName
551
+ case 2 => this .columnNumber
552
+ case 3 => this .filename
553
+ case 4 => this .lineNumber
554
+ case 5 => this .methodFullName
555
+ case 6 => this .methodShortName
556
+ case 7 => this .nodeLabel
557
+ case 8 => this .packageName
558
+ case 9 => this .symbol
559
+ case 10 => this .node
560
+ case _ => null
513
561
}
514
562
515
563
override def productPrefix = " NewLocation"
516
- override def productArity = 10
564
+ override def productArity = 11
517
565
override def canEqual (that : Any ): Boolean = that != null && that.isInstanceOf [NewLocation ]
518
566
}
0 commit comments