Conversation
🤖 Augment PR SummarySummary: This PR simplifies the VS Code extension by removing the TypeScript toolchain from Changes:
Technical Notes: The VS Code extension now runs directly from 🤖 Was this summary useful? React with 👍 or 👎 |
| const diagnostics = errors | ||
| .filter((error): error is LintError & { position: Position } => | ||
| error.position !== null) | ||
| .filter((error) => error.position !== null) |
There was a problem hiding this comment.
updateLintDiagnostics filters out null positions but not undefined; if any CLI error object omits position, errorPositionToRange(error.position) will throw when destructuring. Consider filtering out both null and undefined (or validating the shape) before creating diagnostics.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| .filter((error): error is MetaschemaError & { instancePosition: Position } => { | ||
| return 'instancePosition' in error && error.instancePosition !== undefined; | ||
| }) | ||
| .filter((error) => 'instancePosition' in error && error.instancePosition !== undefined) |
There was a problem hiding this comment.
This filter only excludes undefined instancePosition, but null (or other non-array values) would still pass and then crash in errorPositionToRange(error.instancePosition) due to destructuring. Consider ensuring instancePosition is a valid 4-tuple before building a vscode.Range.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
e085221 to
8dbdc03
Compare
The whole thing is 500 lines of code. The amount of boilerplate needed to setup TypeScript, the build, the extra dependencies, etc seem overkill for something so simple. Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
8dbdc03 to
3266b15
Compare
The whole thing is 500 lines of code. The amount of boilerplate needed
to setup TypeScript, the build, the extra dependencies, etc seem
overkill for something so simple.
Signed-off-by: Juan Cruz Viotti jv@jviotti.com