|
| 1 | +// Generated by https://github.com/tanishiking/semanticdb-for-scala3 |
| 2 | +// Generated by the Scala Plugin for the Protocol Buffer Compiler. |
| 3 | +// Do not edit! |
| 4 | +// |
| 5 | +// Protofile syntax: PROTO3 |
| 6 | + |
| 7 | +package dotty.tools.dotc.semanticdb |
| 8 | +import dotty.tools.dotc.semanticdb.internal._ |
| 9 | +import scala.annotation.internal.sharable |
| 10 | + |
| 11 | +@SerialVersionUID(0L) |
| 12 | +final case class Diagnostic( |
| 13 | + range: _root_.scala.Option[dotty.tools.dotc.semanticdb.Range] = _root_.scala.None, |
| 14 | + severity: dotty.tools.dotc.semanticdb.Diagnostic.Severity = dotty.tools.dotc.semanticdb.Diagnostic.Severity.UNKNOWN_SEVERITY, |
| 15 | + message: _root_.scala.Predef.String = "" |
| 16 | + ) extends SemanticdbGeneratedMessage derives CanEqual { |
| 17 | + @transient @sharable |
| 18 | + private[this] var __serializedSizeCachedValue: _root_.scala.Int = 0 |
| 19 | + private[this] def __computeSerializedValue(): _root_.scala.Int = { |
| 20 | + var __size = 0 |
| 21 | + if (range.isDefined) { |
| 22 | + val __value = range.get |
| 23 | + __size += 1 + SemanticdbOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize |
| 24 | + }; |
| 25 | + |
| 26 | + { |
| 27 | + val __value = severity.value |
| 28 | + if (__value != 0) { |
| 29 | + __size += SemanticdbOutputStream.computeEnumSize(2, __value) |
| 30 | + } |
| 31 | + }; |
| 32 | + |
| 33 | + { |
| 34 | + val __value = message |
| 35 | + if (!__value.isEmpty) { |
| 36 | + __size += SemanticdbOutputStream.computeStringSize(3, __value) |
| 37 | + } |
| 38 | + }; |
| 39 | + __size |
| 40 | + } |
| 41 | + override def serializedSize: _root_.scala.Int = { |
| 42 | + var read = __serializedSizeCachedValue |
| 43 | + if (read == 0) { |
| 44 | + read = __computeSerializedValue() |
| 45 | + __serializedSizeCachedValue = read |
| 46 | + } |
| 47 | + read |
| 48 | + } |
| 49 | + def writeTo(`_output__`: SemanticdbOutputStream): _root_.scala.Unit = { |
| 50 | + range.foreach { __v => |
| 51 | + val __m = __v |
| 52 | + _output__.writeTag(1, 2) |
| 53 | + _output__.writeUInt32NoTag(__m.serializedSize) |
| 54 | + __m.writeTo(_output__) |
| 55 | + }; |
| 56 | + { |
| 57 | + val __v = severity.value |
| 58 | + if (__v != 0) { |
| 59 | + _output__.writeEnum(2, __v) |
| 60 | + } |
| 61 | + }; |
| 62 | + { |
| 63 | + val __v = message |
| 64 | + if (!__v.isEmpty) { |
| 65 | + _output__.writeString(3, __v) |
| 66 | + } |
| 67 | + }; |
| 68 | + } |
| 69 | + def getRange: dotty.tools.dotc.semanticdb.Range = range.getOrElse(dotty.tools.dotc.semanticdb.Range.defaultInstance) |
| 70 | + def clearRange: Diagnostic = copy(range = _root_.scala.None) |
| 71 | + def withRange(__v: dotty.tools.dotc.semanticdb.Range): Diagnostic = copy(range = Option(__v)) |
| 72 | + def withSeverity(__v: dotty.tools.dotc.semanticdb.Diagnostic.Severity): Diagnostic = copy(severity = __v) |
| 73 | + def withMessage(__v: _root_.scala.Predef.String): Diagnostic = copy(message = __v) |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + // @@protoc_insertion_point(GeneratedMessage[dotty.tools.dotc.semanticdb.Diagnostic]) |
| 79 | +} |
| 80 | + |
| 81 | +object Diagnostic extends SemanticdbGeneratedMessageCompanion[dotty.tools.dotc.semanticdb.Diagnostic] { |
| 82 | + implicit def messageCompanion: SemanticdbGeneratedMessageCompanion[dotty.tools.dotc.semanticdb.Diagnostic] = this |
| 83 | + def parseFrom(`_input__`: SemanticdbInputStream): dotty.tools.dotc.semanticdb.Diagnostic = { |
| 84 | + var __range: _root_.scala.Option[dotty.tools.dotc.semanticdb.Range] = _root_.scala.None |
| 85 | + var __severity: dotty.tools.dotc.semanticdb.Diagnostic.Severity = dotty.tools.dotc.semanticdb.Diagnostic.Severity.UNKNOWN_SEVERITY |
| 86 | + var __message: _root_.scala.Predef.String = "" |
| 87 | + var _done__ = false |
| 88 | + while (!_done__) { |
| 89 | + val _tag__ = _input__.readTag() |
| 90 | + _tag__ match { |
| 91 | + case 0 => _done__ = true |
| 92 | + case 10 => |
| 93 | + __range = Option(__range.fold(LiteParser.readMessage[dotty.tools.dotc.semanticdb.Range](_input__))(LiteParser.readMessage(_input__, _))) |
| 94 | + case 16 => |
| 95 | + __severity = dotty.tools.dotc.semanticdb.Diagnostic.Severity.fromValue(_input__.readEnum()) |
| 96 | + case 26 => |
| 97 | + __message = _input__.readStringRequireUtf8() |
| 98 | + case tag => _input__.skipField(tag) |
| 99 | + } |
| 100 | + } |
| 101 | + dotty.tools.dotc.semanticdb.Diagnostic( |
| 102 | + range = __range, |
| 103 | + severity = __severity, |
| 104 | + message = __message |
| 105 | + ) |
| 106 | + } |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + lazy val defaultInstance = dotty.tools.dotc.semanticdb.Diagnostic( |
| 114 | + range = _root_.scala.None, |
| 115 | + severity = dotty.tools.dotc.semanticdb.Diagnostic.Severity.UNKNOWN_SEVERITY, |
| 116 | + message = "" |
| 117 | + ) |
| 118 | + sealed abstract class Severity(val value: _root_.scala.Int) extends SemanticdbGeneratedEnum derives CanEqual { |
| 119 | + type EnumType = Severity |
| 120 | + def isUnknownSeverity: _root_.scala.Boolean = false |
| 121 | + def isError: _root_.scala.Boolean = false |
| 122 | + def isWarning: _root_.scala.Boolean = false |
| 123 | + def isInformation: _root_.scala.Boolean = false |
| 124 | + def isHint: _root_.scala.Boolean = false |
| 125 | + |
| 126 | + final def asRecognized: _root_.scala.Option[dotty.tools.dotc.semanticdb.Diagnostic.Severity.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[dotty.tools.dotc.semanticdb.Diagnostic.Severity.Recognized]) |
| 127 | + } |
| 128 | + |
| 129 | + object Severity { |
| 130 | + sealed trait Recognized extends Severity |
| 131 | + |
| 132 | + @SerialVersionUID(0L) |
| 133 | + case object UNKNOWN_SEVERITY extends Severity(0) with Severity.Recognized { |
| 134 | + val index = 0 |
| 135 | + val name = "UNKNOWN_SEVERITY" |
| 136 | + override def isUnknownSeverity: _root_.scala.Boolean = true |
| 137 | + } |
| 138 | + |
| 139 | + @SerialVersionUID(0L) |
| 140 | + case object ERROR extends Severity(1) with Severity.Recognized { |
| 141 | + val index = 1 |
| 142 | + val name = "ERROR" |
| 143 | + override def isError: _root_.scala.Boolean = true |
| 144 | + } |
| 145 | + |
| 146 | + @SerialVersionUID(0L) |
| 147 | + case object WARNING extends Severity(2) with Severity.Recognized { |
| 148 | + val index = 2 |
| 149 | + val name = "WARNING" |
| 150 | + override def isWarning: _root_.scala.Boolean = true |
| 151 | + } |
| 152 | + |
| 153 | + @SerialVersionUID(0L) |
| 154 | + case object INFORMATION extends Severity(3) with Severity.Recognized { |
| 155 | + val index = 3 |
| 156 | + val name = "INFORMATION" |
| 157 | + override def isInformation: _root_.scala.Boolean = true |
| 158 | + } |
| 159 | + |
| 160 | + @SerialVersionUID(0L) |
| 161 | + case object HINT extends Severity(4) with Severity.Recognized { |
| 162 | + val index = 4 |
| 163 | + val name = "HINT" |
| 164 | + override def isHint: _root_.scala.Boolean = true |
| 165 | + } |
| 166 | + |
| 167 | + @SerialVersionUID(0L) |
| 168 | + final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends Severity(unrecognizedValue) with SemanticdbUnrecognizedEnum |
| 169 | + |
| 170 | + lazy val values = scala.collection.immutable.Seq(UNKNOWN_SEVERITY, ERROR, WARNING, INFORMATION, HINT) |
| 171 | + def fromValue(__value: _root_.scala.Int): Severity = __value match { |
| 172 | + case 0 => UNKNOWN_SEVERITY |
| 173 | + case 1 => ERROR |
| 174 | + case 2 => WARNING |
| 175 | + case 3 => INFORMATION |
| 176 | + case 4 => HINT |
| 177 | + case __other => Unrecognized(__other) |
| 178 | + } |
| 179 | + |
| 180 | + |
| 181 | + } |
| 182 | + final val RANGE_FIELD_NUMBER = 1 |
| 183 | + final val SEVERITY_FIELD_NUMBER = 2 |
| 184 | + final val MESSAGE_FIELD_NUMBER = 3 |
| 185 | + def of( |
| 186 | + range: _root_.scala.Option[dotty.tools.dotc.semanticdb.Range], |
| 187 | + severity: dotty.tools.dotc.semanticdb.Diagnostic.Severity, |
| 188 | + message: _root_.scala.Predef.String |
| 189 | + ): _root_.dotty.tools.dotc.semanticdb.Diagnostic = _root_.dotty.tools.dotc.semanticdb.Diagnostic( |
| 190 | + range, |
| 191 | + severity, |
| 192 | + message |
| 193 | + ) |
| 194 | + // @@protoc_insertion_point(GeneratedMessageCompanion[dotty.tools.dotc.semanticdb.Diagnostic]) |
| 195 | +} |
0 commit comments