Description
Currently, diagnostics highlight the entire line (columns 0–1000) regardless of where the actual vulnerability is located. This makes it hard to spot which expression is problematic, especially on long lines.
Current State
In diagnostics.ts:updateDiagnostics():
const range = new vscode.Range(line, 0, line, 1000);
The full line is underlined even when the finding is about a specific expression like transfer(amount) or a + b.
Expected Behavior
- Parse the finding message or suggestion to identify the exact span of the vulnerable expression
- If the CLI provides column/end-column information, use it for precise span highlighting
- Fall back to line-level highlighting only when position data is unavailable
Implementation Notes
- The
GuardFinding interface already has location.column — check if column is being used correctly
- Consider enhancing the CLI-to-extension interface to include
end_column or span_length
- For O-01 (unchecked arithmetic), highlight just the arithmetic expression, not the entire function
- For A-01/A-04 (missing auth), highlight the function signature line
Acceptance Criteria
Complexity
Medium — requires interface coordination (extension may need CLI changes too) and careful range handling.
Points
150
Description
Currently, diagnostics highlight the entire line (columns 0–1000) regardless of where the actual vulnerability is located. This makes it hard to spot which expression is problematic, especially on long lines.
Current State
In
diagnostics.ts:updateDiagnostics():The full line is underlined even when the finding is about a specific expression like
transfer(amount)ora + b.Expected Behavior
Implementation Notes
GuardFindinginterface already haslocation.column— check ifcolumnis being used correctlyend_columnorspan_lengthAcceptance Criteria
Complexity
Medium — requires interface coordination (extension may need CLI changes too) and careful range handling.
Points
150