-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Activate on onStartupFinished
#257
Conversation
Closes #214 Stops this extension from slowing VS Code during startup.
This change seems to result in inconsistent document formatting test results. In three attempted test runs, all 3 failed on Ubuntu and 1 failed on macOS. Will need further investigation. |
We'll probably have to wait for this extension's formatter to become available for formatter tests to stabilize. For example, it test is waiting for the command to be available. |
@ota-meshi If you want to speed up the tests, you could open one of the test files in a The alternative is to reorganise some of your tests to focus on a particular language, bundle CSS tests together, bundle SCSS tests together..etc. |
@ota-meshi I was trying to find some way in the API to get a list of registered document formatters, but I couldn't find what I was looking for. I searched in the vscode repository and was able to find code which retrieves a list of formatters, but it seems to be part of a private API that isn't exposed publicly. Is there another way you know of?
I'm not sure I understand — with |
I don't know the another way 😓 |
I've brought this use case up over at microsoft/vscode#135674 |
The code you quoted does "wait for at most 2000 ms and report whether it's activated". What about explicit activation: const vscodeStylelint = extensions.getExtension('stylelint.vscode-stylelint');
await vscodeStylelint.activate(); |
|
Added so that formatter test can wait until formatter is registered since VS Code has no API to check if a formatter with a given ID exists. See microsoft/vscode#135674
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #214
Stops this extension from slowing VS Code during startup.