Skip to content

Commit

Permalink
Use the proper way of figuring out whether a type is a Function
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiemundo committed Apr 16, 2018
1 parent daf30e0 commit 3ef6910
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ object CompletionProvider extends LazyLogging {
): CompletionList = {
import compiler._

val functionTraitRegex = """^scala\.Function([0-9]|1[0-9]|2[0-2])$""".r
def isFunction(symbol: Symbol): Boolean = {
val typeSymbolFullName = symbol.info.finalResultType.typeSymbol.fullName
functionTraitRegex.findFirstIn(typeSymbolFullName).isDefined
compiler.definitions.isFunctionSymbol(
symbol.info.finalResultType.typeSymbol
)
}

def completionItemKind(r: CompletionResult#M): CompletionItemKind = {
Expand Down

0 comments on commit 3ef6910

Please sign in to comment.