language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

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

Open xiaoxiangmoe opened this issue 2 years ago • 4 comments

xiaoxiangmoe avatar May 19 '23 15:05 xiaoxiangmoe

@xiaoxiangmoe Shall we add an option for it?

so1ve avatar Jun 28 '23 12:06 so1ve

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

xiaoxiangmoe avatar Jul 03 '23 07:07 xiaoxiangmoe

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.

so1ve avatar Jul 03 '23 09:07 so1ve

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

johnsoncodehk avatar Jul 05 '23 03:07 johnsoncodehk

Close as the "Write Virtual Files" command has been removed.

johnsoncodehk avatar Jul 05 '25 11:07 johnsoncodehk