Skip to content

Commit 2697f7f

Browse files
authored
Merge pull request #2 from tanishiking/add-scala3-modifiers
Support new Scala3 modifiers
2 parents ed7e271 + ee7f566 commit 2697f7f

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

generator/src/main/protobuf/scalameta.proto

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ message SymbolInformation {
272272
PRIMARY = 0x2000;
273273
ENUM = 0x4000;
274274
DEFAULT = 0x8000;
275+
GIVEN = 0x10000;
276+
INLINE = 0x20000;
277+
OPEN = 0x40000;
278+
TRANSPARENT = 0x80000;
279+
INFIX = 0x100000;
280+
OPAQUE = 0x200000;
275281
}
276282
reserved 2, 6, 7, 8, 9, 10, 11, 12, 14, 15;
277283
string symbol = 1;
@@ -414,4 +420,4 @@ message SelectTree {
414420
message TypeApplyTree {
415421
Tree function = 1;
416422
repeated Type type_arguments = 2;
417-
}
423+
}

output/src/main/scala/generated/dotty/tools/dotc/semanticdb/SymbolInformation.scala

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,12 @@ object SymbolInformation extends SemanticdbGeneratedMessageCompanion[dotty.tool
437437
def isPrimary: _root_.scala.Boolean = false
438438
def isEnum: _root_.scala.Boolean = false
439439
def isDefault: _root_.scala.Boolean = false
440+
def isGiven: _root_.scala.Boolean = false
441+
def isInline: _root_.scala.Boolean = false
442+
def isOpen: _root_.scala.Boolean = false
443+
def isTransparent: _root_.scala.Boolean = false
444+
def isInfix: _root_.scala.Boolean = false
445+
def isOpaque: _root_.scala.Boolean = false
440446

441447
final def asRecognized: _root_.scala.Option[dotty.tools.dotc.semanticdb.SymbolInformation.Property.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[dotty.tools.dotc.semanticdb.SymbolInformation.Property.Recognized])
442448
}
@@ -549,10 +555,52 @@ object SymbolInformation extends SemanticdbGeneratedMessageCompanion[dotty.tool
549555
override def isDefault: _root_.scala.Boolean = true
550556
}
551557

558+
@SerialVersionUID(0L)
559+
case object GIVEN extends Property(65536) with Property.Recognized {
560+
val index = 15
561+
val name = "GIVEN"
562+
override def isGiven: _root_.scala.Boolean = true
563+
}
564+
565+
@SerialVersionUID(0L)
566+
case object INLINE extends Property(131072) with Property.Recognized {
567+
val index = 16
568+
val name = "INLINE"
569+
override def isInline: _root_.scala.Boolean = true
570+
}
571+
572+
@SerialVersionUID(0L)
573+
case object OPEN extends Property(262144) with Property.Recognized {
574+
val index = 17
575+
val name = "OPEN"
576+
override def isOpen: _root_.scala.Boolean = true
577+
}
578+
579+
@SerialVersionUID(0L)
580+
case object TRANSPARENT extends Property(524288) with Property.Recognized {
581+
val index = 18
582+
val name = "TRANSPARENT"
583+
override def isTransparent: _root_.scala.Boolean = true
584+
}
585+
586+
@SerialVersionUID(0L)
587+
case object INFIX extends Property(1048576) with Property.Recognized {
588+
val index = 19
589+
val name = "INFIX"
590+
override def isInfix: _root_.scala.Boolean = true
591+
}
592+
593+
@SerialVersionUID(0L)
594+
case object OPAQUE extends Property(2097152) with Property.Recognized {
595+
val index = 20
596+
val name = "OPAQUE"
597+
override def isOpaque: _root_.scala.Boolean = true
598+
}
599+
552600
@SerialVersionUID(0L)
553601
final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends Property(unrecognizedValue) with SemanticdbUnrecognizedEnum
554602

555-
lazy val values = scala.collection.immutable.Seq(UNKNOWN_PROPERTY, ABSTRACT, FINAL, SEALED, IMPLICIT, LAZY, CASE, COVARIANT, CONTRAVARIANT, VAL, VAR, STATIC, PRIMARY, ENUM, DEFAULT)
603+
lazy val values = scala.collection.immutable.Seq(UNKNOWN_PROPERTY, ABSTRACT, FINAL, SEALED, IMPLICIT, LAZY, CASE, COVARIANT, CONTRAVARIANT, VAL, VAR, STATIC, PRIMARY, ENUM, DEFAULT, GIVEN, INLINE, OPEN, TRANSPARENT, INFIX, OPAQUE)
556604
def fromValue(__value: _root_.scala.Int): Property = __value match {
557605
case 0 => UNKNOWN_PROPERTY
558606
case 4 => ABSTRACT
@@ -569,6 +617,12 @@ object SymbolInformation extends SemanticdbGeneratedMessageCompanion[dotty.tool
569617
case 8192 => PRIMARY
570618
case 16384 => ENUM
571619
case 32768 => DEFAULT
620+
case 65536 => GIVEN
621+
case 131072 => INLINE
622+
case 262144 => OPEN
623+
case 524288 => TRANSPARENT
624+
case 1048576 => INFIX
625+
case 2097152 => OPAQUE
572626
case __other => Unrecognized(__other)
573627
}
574628

0 commit comments

Comments
 (0)