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

Adhere to "files.insertFinalNewline": true ? #85

Open
mgzenitech opened this issue Feb 14, 2024 · 1 comment
Open

Adhere to "files.insertFinalNewline": true ? #85

mgzenitech opened this issue Feb 14, 2024 · 1 comment

Comments

@mgzenitech
Copy link

I have this extension setup together with https://marketplace.visualstudio.com/items?itemName=pucelle.run-on-save:

  "runOnSave.commands": [
 {
   "async": false,
   "command": "sortJSON.sortJSON",
   "match": ".*\\.json$",
   "runIn": "vscode"
 }
  ]

So basically I can use delayed saves and trigger whatever command I need.

The issue is that I have "files.insertFinalNewline": true set and vscode-sort-json extension doesn't follow this setting. Final result is infinite loop of resaves as after initial save by this extension vscode adds missing empty line at the end and this triggers again sortJSON.sortJSON which removes empty line. Maybe this extension could ensure that at least if this setting is set to true the produced json also has empty line at the end?

@richie5um
Copy link
Owner

Thanks for the comment and the config. I haven't updated this extension for a long time, so probably a few things I need to fix up. I'll add to my todo list and hope to get to it soon.

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

No branches or pull requests

2 participants