Run in web
This is intended as an replacement PR for #39 which got messed up with conflicts.
@jgclark @alkatar21 can you look at it? I added a vsix as well.
I've been trying for 30 minutes to test this in one of the web test environments, using various methods listed at https://code.visualstudio.com/api/extension-guides/web-extensions#web-extension-tests. I think it does install OK, but I can't get further to actually test it in use. Which method did you use to test it @elazarcoh?
But the good news is that this PR runs OK for me locally, and doesn't exhibit the same single-digit highlighting problem as I was reporting on #39.
vscode-test-web --browserType=chromium --extensionDevelopmentPath=$extensionLocation $testDataLocation
described in https://github.com/microsoft/vscode-test-web.
this opens a web browser with vscode, in the given folder, where I put my .vscode/settings.json for testing.
We can add it in a launch.json to make it easier to debug.
Thanks. Sounds like I'd been doing the right thing. I'd tried a variety of browserTypes as well, given the following warning about Playwright which I couldn't get to go away. I consistently get variations of this error (when running from my local GH directory with the vsix file in):
vscode-test-web --extensionDevelopmentPath=. .
@vscode/test-web: 0.0.15
Serving dev extensions from /Users/jonathan/GitHub/vscode-todo-highlight
Serving local content /Users/jonathan/GitHub/vscode-todo-highlight at /static/mount
Listening on http://localhost:3000
(node:47141) UnhandledPromiseRejectionWarning: browserType.launch: Executable doesn't exist at /Users/jonathan/Library/Caches/ms-playwright/chromium-907428/chrome-mac/Chromium.app/Contents/MacOS/Chromium
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers: ║
║ ║
║ npx playwright install ║
║ ║
║ <3 Playwright Team ║
╚═════════════════════════════════════════════════════════════════════════╝
at openBrowser (/opt/homebrew/lib/node_modules/@vscode/test-web/out/index.js:99:59)
at open (/opt/homebrew/lib/node_modules/@vscode/test-web/out/index.js:76:27)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:47141) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:47141) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C
I then remembered I'm running node v14.x (a requirement on the other project I contribute to), so I switched up to node 19.9.0, and updated everything, and then I get Chromium spinning up on localhost:3000 without errors, but it only gives a blank screen without any hint of VSCode other than its favicon. Passing different folders for test data doesn't help.
try to open the dev tools (f12) and see if there are errors that make sense