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

Allow to set files.autoSave as language specific or folder setting #42170

Closed
yunyu opened this issue Jan 25, 2018 · 22 comments
Closed

Allow to set files.autoSave as language specific or folder setting #42170

yunyu opened this issue Jan 25, 2018 · 22 comments
Labels
feature-request Request for new features or functionality file-io File I/O *out-of-scope Posted issue is not in scope of VS Code
Milestone

Comments

@yunyu
Copy link

yunyu commented Jan 25, 2018

  • VSCode Version: Code 1.19.3 (7c4205b, 2018-01-25T10:36:34.867Z)
  • OS Version: Windows_NT x64 10.0.16299
  • Extensions:
Extension Author (truncated) Version
vscode-styled-jsx bla 0.2.2
simple-react-snippets bur 1.1.1
arm dan 0.1.2
vscode-eslint dba 1.4.4
prettier-vscode esb 1.1.2
sublime-babel-vscode jos 0.2.9
Go luk 0.6.73
python ms- 0.9.1
material-icon-theme PKi 3.2.1
python tht 0.2.3
tiger-vscode yun 0.0.1
JavaScriptSnippets xab 1.5.0

(1 theme extensions excluded)


Steps to Reproduce:

  1. Search for the "Configure language specific settings" command by pressing Ctrl+Shift+P
  2. Select any language
  3. In the configuration specific to that language, paste the line "files.autoSave": "afterDelay"
  4. VSCode reports "Unknown editor configuration setting", but the global setting for "files.autoSave" works

Reproduces without extensions: Yes

@yunyu yunyu changed the title files.autoSave not respected by language files.autoSave not respected by language specific settings Jan 25, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Jan 25, 2018

Similar to #39051. Currently "files.autoSave" is not a supported language specific setting

@tschaub
Copy link

tschaub commented Jan 26, 2018

I was just going to open the same issue. In my case, I'm finding it hard to configure VSCode for both JavaScript and Go development. For Go, files.autoSave is nice. For JavaScript, files.autoSave wreaks havoc with HMR or other bundle on change tools.

@bpasero bpasero changed the title files.autoSave not respected by language specific settings Allow to set files.autoSave as language specific setting Jan 26, 2018
@bpasero bpasero added feature-request Request for new features or functionality file-io File I/O labels Jan 26, 2018
@bpasero bpasero removed their assignment Jan 26, 2018
@tschaub
Copy link

tschaub commented Feb 6, 2018

Can anyone provide guidance on how someone might fix this? Is there a commit or merge request that implements something similar that could be used as a starting point?

@bpasero bpasero changed the title Allow to set files.autoSave as language specific setting Allow to set files.autoSave as language specific or folder setting Sep 11, 2018
@tschaub
Copy link

tschaub commented Feb 23, 2019

I see where overridable: true could be added to the files.autoSave (and autoSaveDelay) configuration: https://github.com/Microsoft/vscode/blob/7e7961895c6c940365bfc4bbf2287a8b8c851195/src/vs/workbench/contrib/files/browser/files.contribution.ts#L282-L293

Then it looks like overrides would need to be provided when getting the configuration: https://github.com/Microsoft/vscode/blob/7e7961895c6c940365bfc4bbf2287a8b8c851195/src/vs/workbench/services/textfile/common/textFileService.ts#L96

Maybe this override would look like

{overrideIdentifier: model.getLanguageIdentifier().language, resource}

But I'm uncertain what model and resource would be in this context. I also have no idea how this would impact other configuration and am uncertain how folder overrides are handled. And it looks like there are a few other places where the files.autoSave configuration is accessed that would need updating.

Any suggestions from vscode contributors on whether this is the right direction? I imagine there are complications, but would be happy to get something started unless this is something that is not easily achievable with the way this configuration is handled.

@zion
Copy link

zion commented Mar 22, 2019

@tschaub I came to the same conclusion as you. Setting overridable: true where you suggested did indeed remove the "Unknown editor configuration setting" error in the settings.json file. But I couldn't figure out how to actually apply the settings.

I was testing this with a workspace, so that might be yet another variable here. I really want to have control over what files are auto saved. I have a workspace that has 2 project folders, one for api and one for front end. I suspect that many others do as well, this would be a great enhancement to Code.

Any guidance or insights you can offer us @bpasero?

@rndev-io
Copy link

rndev-io commented Apr 5, 2019

It can be usefull for some sort of virtual FileSystemProviders when writeFile operation is very expensive.

@bpasero bpasero added this to the Backlog milestone Oct 24, 2019
@bpasero bpasero modified the milestones: Backlog, Backlog Candidates Nov 3, 2019
@tschaub
Copy link

tschaub commented Nov 8, 2019

Adding a reference to #82101 (allowing files.eol to be set per-language) in case there are things to crib from in that change.

@broly8
Copy link

broly8 commented Jan 7, 2020

This problem also bothers me. Expect to be resolved.

@vscodebot
Copy link

vscodebot bot commented Jan 22, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodebot
Copy link

vscodebot bot commented Jan 23, 2020

🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodebot vscodebot bot modified the milestones: Backlog Candidates, Backlog Jan 23, 2020
@g10guang
Copy link

Missing Feature autosave just for current open directory file.

@danielkurniadi
Copy link

vote vote vote!

@desmondlzy
Copy link

Yeah, I feel this feature could be really helpful to me!

Autosaving for source code is nice, but when editing latex file with 'compile upon save', frequent save can keep on invoking the compiler and let error messages flood in... I deal with it by toggling autosave or set up a workspace config, neither of which is really neat. So I would really love it if we can config autosave for different file types!

@tusharsadhwani
Copy link

Bump.
Really need autosave for python (as of now), but for nothing else. It's annoying to keep toggling that setting.

@wclr
Copy link

wclr commented Oct 28, 2020

Such improvements may be waited for years. Probably some custom extension is needed.

@vscodebot vscodebot bot added the *out-of-scope Posted issue is not in scope of VS Code label Nov 6, 2020
@abdul06
Copy link

abdul06 commented Nov 10, 2020

This feature would be great!

@willium
Copy link

willium commented Dec 11, 2020

Are there any extensions that do this? Or any hope of bringing this back in scope?

Our use case: declaration files that are auto-generated by TypeScript aren't recognized by VSCode eslint plugin until they're saved, requiring a tedious workaround or turning on auto-save which can cause problems with watch scripts.

@wclr
Copy link

wclr commented Dec 12, 2020

@willium
I've made the extension but didn't publish it, it worked for me, so you may try, build and place/link it to the vscode extensions folder =)
https://github.com/whitecolor/vscode-autosave-ext

@thehale
Copy link

thehale commented May 10, 2023

@wclr Can you add an OSI license to your autosave extension? (e.g. MIT, Apache-2.0, or MPL)?

@wclr
Copy link

wclr commented May 17, 2023

@thehale yes.

@BachoSeven
Copy link

why was this closed?

@thehale
Copy link

thehale commented Jan 7, 2024

why was this closed?

See #110047 (comment)

It's also been superseded by #181942, which is currently in the Insiders build: #181942 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality file-io File I/O *out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

17 participants