@@ -11,6 +11,7 @@ trait LocationEMT
1111 extends AnyRef
1212 with HasClassNameEMT
1313 with HasClassShortNameEMT
14+ with HasColumnNumberEMT
1415 with HasFilenameEMT
1516 with HasLineNumberEMT
1617 with HasMethodFullNameEMT
@@ -26,6 +27,7 @@ trait LocationBase extends AbstractNode with StaticType[LocationEMT] {
2627 val res = new java.util.HashMap [String , Any ]()
2728 if ((" <empty>" : String ) != this .className) res.put(" CLASS_NAME" , this .className)
2829 if ((" <empty>" : String ) != this .classShortName) res.put(" CLASS_SHORT_NAME" , this .classShortName)
30+ this .columnNumber.foreach { p => res.put(" COLUMN_NUMBER" , p) }
2931 if ((" <empty>" : String ) != this .filename) res.put(" FILENAME" , this .filename)
3032 this .lineNumber.foreach { p => res.put(" LINE_NUMBER" , p) }
3133 if ((" <empty>" : String ) != this .methodFullName) res.put(" METHOD_FULL_NAME" , this .methodFullName)
@@ -46,6 +48,10 @@ object Location {
4648
4749 val ClassShortName = " CLASS_SHORT_NAME"
4850
51+ /** This optional fields provides the column number of the program construct represented by the node.
52+ */
53+ val ColumnNumber = " COLUMN_NUMBER"
54+
4955 /** The path of the source file this node was generated from, relative to the root path in the meta data node. This
5056 * field must be set but may be set to the value `<unknown>` to indicate that no source file can be associated with
5157 * 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 {
7581 val ClassName = flatgraph.SinglePropertyKey [String ](kind = 6 , name = " CLASS_NAME" , default = " <empty>" )
7682 val ClassShortName = flatgraph.SinglePropertyKey [String ](kind = 7 , name = " CLASS_SHORT_NAME" , default = " <empty>" )
7783
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+
7888 /** The path of the source file this node was generated from, relative to the root path in the meta data node. This
7989 * field must be set but may be set to the value `<unknown>` to indicate that no source file can be associated with
8090 * 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)
116126
117127 override def productElementName (n : Int ): String =
118128 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 _ => " "
130141 }
131142
132143 override def productElement (n : Int ): Any =
133144 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
145157 }
146158
147159 override def productPrefix = " Location"
148- override def productArity = 10
160+ override def productArity = 11
149161
150162 override def canEqual (that : Any ): Boolean = that != null && that.isInstanceOf [Location ]
151163}
@@ -206,6 +218,35 @@ object NewLocation {
206218 }
207219 }
208220 }
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+ }
209250 object NewNodeInserter_Location_filename extends flatgraph.NewNodePropertyInsertionHelper {
210251 override def insertNewNodeProperties (
211252 newNodes : mutable.ArrayBuffer [flatgraph.DNode ],
@@ -433,6 +474,7 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
433474
434475 var className : String = " <empty>" : String
435476 var classShortName : String = " <empty>" : String
477+ var columnNumber : Option [Int ] = None
436478 var filename : String = " <empty>" : String
437479 var lineNumber : Option [Int ] = None
438480 var methodFullName : String = " <empty>" : String
@@ -443,6 +485,8 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
443485 var symbol : String = " <empty>" : String
444486 def className (value : String ): this .type = { this .className = value; this }
445487 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 }
446490 def filename (value : String ): this .type = { this .filename = value; this }
447491 def lineNumber (value : Int ): this .type = { this .lineNumber = Option (value); this }
448492 def lineNumber (value : Option [Int ]): this .type = { this .lineNumber = value; this }
@@ -456,6 +500,7 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
456500 override def countAndVisitProperties (interface : flatgraph.BatchedUpdateInterface ): Unit = {
457501 interface.countProperty(this , 6 , 1 )
458502 interface.countProperty(this , 7 , 1 )
503+ interface.countProperty(this , 11 , columnNumber.size)
459504 interface.countProperty(this , 21 , 1 )
460505 interface.countProperty(this , 35 , lineNumber.size)
461506 interface.countProperty(this , 37 , 1 )
@@ -471,6 +516,7 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
471516 val newInstance = new NewLocation
472517 newInstance.className = this .className
473518 newInstance.classShortName = this .classShortName
519+ newInstance.columnNumber = this .columnNumber
474520 newInstance.filename = this .filename
475521 newInstance.lineNumber = this .lineNumber
476522 newInstance.methodFullName = this .methodFullName
@@ -484,35 +530,37 @@ class NewLocation extends NewNode(23.toShort) with LocationBase {
484530
485531 override def productElementName (n : Int ): String =
486532 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 _ => " "
498545 }
499546
500547 override def productElement (n : Int ): Any =
501548 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
513561 }
514562
515563 override def productPrefix = " NewLocation"
516- override def productArity = 10
564+ override def productArity = 11
517565 override def canEqual (that : Any ): Boolean = that != null && that.isInstanceOf [NewLocation ]
518566}
0 commit comments