question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Temporarily Set Configuration For Save Operation

See original GitHub issue

I’m maintaining the EditorConfig extension and am in dire need of a feature that would eliminate some issues with respect to the following settings and potentially more in the future (e.g., end of line setting):

  • files.insertFinalNewline
  • files.trimFinalNewlines
  • files.trimTrailingWhitespace

Specifically, I need a way to short-circuit / override these settings temporarily for a file-save operation, because allowing vscode to perform any kind of trimming is destructive and either irreversible or extremely hacky to fix. It’s like asking me to unpunch someone.

Basically, I need a way to change the way that vscode does a built-in save operation on a per-file basis (which is how EditorConfig works). Pre-save TextEdits are not good enough, because whatever I do before a save could potentially be wiped out with vscode’s destructive trimming after the fact.

Another option, of course, would be to make EditorConfig a built-in feature of vscode, which I think makes all the sense in the world.

Note: these issues only surfaced after vscode introduced these editor settings, because now we have 2 things trying to do the same thing.

Related issues

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:28
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

21reactions
segevfinercommented, Apr 22, 2020

Looks like the VS Code project itself is now recommending the EditorConfig extension. Would be nice if it was prioritized adding/changing what’s needed so it can be implemented fully and accurately.

11reactions
bpaserocommented, Jan 7, 2019

Adding @jrieken to this thread who added the API for doing something pre-save.

Another option, of course, would be to make EditorConfig a built-in feature of vscode, which I think makes all the sense in the world.

Yes, probably a good idea at some point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IOS and Configuration Basics - Cisco
Whenever you make changes to the RPM configuration, you must save the changes to memory so they will not be lost if the...
Read more >
Run/debug configurations | IntelliJ IDEA Documentation
Select a temporary configuration in the run/debug configuration switcher and then click Save Configuration. Save a temporary run configuration.
Read more >
How to set Temporary and Permanent Paths in Java?
Setting Permanent Path. Go to My Computer ---> Right Click on it ---> Advanced System Settings ---> Advanced Tab ---> Click on Environment ......
Read more >
Use OneDrive policies to control sync settings - Microsoft Learn
This setting lets you specify a minimum amount of available disk space and block the OneDrive sync app (OneDrive.exe) from downloading files ...
Read more >
Chapter 5. Configuring kernel parameters at runtime
To configure a parameter temporarily, use the command as in the following example: ... procedure describes how to use the sysctl command to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found