Skip to content

Commit

Permalink
[ruby] Continue if Type Stubs are Missing (#4638)
Browse files Browse the repository at this point in the history
Allow the frontend to continue analysis if the type stubs for built-ins is missing.
  • Loading branch information
DavidBakerEffendi committed Jun 4, 2024
1 parent e6a3a77 commit 64ab7e2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ object RubyProgramSummary {
private val logger = LoggerFactory.getLogger(getClass)

def BuiltinTypes(implicit typeStubMetaData: TypeStubMetaData): NamespaceToTypeMap = {
if (typeStubMetaData.useTypeStubs) {
val typeStubDir = File(typeStubMetaData.packagePath)
if (!typeStubDir.exists || !typeStubDir.isDirectory) {
logger.warn("No builtin type stubs provided, continuing with types provided by the project")
mutable.Map.empty
} else if (typeStubMetaData.useTypeStubs) {
mpkZipToInitialMapping(mergeBuiltinMpkZip) match {
case Failure(exception) => logger.warn("Unable to parse builtin types", exception); mutable.Map.empty
case Success(mapping) => mapping
Expand Down

0 comments on commit 64ab7e2

Please sign in to comment.