Braden Snell
Braden Snell

Reputation: 1371

Visual Studio Code - Scaffolding Newly Created File

I have a gulp file that watches for any source files I add to my project. When it sees that a file was added and the newly created file is empty, I scaffold that file with some boilerplate code.

The only problem is when I create this file in my editor I have to refresh my editor (Visual Studio Code in this case) in order to see what I just wrote to that file. (Right now the file just appears blank).

Perhaps there is some way to delay Code displaying the file? Or perhaps there is a faster way to write the file so Code displays it correctly initially?

Upvotes: 1

Views: 293

Answers (1)

Braden Snell
Braden Snell

Reputation: 1371

Benjamin Pasero on the VSCode team sent me this:

  • Close VS Code
  • Open C:\Users\\AppData\Local\Code\app-0.3.2\resources\app\server\lib\watcher\ base.win32.watcher.js
  • Find the following lines:

else if (currentChangeType === watcher.ChangeTypes.CREATED && newChangeType === watcher.ChangeTypes.CHANGED) { }

  • Remove them or comment them out by adding “//” to their beginning of the line
  • Restart VS Code

This fix he said would be included in the next update of VSCode.

Upvotes: 1

Related Questions