microsoft / sarif-vscode-extension

SARIF Microsoft Visual Studio Code extension
MIT License
110 stars 49 forks source link

Honor extension-provided uriBase #508

Closed 50Wliu closed 1 year ago

50Wliu commented 1 year ago

Fixes #506

This is a bigger change than I thought it would be, so I would really appreciate some eyes and feedback on it to ensure:

  1. This is spec-compliant
  2. I'm not breaking existing behavior

The crux of the change is removing all URI parsing logic from parseArtifactLocation and instead updating UriRebaser.translateArtifactToLocal to handle raw SARIF artifact paths.

Since translateArtifactToLocal now acts on the verbatim artifact URIs, that allows us to easily prepend extension-provided uriBases. However, as a side effect, artifactUri is no longer guaranteed to be an actual URI, so lots of the other changes were updating supporting codepaths (e.g. all the base translation) to handle simple filesystem paths, not just URIs.

Validation:

Sidenotes.