Skip to content

Commit

Permalink
thread through PrintConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Apr 22, 2024
1 parent 4d944e3 commit 0d0524b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/ui/print.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function print_error_frame(io, report, config, depth)
printlnstyled(io, '', ''^20; color)
end

function print_report(io::IO, report::InferenceErrorReport, config=PrintConfig())
function print_report(io::IO, report::InferenceErrorReport, config::PrintConfig=PrintConfig())
color = report_color(report)
msg = with_bufferring() do io
print_report_message(io, report)
Expand Down
12 changes: 4 additions & 8 deletions src/ui/vscode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ function vscode_diagnostics(analyzer::Analyzer,
return (; msg = postprocess(sprint(print_report, report)),
path = tovscodepath(report.file),
line = report.line,
severity = 0, # 0: Error, 1: Warning, 2: Information, 3: Hint
)
severity = 0) # 0: Error, 1: Warning, 2: Information, 3: Hint
end)
end

Expand All @@ -103,18 +102,15 @@ function vscode_diagnostics(analyzer::Analyzer,
return (; source = String(source),
items = map(reports) do report
showpoint = (order ? first : last)(report.vst)
msg = sprint(print_report, report)
return (; msg = postprocess(msg),
return (; msg = postprocess(sprint(print_report, report, config)),
path = tovscodepath(showpoint.file),
line = showpoint.line,
severity = 1, # 0: Error, 1: Warning, 2: Information, 3: Hint
relatedInformation = map((order ? identity : reverse)(report.vst)) do frame
return (; msg = postprocess(sprint(print_frame_sig, frame, config)),
path = tovscodepath(frame.file),
line = frame.line,
)
end,
)
line = frame.line)
end)
end)
end

Expand Down

0 comments on commit 0d0524b

Please sign in to comment.