I would appreciate any tip or hints on how to approach it.
I would appreciate any tip or hints on how to approach it.
The VSCode APIs [1] is the place to look for driving VSCode. Perhaps I could help more if you explain what exactly you're trying to do.
Rundoc is a tool for writing tutorials such that the author is guaranteed the outcome is valid (if a command fails, the tutorial fails) and for helping users see the exact output they would expect (instead of a static output). The tool has website integration that allows you to take screenshots and navigate a webpage.
Recently I wrote this tutorial https://schneems.com/2023/06/14/its-dangerous-to-go-alone-pu... which makes heavy use of vscode extension shortcuts and hover over tips. I would love to be able to keep that tutorial up to date by scripting the tooltips to make sure the options don’t change and the suggested commands like CMD+. Continue to work.
I believe there are two ways to do what you want.
1. Use the VSCode extension APIs and the built-in commands[1] to write an extension that unit tests your tutorials
For example, you could use vscode.executeCodeActionProvider which will return the actions that VSCode suggests at a specific point in the file.
For the shortcuts, I think the only option would be to read user's keybindings.json file directly.
This is the easiest way I think and may be enough but generally speaking, VSCode's APIs are very restrictive and may not give you everything you need.
2. VSCode being an Electron app can be run from Playwright (similar to Selenium) which should give you full control to drive and inspect it. I haven't done this myself but apparently Playwright is used internally to test VSCode as well. So it should be possible. See [2].