Skip to content

Show the source file, line and column in CLI errors - #2208

Open
sebastian-griego wants to merge 1 commit into
bendlang:mainfrom
sebastian-griego:fix/cli-error-source-location
Open

sebastian-griego wants to merge 1 commit into
bendlang:mainfrom
sebastian-griego:fix/cli-error-source-location

Conversation

@sebastian-griego

Copy link
Copy Markdown
Contributor

When an imported module has an error, the CLI shows the definition and underlines the token. A developer reading the build log still has to find the file. For example, a typo in lib/price.bend previously gave only Location: total and the excerpt.

The CLI now appends the canonical source path and one-based line and column. The example produces this location.

--> /project/lib/price.bend:4:12

The CLI uses the files the loader already tracked. An error in an import statement points to the statement in the importing file. The batch --checkup format stays compatible with existing test fixtures.

Verification

  • The new regression covers an entry-file error, an imported definition, and a missing dependency. It failed on the base commit and passed with this change through the source CLI, the compiled CLI, and emitted JavaScript.
  • All 518 existing error snapshots with a source location matched through --checkup.
  • All 136 bend-lint tests passed. The repository gate passed all 56 checks.
  • TypeScript 7.0.2 reported the same 10 diagnostics on this branch and the base commit.

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