Skip to content

Commit 1c4e05d

Browse files
committed
Add ApplyContextTree from generated code
From branch https://github.com/natsukagami/semanticdb-for-scala3/tree/apply-context-tree
1 parent 83e9c14 commit 1c4e05d

File tree

1 file changed

+133
-0
lines changed
  • compiler/src/dotty/tools/dotc/semanticdb/generated

1 file changed

+133
-0
lines changed

compiler/src/dotty/tools/dotc/semanticdb/generated/Tree.scala

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ object Tree {
3232
case __v: dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.OriginalTree => __v.value
3333
case __v: dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.SelectTree => __v.value
3434
case __v: dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.TypeApplyTree => __v.value
35+
case __v: dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.ApplyContextTree => __v.value
3536
case dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.Empty => Empty
3637
}
3738
override def toBase(__custom: dotty.tools.dotc.semanticdb.Tree): dotty.tools.dotc.semanticdb.TreeMessage = dotty.tools.dotc.semanticdb.TreeMessage(__custom match {
@@ -43,6 +44,7 @@ object Tree {
4344
case __v: dotty.tools.dotc.semanticdb.OriginalTree => dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.OriginalTree(__v)
4445
case __v: dotty.tools.dotc.semanticdb.SelectTree => dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.SelectTree(__v)
4546
case __v: dotty.tools.dotc.semanticdb.TypeApplyTree => dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.TypeApplyTree(__v)
47+
case __v: dotty.tools.dotc.semanticdb.ApplyContextTree => dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.ApplyContextTree(__v)
4648
case Empty => dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.Empty
4749
})
4850
}
@@ -87,6 +89,10 @@ final case class TreeMessage(
8789
val __value = sealedValue.typeApplyTree.get
8890
__size += 1 + SemanticdbOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
8991
};
92+
if (sealedValue.applyContextTree.isDefined) {
93+
val __value = sealedValue.applyContextTree.get
94+
__size += 1 + SemanticdbOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
95+
};
9096
__size
9197
}
9298
override def serializedSize: _root_.scala.Int = {
@@ -147,6 +153,12 @@ final case class TreeMessage(
147153
_output__.writeUInt32NoTag(__m.serializedSize)
148154
__m.writeTo(_output__)
149155
};
156+
sealedValue.applyContextTree.foreach { __v =>
157+
val __m = __v
158+
_output__.writeTag(9, 2)
159+
_output__.writeUInt32NoTag(__m.serializedSize)
160+
__m.writeTo(_output__)
161+
};
150162
}
151163
def getApplyTree: dotty.tools.dotc.semanticdb.ApplyTree = sealedValue.applyTree.getOrElse(dotty.tools.dotc.semanticdb.ApplyTree.defaultInstance)
152164
def withApplyTree(__v: dotty.tools.dotc.semanticdb.ApplyTree): TreeMessage = copy(sealedValue = dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.ApplyTree(__v))
@@ -164,6 +176,8 @@ final case class TreeMessage(
164176
def withSelectTree(__v: dotty.tools.dotc.semanticdb.SelectTree): TreeMessage = copy(sealedValue = dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.SelectTree(__v))
165177
def getTypeApplyTree: dotty.tools.dotc.semanticdb.TypeApplyTree = sealedValue.typeApplyTree.getOrElse(dotty.tools.dotc.semanticdb.TypeApplyTree.defaultInstance)
166178
def withTypeApplyTree(__v: dotty.tools.dotc.semanticdb.TypeApplyTree): TreeMessage = copy(sealedValue = dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.TypeApplyTree(__v))
179+
def getApplyContextTree: dotty.tools.dotc.semanticdb.ApplyContextTree = sealedValue.applyContextTree.getOrElse(dotty.tools.dotc.semanticdb.ApplyContextTree.defaultInstance)
180+
def withApplyContextTree(__v: dotty.tools.dotc.semanticdb.ApplyContextTree): TreeMessage = copy(sealedValue = dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.ApplyContextTree(__v))
167181
def clearSealedValue: TreeMessage = copy(sealedValue = dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.Empty)
168182
def withSealedValue(__v: dotty.tools.dotc.semanticdb.TreeMessage.SealedValue): TreeMessage = copy(sealedValue = __v)
169183

@@ -199,6 +213,8 @@ object TreeMessage extends SemanticdbGeneratedMessageCompanion[dotty.tools.dotc
199213
__sealedValue = dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.SelectTree(__sealedValue.selectTree.fold(LiteParser.readMessage[dotty.tools.dotc.semanticdb.SelectTree](_input__))(LiteParser.readMessage(_input__, _)))
200214
case 66 =>
201215
__sealedValue = dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.TypeApplyTree(__sealedValue.typeApplyTree.fold(LiteParser.readMessage[dotty.tools.dotc.semanticdb.TypeApplyTree](_input__))(LiteParser.readMessage(_input__, _)))
216+
case 74 =>
217+
__sealedValue = dotty.tools.dotc.semanticdb.TreeMessage.SealedValue.ApplyContextTree(__sealedValue.applyContextTree.fold(LiteParser.readMessage[dotty.tools.dotc.semanticdb.ApplyContextTree](_input__))(LiteParser.readMessage(_input__, _)))
202218
case tag => _input__.skipField(tag)
203219
}
204220
}
@@ -226,6 +242,7 @@ object TreeMessage extends SemanticdbGeneratedMessageCompanion[dotty.tools.dotc
226242
def isOriginalTree: _root_.scala.Boolean = false
227243
def isSelectTree: _root_.scala.Boolean = false
228244
def isTypeApplyTree: _root_.scala.Boolean = false
245+
def isApplyContextTree: _root_.scala.Boolean = false
229246
def applyTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.ApplyTree] = _root_.scala.None
230247
def functionTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.FunctionTree] = _root_.scala.None
231248
def idTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.IdTree] = _root_.scala.None
@@ -234,6 +251,7 @@ object TreeMessage extends SemanticdbGeneratedMessageCompanion[dotty.tools.dotc
234251
def originalTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.OriginalTree] = _root_.scala.None
235252
def selectTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.SelectTree] = _root_.scala.None
236253
def typeApplyTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.TypeApplyTree] = _root_.scala.None
254+
def applyContextTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.ApplyContextTree] = _root_.scala.None
237255
}
238256
object SealedValue {
239257
@SerialVersionUID(0L)
@@ -301,6 +319,13 @@ object TreeMessage extends SemanticdbGeneratedMessageCompanion[dotty.tools.dotc
301319
override def typeApplyTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.TypeApplyTree] = Some(value)
302320
override def number: _root_.scala.Int = 8
303321
}
322+
@SerialVersionUID(0L)
323+
final case class ApplyContextTree(value: dotty.tools.dotc.semanticdb.ApplyContextTree) extends dotty.tools.dotc.semanticdb.TreeMessage.SealedValue derives CanEqual {
324+
type ValueType = dotty.tools.dotc.semanticdb.ApplyContextTree
325+
override def isApplyContextTree: _root_.scala.Boolean = true
326+
override def applyContextTree: _root_.scala.Option[dotty.tools.dotc.semanticdb.ApplyContextTree] = Some(value)
327+
override def number: _root_.scala.Int = 9
328+
}
304329
}
305330
final val APPLY_TREE_FIELD_NUMBER = 1
306331
final val FUNCTION_TREE_FIELD_NUMBER = 2
@@ -310,6 +335,7 @@ object TreeMessage extends SemanticdbGeneratedMessageCompanion[dotty.tools.dotc
310335
final val ORIGINAL_TREE_FIELD_NUMBER = 6
311336
final val SELECT_TREE_FIELD_NUMBER = 7
312337
final val TYPE_APPLY_TREE_FIELD_NUMBER = 8
338+
final val APPLY_CONTEXT_TREE_FIELD_NUMBER = 9
313339
def of(
314340
sealedValue: dotty.tools.dotc.semanticdb.TreeMessage.SealedValue
315341
): _root_.dotty.tools.dotc.semanticdb.TreeMessage = _root_.dotty.tools.dotc.semanticdb.TreeMessage(
@@ -1086,3 +1112,110 @@ object TypeApplyTree extends SemanticdbGeneratedMessageCompanion[dotty.tools.do
10861112
)
10871113
// @@protoc_insertion_point(GeneratedMessageCompanion[dotty.tools.dotc.semanticdb.TypeApplyTree])
10881114
}
1115+
1116+
@SerialVersionUID(0L)
1117+
final case class ApplyContextTree(
1118+
function: dotty.tools.dotc.semanticdb.Tree = dotty.tools.dotc.semanticdb.ApplyContextTree._typemapper_function.toCustom(dotty.tools.dotc.semanticdb.TreeMessage.defaultInstance),
1119+
arguments: _root_.scala.Seq[dotty.tools.dotc.semanticdb.Tree] = _root_.scala.Seq.empty
1120+
) extends dotty.tools.dotc.semanticdb.Tree.NonEmpty with SemanticdbGeneratedMessage derives CanEqual {
1121+
@transient @sharable
1122+
private var __serializedSizeMemoized: _root_.scala.Int = 0
1123+
private def __computeSerializedSize(): _root_.scala.Int = {
1124+
var __size = 0
1125+
1126+
{
1127+
val __value = dotty.tools.dotc.semanticdb.ApplyContextTree._typemapper_function.toBase(function)
1128+
if (__value.serializedSize != 0) {
1129+
__size += 1 + SemanticdbOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
1130+
}
1131+
};
1132+
arguments.foreach { __item =>
1133+
val __value = dotty.tools.dotc.semanticdb.ApplyContextTree._typemapper_arguments.toBase(__item)
1134+
__size += 1 + SemanticdbOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
1135+
}
1136+
__size
1137+
}
1138+
override def serializedSize: _root_.scala.Int = {
1139+
var __size = __serializedSizeMemoized
1140+
if (__size == 0) {
1141+
__size = __computeSerializedSize() + 1
1142+
__serializedSizeMemoized = __size
1143+
}
1144+
__size - 1
1145+
1146+
}
1147+
def writeTo(`_output__`: SemanticdbOutputStream): _root_.scala.Unit = {
1148+
{
1149+
val __v = dotty.tools.dotc.semanticdb.ApplyContextTree._typemapper_function.toBase(function)
1150+
if (__v.serializedSize != 0) {
1151+
_output__.writeTag(1, 2)
1152+
_output__.writeUInt32NoTag(__v.serializedSize)
1153+
__v.writeTo(_output__)
1154+
}
1155+
};
1156+
arguments.foreach { __v =>
1157+
val __m = dotty.tools.dotc.semanticdb.ApplyContextTree._typemapper_arguments.toBase(__v)
1158+
_output__.writeTag(2, 2)
1159+
_output__.writeUInt32NoTag(__m.serializedSize)
1160+
__m.writeTo(_output__)
1161+
};
1162+
}
1163+
def withFunction(__v: dotty.tools.dotc.semanticdb.Tree): ApplyContextTree = copy(function = __v)
1164+
def clearArguments = copy(arguments = _root_.scala.Seq.empty)
1165+
def addArguments(__vs: dotty.tools.dotc.semanticdb.Tree *): ApplyContextTree = addAllArguments(__vs)
1166+
def addAllArguments(__vs: Iterable[dotty.tools.dotc.semanticdb.Tree]): ApplyContextTree = copy(arguments = arguments ++ __vs)
1167+
def withArguments(__v: _root_.scala.Seq[dotty.tools.dotc.semanticdb.Tree]): ApplyContextTree = copy(arguments = __v)
1168+
1169+
1170+
1171+
1172+
// @@protoc_insertion_point(GeneratedMessage[dotty.tools.dotc.semanticdb.ApplyContextTree])
1173+
}
1174+
1175+
object ApplyContextTree extends SemanticdbGeneratedMessageCompanion[dotty.tools.dotc.semanticdb.ApplyContextTree] {
1176+
implicit def messageCompanion: SemanticdbGeneratedMessageCompanion[dotty.tools.dotc.semanticdb.ApplyContextTree] = this
1177+
def parseFrom(`_input__`: SemanticdbInputStream): dotty.tools.dotc.semanticdb.ApplyContextTree = {
1178+
var __function: _root_.scala.Option[dotty.tools.dotc.semanticdb.TreeMessage] = _root_.scala.None
1179+
val __arguments: _root_.scala.collection.immutable.VectorBuilder[dotty.tools.dotc.semanticdb.Tree] = new _root_.scala.collection.immutable.VectorBuilder[dotty.tools.dotc.semanticdb.Tree]
1180+
var _done__ = false
1181+
while (!_done__) {
1182+
val _tag__ = _input__.readTag()
1183+
_tag__ match {
1184+
case 0 => _done__ = true
1185+
case 10 =>
1186+
__function = _root_.scala.Some(__function.fold(LiteParser.readMessage[dotty.tools.dotc.semanticdb.TreeMessage](_input__))(LiteParser.readMessage(_input__, _)))
1187+
case 18 =>
1188+
__arguments += dotty.tools.dotc.semanticdb.ApplyContextTree._typemapper_arguments.toCustom(LiteParser.readMessage[dotty.tools.dotc.semanticdb.TreeMessage](_input__))
1189+
case tag => _input__.skipField(tag)
1190+
}
1191+
}
1192+
dotty.tools.dotc.semanticdb.ApplyContextTree(
1193+
function = dotty.tools.dotc.semanticdb.ApplyContextTree._typemapper_function.toCustom(__function.getOrElse(dotty.tools.dotc.semanticdb.TreeMessage.defaultInstance)),
1194+
arguments = __arguments.result()
1195+
)
1196+
}
1197+
1198+
1199+
1200+
1201+
1202+
1203+
lazy val defaultInstance = dotty.tools.dotc.semanticdb.ApplyContextTree(
1204+
function = dotty.tools.dotc.semanticdb.ApplyContextTree._typemapper_function.toCustom(dotty.tools.dotc.semanticdb.TreeMessage.defaultInstance),
1205+
arguments = _root_.scala.Seq.empty
1206+
)
1207+
final val FUNCTION_FIELD_NUMBER = 1
1208+
final val ARGUMENTS_FIELD_NUMBER = 2
1209+
@transient @sharable
1210+
private[semanticdb] val _typemapper_function: SemanticdbTypeMapper[dotty.tools.dotc.semanticdb.TreeMessage, dotty.tools.dotc.semanticdb.Tree] = implicitly[SemanticdbTypeMapper[dotty.tools.dotc.semanticdb.TreeMessage, dotty.tools.dotc.semanticdb.Tree]]
1211+
@transient @sharable
1212+
private[semanticdb] val _typemapper_arguments: SemanticdbTypeMapper[dotty.tools.dotc.semanticdb.TreeMessage, dotty.tools.dotc.semanticdb.Tree] = implicitly[SemanticdbTypeMapper[dotty.tools.dotc.semanticdb.TreeMessage, dotty.tools.dotc.semanticdb.Tree]]
1213+
def of(
1214+
function: dotty.tools.dotc.semanticdb.Tree,
1215+
arguments: _root_.scala.Seq[dotty.tools.dotc.semanticdb.Tree]
1216+
): _root_.dotty.tools.dotc.semanticdb.ApplyContextTree = _root_.dotty.tools.dotc.semanticdb.ApplyContextTree(
1217+
function,
1218+
arguments
1219+
)
1220+
// @@protoc_insertion_point(GeneratedMessageCompanion[dotty.tools.dotc.semanticdb.ApplyContextTree])
1221+
}

0 commit comments

Comments
 (0)