Skip to content

Don't underline the entire schema for top-level errors/warnings#162

Merged
jviotti merged 1 commit intomainfrom
no-big-curly-lines
Feb 13, 2026
Merged

Don't underline the entire schema for top-level errors/warnings#162
jviotti merged 1 commit intomainfrom
no-big-curly-lines

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Feb 13, 2026

Signed-off-by: Juan Cruz Viotti [email protected]

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@augmentcode
Copy link

augmentcode bot commented Feb 13, 2026

🤖 Augment PR Summary

Summary: Prevents top-level (root) lint/metaschema issues from underlining an entire JSON Schema document in VS Code.

Changes:

  • Collapse multi-line root-level positions to a zero-width range at (0,0) in errorPositionToRange.
  • Add a VS Code integration test plus a minimal fixture schema to verify root-level lint diagnostics are clamped.

Technical Notes: Relies on VS Code’s rendering of zero-length diagnostics to show a squiggle on the first token, working around the lack of true file-level diagnostics.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

export function errorPositionToRange(position: Position): vscode.Range {
const [lineStart, columnStart, lineEnd, columnEnd] = position;

if (lineStart === 1 && columnStart === 1 && lineEnd > lineStart) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clamping only triggers when the reported root-level range spans multiple lines (lineEnd > lineStart); if the CLI ever reports a whole-document range confined to line 1 (e.g., minified file or EOF without newline), it may still underline a large span. Consider whether columnEnd should also be part of the root-level detection.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@jviotti jviotti merged commit 9f0c120 into main Feb 13, 2026
4 checks passed
@jviotti jviotti deleted the no-big-curly-lines branch February 13, 2026 14:43
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