Skip to content

Update to new API for flags #5695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions semanticdb/src/dotty/semanticdb/SemanticdbConsumer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SemanticdbConsumer extends TastyConsumer {

implicit class SymbolExtender(symbol: Symbol) {
def isTypeParameter: Boolean = symbol match {
case IsTypeSymbol(_) => symbol.flags.isParam
case IsTypeSymbol(_) => symbol.flags.is(Flags.Param)
case _ => false
}

Expand All @@ -83,21 +83,21 @@ class SemanticdbConsumer extends TastyConsumer {
case _ => false
}

def isObject: Boolean = symbol.flags.isObject
def isObject: Boolean = symbol.flags.is(Flags.Object)

def isTrait: Boolean = symbol.flags.isTrait
def isTrait: Boolean = symbol.flags.is(Flags.Trait)

def isValueParameter: Boolean = symbol.flags.isParam
def isValueParameter: Boolean = symbol.flags.is(Flags.Param)

// TODO : implement it
def isJavaClass: Boolean = false
}

def resolveClass(symbol: ClassSymbol): Symbol =
(symbol.companionClass, symbol.companionModule) match {
case (_, Some(module)) if symbol.flags.isObject => module
case (Some(c), _) => c
case _ => symbol
case (_, Some(module)) if symbol.flags.is(Flags.Object) => module
case (Some(c), _) => c
case _ => symbol
}

def disimbiguate(symbol_path: String, symbol: Symbol): String = {
Expand Down