-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
fix: use synckit to support Prettier 3 #199
Conversation
09cf0dc
to
9236587
Compare
@idahogurl AFAIK, you can use |
@JounQin That would work if I was bundling |
That doesn't matter with external and no need to bundle at all for regular commonjs, but I'm not so familiar with VSCode/vmscripts. Regularly, If it doesn't work, then |
If you need any help, I can help to raise a new PR based on this one later for you. |
Co-authored-by: JounQin <[email protected]>
Co-authored-by: JounQin <[email protected]>
Can you update the PR title accordingly? |
I did some quick debugging and found out there is still a bottleneck with the worker having to load Also the preload did nothing for me because, from a VSCode window reload with a document already opened, the extension is only activated when the formatter is run. I think a solution would be to:
|
@netux I think you can just raise a PR for your proposal. |
* fix: use synckit with ESM correctly * chore: add .vsix files into .gitignore
function waitForActiveSupportedDocument() { | ||
if ( | ||
!window.activeTextEditor | ||
|| !supportedLanguages.includes(window.activeTextEditor.document.languageId) |
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.
I believe supportedLanguages
should not be hard coded because of 3rd-party plugins. But it can be done in next minor version, I'd like to PR after v3 released later.
I think we are just ready to go! Congratulations! |
I have opened #206 to address an issue on Windows. |
* fix: resolve path to file url correctly * check if path absolute
Co-authored-by: JounQin <[email protected]>
What
Closes #171
Breaking Changes
prettier-eslint
must be installed locally by the userWhy
Prettier 3 added a dynamic
import()
in its .cjs file, making ESM support required. VS Code only supports CommonJS (CJS) however. According to this comment prettier/prettier-vscode#2947 (comment), VSCode extensions can useworker_threads
and a Worker can executeimport()
.Thus, this PR makes it so that instances of
prettier-eslint
are run on Worker ofworker_threads.