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
adding vs-code integration #166
Conversation
Codecov Report
@@ Coverage Diff @@
## master #166 +/- ##
=======================================
Coverage 98.32% 98.32%
=======================================
Files 67 67
Lines 477 477
Branches 64 64
=======================================
Hits 469 469
Misses 8 8
Continue to review full report at Codecov.
|
@@ -10,7 +10,8 @@ const languages = [ | |||
{ | |||
extensions: ['.sol'], | |||
name: 'Solidity', | |||
parsers: ['solidity-parse'] | |||
parsers: ['solidity-parse'], | |||
vscodeLanguageIds: ['solidity'] |
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.
Don't like making a PR based on a pending PR, but it looks like vs-code will ask for this info anyway.
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.
can you elaborate a little bit more on this @Janther
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.
at the moment there's a PR in prettier-vscode prettier/prettier-vscode#757 waiting for approval.
This PR looks for a local prettier, then a global prettier and if prettier is not installed in the system, it relies on it's own packaged version of prettier.
if you have prettier and our plugin installed locally in the project, it will load our plugin.
then vs-code will call getSupportInfo and there search in the languages for the value vscodeLanguageIds
. that's why even if prettier/prettier-vscode#757 is not approved, the moment any plugin tries to use prettier as a formatter for vscode, it must provide vscodeLanguageIds
.
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.
that PR was opened the 17th of March hehehe 😅
Can we merge and publish this? A co-worker of mine wants to give the plugin a try in vscode, but he's getting the error arround vscodeLanguageIds. |
@fvictorio, your co-worker can install the plugin using the branch. npm install --save-dev prettier "prettier-plugin-solidity@prettier-solidity/prettier-plugin-solidity#feature/vs-code" I rebased it to master so it's up to date. |
@fvictorio @Janther will merge and deploy asap |
There's a PR for
prettier-vscode
that will allow the use of third-party plugins.Steps:
prettier-vscode
(if you had it)prettier-vscode
using the instructions from Add plugin support prettier/prettier-vscode#757npm install --save-dev prettier prettier-plugin-solidity
Once
prettier-vscode
has accepted the PR.prettier-vscode
from the official release.