neoclide / coc-prettier

Prettier extension for coc.nvim.
MIT License
542 stars 48 forks source link

Support pnpify --sdk #66

Open esetnik opened 4 years ago

esetnik commented 4 years ago

Pnpify documentation shows that prettier is supported https://yarnpkg.com/advanced/editor-sdks#vim--cocnvim but we need to add a custom prettierPath to the coc-settings.json so that the pnpified prettier can be used. Can coc-prettier add support for this? The vscode extension already supports it.

https://github.com/yarnpkg/berry/blob/8e77d191926e841faaf7093de24db0409e6094a7/packages/yarnpkg-pnpify/sources/generateSdk.ts#L172

tlvince commented 4 years ago

Related to https://github.com/neoclide/coc-tsserver/issues/166; was about to post the same :+1:

mfzl commented 3 years ago

Has this been solved or is there a workaround?

jackielii commented 1 year ago

I think setting "prettier.prettierPath": ".yarn/sdks/prettier/index.js", in .vim/coc-settings.json works

lyleunderwood commented 1 year ago

The above did not work for me, as the SDK was attempting to import prettier from the zip file which threw an error. Try:

"prettier.prettierPath": "yarn exec prettier"