-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
[WIP] feat($plugins): start the work on supporting custom plugins #120
[WIP] feat($plugins): start the work on supporting custom plugins #120
Conversation
Also, we should really warn Swift users to follow prerequisites, otherwise there is a risk for a lot of confusion. There should be a strategy for this case... |
This is awesome!! thank you for your work @andreiglingeanu.
I think maybe could add some documentation around it on both Before I merge this would be awesome to add some more info for this plugins support on the Once again thank you very much for this PR, can't wait to use this when developing in |
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.
This PR looks good to me, I wonder if we should pin to stable release versions of the plugins on our package.json, other than that we should update the readme and docs and it should be good to be merged!
Thanks a lot!
One more important thing that should be figured out is how to gracefully detect and fallback the case when the user defines We should somehow default to our |
Hi @andreiglingeanu,
Do you mind explaining a bit more that scenario ? We already allow user to overwrite any defaults since we use
We already do that (https://github.com/prettier/vim-prettier/blob/master/autoload/prettier.vim#L361), but that has the assumption that the user has done " post install (yarn install | npm install) then load plugin only for editing supported files
Plug 'prettier/vim-prettier', {
\ 'do': 'yarn install',
\ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue'] } The post install hook of If I misunderstood what were your concerns were do you mind giving an example ? |
Please keep me posted around the above, so that we can merge this PR soon |
For some reason this PR, as it is, is not enough for me to correctly format a PHP file. It might be that prettier is not picking up plugins from our Can you reproduce that one on your end? |
Will try this PR locally and see what I can find |
Hi @andreiglingeanu , I have just tested your PR and it worked for me when having the 'plugin' field defined on the '.prettierrc' or on package.json. I am going to patch this PR to also use the default one when the user does not have it installed. Will hopefuly have sometime to work on this tomorrow or the day after and will merge this |
Sounds good, looking forward to it. Thank you! |
Another thing I noticed while testing was that Will investigate this a bit more. To not block this PR what we could do is partially enable plugin support in the meantime by forcing it to run synchronous while we investigate that issue. What I will do is create a holding branch for this issues and merge this PR in there so that I can do some more tweaks on it before publishing to master |
That's definitely very strange. Is the PHP plugin the one who hangs around? |
Still haven't had time to get back into this, what i will do is create a new branch 1.0.x for |
That should also allow some users to use that branch to help finding issues |
@mitermayer @andreiglingeanu I would love to test this, but I can't find this changes in the |
Hi @gigo6000, We have not added this yet to 1.x due to some prOblems we encountered earlier. Hopefully this weekend I will have enought time to do so! |
Will get back to this one this week, this is one of the last issues that we would like to be solved before 1.x |
Hey @mitermayer, I think I can squeeze some time this week to push through getting this thing forward. Is there anything I can help you with? |
I'm not sure why this hasn't been merged but if anyone is interested in using Prettier with PHP feel free to use my fork in the meantime: https://github.com/gigo6000/vim-prettier |
This has not been merged yet, apologies! Been swamped at work as I’m going on parental leave soon (2nd September) but getting back to this ASAP |
@mitermayer no worries, this is open source :). Congrats on your baby! |
Congrats on your baby! |
This has been merged on the release/1.x branch #155 |
Just tested it, works flawlessly! 👍 I can't wait to update the README of prettier-php once 1.x has been released 🙂 |
Summary
This PR implements the work described in #119. We start to depend on custom known plugins and provide config for them out of the box.
For now, this contains almost everything that is needed for that to work, besides the
--plugins
flag passing toprettier
binary. I'm not really sure how to approach that, because we need to gracefully fallback to a user-defined.prettierrc
file.Test Plan
*.php
,*.swift
or*.py
file and run:Prettier