microsoft / microsoft/sarif-web-component
Highlight is wrong when snippet has leading white space
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 108
- Forks
- 36
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 3
Description
If you open this SARIF file:
SnippetWithLeadingWhiteSpace.sarif.txt
... in VS and click on the one result, you see this:

... which is right. But the Web viewer strips the leading white space from the offending line, but doesn't adjust the highlight position, so you see this:

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by opening the linked SnippetWithLeadingWhiteSpace.sarif.txt in the Web viewer and selecting its result, then compare the rendering with the VS example. Trace the viewer's handling of leading whitespace and highlight positioning; done means the offending line retains its leading whitespace and the highlight aligns with the intended text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100