Skip to content

fix(diagnostics): report errors in the included header - #97

Closed
mremond wants to merge 1 commit into
mainfrom
infinitary-batch/62368c41
Closed

mremond wants to merge 1 commit into
mainfrom
infinitary-batch/62368c41

Conversation

@mremond

@mremond mremond commented Nov 28, 2026

Copy link
Copy Markdown
Member

Why

A typo in an Erlang header could point you to an unrelated line in the file that used it.

What changed

  • Nera’s build and check commands show the right file, line, and column even when one header includes another.
  • In the editor, header errors stay current as you type, save, and close files.

Before and after

Before: Nera could underline a line in the file that included the header, rather than the mistake itself.

After: Build, check, and the editor report now point to the header at line 3, column 14.

Build and check output when one header includes another

BeforeAfter

Both build and check show an illegal float at nested.erl line 3, column 11, with carets under the include path.

Both build and check show an illegal float in bad_float.hrl at line 3, column 14, with carets under 1.0e309.

Error report before saving an edit that adds a header

BeforeAfter

The language server report names service.erl and shows a range from line 2, column 20, to line 3, column 3.

The language server report names limits.hrl and shows the illegal float on line 3, from column 14 to column 21.

Checked

Live validation: Demonstrated for this version. 3 of 3 scenarios driven live in the product.

Scenario Result Evidence
Find errors in direct and nested headers ✅ Passed live Build and check matched Erlang’s compiler at line 3, column 14. They also matched on an unfinished header and an error outside any header.
Keep editor errors current while typing, saving, and closing ✅ Passed live Removing the include or fixing the header cleared the error. Closing the corrected header did not bring it back. Another file’s syntax error appeared without waiting.
Keep header search order and macro values ✅ Passed live Saving the first header in the search order cleared the error on the fallback. The Erlang version check and three built-in macro values gave the expected results.
  • Errors pointed at the wrong text: Nera keeps the header’s location even when a check fails, so it underlines the actual error.
  • Macro errors could underline the wrong text: Nera points to the macro’s use or argument without changing the value it produces.
  • One edit could hide another file’s error: Nera keeps track of which file and edit produced each report, so live feedback stays accurate.
  • A save could leave the old error visible: Nera rechecks affected files after a save and keeps unrelated reports, so the editor reflects the latest text.
  • Project setup could delay feedback: Nera retries failed lookups and checks plain files without waiting. Files that need the same lookup still share it.
  • Some tests did not exercise the real checks: The tests now use real checks and headers. They fail when the fix is deliberately broken.
How it was checked

Independent code and live-proof reviews passed.

The release build, lint, 2,297 workspace tests, and allocator and stacktrace checks passed.

The native suite passed 551 cases with two expected skips for external modules. The final focused tests passed 380 executions.

Risk

Risk above low: Blast radius, medium — Both the compiler and the editor use the changed error reporting.; Novelty, medium — Nera now tracks which files and edits produced cross-file errors.

Full risk assessment
Dimension Level Why
Blast radius medium Both the compiler and the editor use the changed error reporting.
Behavior low The change corrects error locations and keeps existing live feedback current.
Undo low Reverting the code needs no data or settings migration.
Evidence low Before and after runs show the corrected file, line, and column.
Sensitivity low The change does not touch sign-ins, keys or user data.
Novelty medium Nera now tracks which files and edits produced cross-file errors.
Dependencies low The change adds no dependency.

Nera’s build and check commands show the right file, line, and column even when one header includes another.

In the editor, header errors stay current as you type, save, and close files.
@github-actions github-actions Bot added this to the 0.1.1 milestone Nov 28, 2026
@mremond mremond closed this Nov 29, 2026
@mremond
mremond deleted the infinitary-batch/62368c41 branch November 29, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant