Skip to content
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

Merged
merged 1 commit into from Jul 2, 2019
Merged

adding vs-code integration #166

merged 1 commit into from Jul 2, 2019

Conversation

Janther
Copy link
Contributor

@Janther Janther commented Jun 26, 2019

There's a PR for prettier-vscode that will allow the use of third-party plugins.

Steps:

  • uninstall prettier-vscode (if you had it)
  • uncheck Extensions: Auto Update
  • install prettier-vscode using the instructions from Add plugin support prettier/prettier-vscode#757
  • have prettier and prettier-plugin-solidity in your project.
    npm install --save-dev prettier prettier-plugin-solidity
  • config format on save

Once prettier-vscode has accepted the PR.

  • reinstall prettier-vscode from the official release.

@codecov
Copy link

codecov bot commented Jun 26, 2019

Codecov Report

Merging #166 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #166   +/-   ##
=======================================
  Coverage   98.32%   98.32%           
=======================================
  Files          67       67           
  Lines         477      477           
  Branches       64       64           
=======================================
  Hits          469      469           
  Misses          8        8
Impacted Files Coverage Δ
src/index.js 94.44% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8e1032...30e9f6f. Read the comment docs.

@@ -10,7 +10,8 @@ const languages = [
{
extensions: ['.sol'],
name: 'Solidity',
parsers: ['solidity-parse']
parsers: ['solidity-parse'],
vscodeLanguageIds: ['solidity']
Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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 😅

@fvictorio
Copy link
Member

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.

@Janther
Copy link
Contributor Author

Janther commented Jun 28, 2019

@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.

@mattiaerre
Copy link
Member

@fvictorio @Janther will merge and deploy asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants