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

Endless loop in package.json #42

Closed
screendriver opened this issue Feb 23, 2017 · 14 comments
Closed

Endless loop in package.json #42

screendriver opened this issue Feb 23, 2017 · 14 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@screendriver
Copy link

I enabled editor.formatOnSave and every time I open my package.json it tries to format it (prettier does not support formatting JSON files), then it saves, reformat, save, reformat... automatically. I don't get out of this loop.

feb-23-2017 08-32-06

@CiGit
Copy link
Member

CiGit commented Feb 23, 2017

Could not reproduce it with these steps. This extension runs only on javascript and javascriptreact. We'll need some more information.

  • Extension version?
  • Vscode version?
  • OS?
  • What language mode is selected for your package.json (bottom right of the editor)?
  • Are there some logs in the developer tools Help -> Toggle developer tools

@CiGit
Copy link
Member

CiGit commented Feb 23, 2017

It may be an extension conflict. To find out, it will take some time if you have a lot of enabled extensions.

@screendriver
Copy link
Author

  • Extension version 0.9.0
  • VSCode version 1.9.1
  • mac OS sierra
  • package.json language is JSON

Ah I believe I found it out. I also installed Add New Line to Files to ensure that there is always a new line at the end of the file. If I disable it it works.

It seems that there is a conflict between your plugin and the other one 🤔

@CiGit
Copy link
Member

CiGit commented Feb 23, 2017

Thank you, that was fast. I'll try both plugins.

@CiGit
Copy link
Member

CiGit commented Feb 23, 2017

I've reproduced the problem with prettier disabled and Add New Line to Files enabled.
So the conflict with this extension can be eliminated. But it doesn't occur without formatOnSave. There is an embed formatter for JSON tho.

FormatOnSave is in Code since September 2016. Add New Line to Files's last release is in June 2016. I think it needs to be updated.

@screendriver
Copy link
Author

So the solution would be to open an issue there?

@CiGit
Copy link
Member

CiGit commented Feb 23, 2017

I think it's the best idea. We can safely assume that the issue is not with this extension.
BTW the embed formatter removes last empty line for JSON.

@esbenp
Copy link
Contributor

esbenp commented Feb 23, 2017

@CiGit I have added you as collaborator - feel free to take any action you feel appropriate :-)

@screendriver
Copy link
Author

I opened an issue there jdforsythe/vscode-add-new-line-to-files#1

@CiGit
Copy link
Member

CiGit commented Feb 23, 2017

@esbenp Thank you. With great power ...

@screendriver It's not a conflict with this one. It does exactly the same if you disable prettier.

@screendriver
Copy link
Author

screendriver commented Feb 23, 2017

Just a little update: I installed another plugin called final-newline. With this one it seems to work together with prettier-vscode

@CiGit
Copy link
Member

CiGit commented Feb 23, 2017

Great. Problem solved on this side. Closing

@CiGit CiGit closed this as completed Feb 23, 2017
@screendriver
Copy link
Author

Yepp 😎

Thank you for your quick help!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

3 participants