Don't underline the entire schema for top-level errors/warnings#162
Don't underline the entire schema for top-level errors/warnings#162
Conversation
🤖 Augment PR SummarySummary: Prevents top-level (root) lint/metaschema issues from underlining an entire JSON Schema document in VS Code. Changes:
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 👎 |
vscode/src/utils/fileUtils.ts
Outdated
| export function errorPositionToRange(position: Position): vscode.Range { | ||
| const [lineStart, columnStart, lineEnd, columnEnd] = position; | ||
|
|
||
| if (lineStart === 1 && columnStart === 1 && lineEnd > lineStart) { |
There was a problem hiding this comment.
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
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
90c862e to
89102ab
Compare
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
89102ab to
7f6865e
Compare
Signed-off-by: Juan Cruz Viotti jv@jviotti.com