vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.85k stars 398 forks source link

Feature request: disable write virtual files when git working tree not clean #3205

Open xiaoxiangmoe opened 1 year ago

so1ve commented 1 year ago

@xiaoxiangmoe Shall we add an option for it?

xiaoxiangmoe commented 1 year ago

This is a feature request proposed by @johnsoncodehk

The background is: write virtual files may make our project code dirty, indistinguishable from virtual file and source code.

The main requirements are: If it is detected that this is a git repo and the working tree is not clean, write virtual files will prompt you that you need to complete git commit before you can write virtual files. If this is not a git repo, no restrictions are imposed.

Since this is a small improvement, there is no need to add options. (And there are very few people who can use write virtual files)

cc @so1ve

so1ve commented 1 year ago

I guess we need to implement this feature in volar framework...? Because language-tools only activates this command, and the implementation is in volar core.

johnsoncodehk commented 1 year ago

Yes, it should implement at https://github.com/volarjs/volar.js/blob/master/packages/vscode/src/features/writeVirtualFiles.ts.