Skip to content

Add clickable error locations to UCM-emitted warnings/errors - #6326

Open
Baccata wants to merge 3 commits into
unisonweb:trunkfrom
Baccata:clickable-error-locations
Open

Baccata wants to merge 3 commits into
unisonweb:trunkfrom
Baccata:clickable-error-locations

Conversation

@Baccata

@Baccata Baccata commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Overview

When UCM is watching files, and upon compile errors/warnings, this adds a $file:$line:$column message, which is understood by many IDEs as being clickable.

Interesting/controversial decisions

Only added to UCM when it is watch mode (verified by the presence of watch-directory).

Test coverage

No test added, mostly because enabling this feature only in watch mode prevents the automation of tests. Tested by hand :

Screenshot 2026-10-29 at 15 27 40

Baccata and others added 3 commits October 29, 2026 14:31
When UCM loads a .u file and reports a parse error, type error, or type
warning, prepend a `path:line:col` reference (path relative to UCM's
working directory) above each one, so clicking it in an IDE terminal like
VSCode's jumps straight to the offending source.

- PrintError: add `rangeForErrorNote` / `rangeForWarn`, which pick the
  location to point at — the cause's own location when it carries one,
  otherwise the innermost error term (for warnings, the offending
  occurrence).
- Output: thread the source file name into the ParseErrors / TypeErrors /
  TypeWarns constructors (they previously carried only the source text).
- OutputMessages: add `clickableSourceLocation` / `withSourceLocation`,
  gated on the watch directory being present. Transcripts pass no
  directory, so their output is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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