microsoft / sarif-vscode-extension

SARIF Microsoft Visual Studio Code extension
MIT License
107 stars 48 forks source link

Internal Content is not properly displayed #544

Open jnix-abk opened 6 months ago

jnix-abk commented 6 months ago

I'm trying to get internal content to display in VS code and the code that prepares the artifact locations does not align with the code that consumes the artifact location.

https://github.com/microsoft/sarif-vscode-extension/blob/a1740e766122c1759d9f39d580c18b82d9e0dea4/src/shared/index.ts#L193-L200 Notice that Line 194 refers to links as sarif:// and Line 198 refers to them as sarif:. This causes the consuming code to not recognize internal references (which are required to be sarif://): https://github.com/microsoft/sarif-vscode-extension/blob/a1740e766122c1759d9f39d580c18b82d9e0dea4/src/extension/uriRebaser.ts#L116-L117

The Virtual Document handler expects the links to be sarif: otherwise the extra forward slashes break the link parsing. https://github.com/microsoft/sarif-vscode-extension/blob/a1740e766122c1759d9f39d580c18b82d9e0dea4/src/extension/index.ts#L276-L278

Debugging this myself, I altered Line 117 in uriRebaser.ts to check just for sarif:. I am not sure if this is the correct fix, but I was able to embed content and have it work.