-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
prettier-plugin-organize-imports needs some help :) #1649
Comments
There isn't a public API for it. Our code structure is quite different from volar. There isn't a language-service package to be reused. You might have to do more work for it, unfortunately. But I would assume that organize-import might not need as much of the logic we have in the language service host layer. It should not be very difficult. What we did is:
As for tests, you could find them here. Setup isn't important for your use case. You can just read the corresponding file and the result text edit. Also as I mentioned earlier the indent might not be super important for a prettier plugin. language-tools/packages/language-server/test/plugins/typescript/features/CodeActionsProvider.test.ts Lines 539 to 1117 in cd78438
Hope that helps you. Feel free to ask more if you have some trouble understanding. |
Thank you so much! |
Hello maintainers, this is in reference to simonhaenisch/prettier-plugin-organize-imports#39 where we are trying to add Svelte support. A couple of us have tried unsuccessfully to understand how you do it here.
Can you help by providing a code sample (or add a Svelte test) that, given the string input of a Svelte file, returns the same thing with imports organized?
The text was updated successfully, but these errors were encountered: