Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,20 @@ class LsifBuildTool(index: IndexCommand) extends BuildTool("LSIF", index) {
.isDirectory(targetroot.resolve("META-INF"))
if (errors.nonEmpty && !isSemanticdbGenerated) {
CommandResult(1, Nil)
} else if (errors.nonEmpty && isSemanticdbGenerated) {
index
.app
.reporter
.info(
"Some SemanticDB files got generated even if there were compile errors. " +
"In most cases, this means that lsif-java managed to index everything " +
"except the locations that had compile errors and you can ignore the compile errors." +
errors.mkString("\n")
)
} else {
if (errors.nonEmpty && isSemanticdbGenerated) {
index
.app
.reporter
.info(
"Some SemanticDB files got generated even if there were compile errors. " +
"In most cases, this means that lsif-java managed to index everything " +
"except the locations that had compile errors and you can ignore the compile errors." +
errors.mkString("\n")
)
}
CommandResult(0, Nil)
}
CommandResult(0, Nil)
}

Comment on lines +174 to 178
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im confused about this, does not returning an explicit CommandResult result in the exit code being set to non-zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CommandResult on line 162 was previously discarded because the if/else wasn't the last statement

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh so thats a thing in scala 🤔 TIL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are compiler flags to turn that into an error but I don't like using it because there are too many false positives (lots of side-effecting methods return non-Unit values)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably messed up because I've been writing too much Java/Go lately with early returns. I don't remember being hit by this in the past, it's usually a non-issue in my experience.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It mightve been introduced by me here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, hehe looks like that indeed 😜

private def compileScalaFiles(
Expand Down