Skip to content

Commit

Permalink
Merge pull request scalameta#583 from ckipp01/doctorFix
Browse files Browse the repository at this point in the history
fix(doctor): don't error if there are no targets in a folder
  • Loading branch information
ckipp01 authored Jul 4, 2023
2 parents 6065608 + ce0a48d commit cd50bfe
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions lua/metals/doctor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,23 @@ Doctor.create = function(args)
table.insert(output, string.format(" - %s", folder.header.buildServer))
table.insert(output, "")

table.insert(output, "## Build Targets")

for _, target in ipairs(folder.targets) do
table.insert(output, "")
table.insert(output, string.format("### %s", target.buildTarget))
table.insert(output, string.format(" - target type: %s", target.targetType))
table.insert(output, string.format(" - goto functionality: %s", target.gotoCommand))
table.insert(output, string.format(" - compilation: %s", target.compilationStatus))
table.insert(output, string.format(" - diagnostics: %s", target.diagnostics))
table.insert(output, string.format(" - interactive: %s", target.interactive))
table.insert(output, string.format(" - semanticdb: %s", target.semanticdb))
table.insert(output, string.format(" - debugging: %s", target.debugging))
table.insert(output, string.format(" - java: %s", target.java))
if target.recommendation ~= "" then
table.insert(output, string.format(" - recommendation: %s", target.recommendation))
if folder.targets then
table.insert(output, "## Build Targets")

for _, target in ipairs(folder.targets) do
table.insert(output, "")
table.insert(output, string.format("### %s", target.buildTarget))
table.insert(output, string.format(" - target type: %s", target.targetType))
table.insert(output, string.format(" - goto functionality: %s", target.gotoCommand))
table.insert(output, string.format(" - compilation: %s", target.compilationStatus))
table.insert(output, string.format(" - diagnostics: %s", target.diagnostics))
table.insert(output, string.format(" - interactive: %s", target.interactive))
table.insert(output, string.format(" - semanticdb: %s", target.semanticdb))
table.insert(output, string.format(" - debugging: %s", target.debugging))
table.insert(output, string.format(" - java: %s", target.java))
if target.recommendation ~= "" then
table.insert(output, string.format(" - recommendation: %s", target.recommendation))
end
end
end

Expand Down

0 comments on commit cd50bfe

Please sign in to comment.