microsoft / microsoft/sarif-web-component

Highlight is wrong when snippet has leading white space

Open
#11 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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:

ContextRegion

... 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:

image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.