* Remove uri normalize and added workspace.findFiles maxResults value
* Fix space
* Add back platformUriNormalize and make file search case-insensitive
* perform case-insensitive search on win32
* Fix uppercase test
---------
Co-authored-by: Chris Huynh <chhuynh@microsoft.com>
* Add functionality to inject analysis on startup
If the `sarif-viewer.githubCodeScanningInitialAlert` setting has a
value, use the contents of the value as the alert to apply. This is
meant as a way to automatically apply fixes from a codescanning alert.
Additionally, if this alert has any fixes in it, they are automatically
applied. We also need to handle some slight differences in the SARIF
format. The fix objects that we are receiving are non-standard. We
expect that for each fix, there is a `diff` in its property bag that
contains a git-patch formatted version of the diff to apply.
Lastly, this adds some simple telemetry. It collects that the
autofix was applied, whether or not it was successful, and (if
unsuccessful) a failure message.
* Restructure `activateGithubAnalyses`
* Add retries for getting the remote fetch url
On codespaces, there is a race condition where sometimes the extension
starts before the filesystem is fully activated. When this happens, it
is not possible to get any of the remotes from the git api.
The solution is to perform some retries when getting the remotes.
* Add more logging to the output channel
No functional changes, just help with debugging and information.
* Address comments from review
* Bump version
* Run tests during CI
This change renames `eslint.yml` to `checks.yml` and adds a new job that
runs the tests in that workflow.
There are some additional changes associated with this:
1. The tests in `index.spec.ts` were hanging after they ran since they
did not properly dispose the API after running. This is now fixed.
2. I added the `dispose` method to the `api`, which properly disposes
all required objects.
3. I removed the `deactivate` method from `index.ts` since it is not
used anywhere.
4. Similarly, I deleted `_options` from `openLogs` since it is not used.
5. I removed `async` from several api methods that do not need it.
6. I updated the typing in `index.d.ts` to properly reflect the type
of the api.
* Disable extension tests that are hanging on CI
* Matrix over windows and linux
* Avoid making changes to external API
Though, this does add the `dispose` method to the API.
* Fixes unit tests
With this change, running `npm run tests` will succeed.
It looks like the tests have not been run for a long time and the
implementation has drifted, making the tests harder to run.
There are lots of small changes here:
1. Change the `launch.json` to remove `--inspect-brk=9229`, which was
preventing the tests from running.
2. Add some exclusions to `settings.json` so that some unnecessary
folders are removed from the file open dialog.
3. Fix up the mock objects so that the tests correctly reflect the
current implementation.
4. Add `await` and `async` to `setState` in indexStore.ts so that
the function correctly waits for the post message to complete. (Note
this is the _only_ change to non-test code in this PR.)
5. Change the test assertions so that they test the right things.
A few comments here on future work:
1. These tests all use stubs for the vscode API. This isn't ideal since
it's complicated and we really should be testing the vscode API
directly. Future work should be to run the unit tests from inside
of a workbench so we don't need to stub out the vscode API.
2. We should be running the tests on each PR. I'll fix this in a
followup PR.
* Remove commented code
* Fix compile errors and warnings
- Updated launch config for mocha (tests are failing, but at least it
launches)
- Updated versions in package-lock.json
- Updated `@types/vscode` to latest
- Removed two `onCommand` triggers that are now deprecated
- Added `const vscode: VsCodeApi` to `global.d.ts` to get properly typed
references to `vscode` instance in the webview.
- Converted `return` to `return undefined` where appropriate to make
compiler happy.
- Also, a handful of other errors that the compiler was complaining
about.
* Update .vscode/launch.json
* Part 1: move uriBase logic into uriRebaser
* Step 2: Add translations
* Disable more schemes
* Also add translations for workspace prefixes
* Add support for uriBase
* Remove overrideUriBase
* Correct decorations URI checking
* Fix URI rebasing
* Relax strategy restrictions
* Clean up an any
* Remove now-unused Array.commonLength
* Allow file system strategy to work with filepaths
* Update localUri to be a real Uri
* Check uriBase before other strategies
* uriBase must be an absolute URI
* Remove bad comment
* Remove unused url-join
* Fix compile
* Can't use Uris as map keys
* Feature: download the source file from github if available
* Fix the check if the file was already downloaded
* Linting warnings
* Extract msg to variable
---------
Co-authored-by: Chris Meyer <cmeyer@microsoft.com>
* Update webpack to build
* Watch files opened via API
* Automatically remove if the log is deleted
* watcher.close is async
* Unwatch all on closeAllLogs
* Fix local TS errors
* Make a note of the race condition