Change:
return `${name.substr(0, lastIndexOfDot)}.1${name.substr(lastIndexOfDot)}`; } <ins> // 123 => 124 let noNameNoExtensionRegex = RegExp('(d+)$'); if (!isFolder && lastIndexOfDot === -1 && name.match(noNameNoExtensionRegex)) { return name.replace(noNameNoExtensionRegex, (match, g1?) => { let number = parseInt(g1); return number < maxNumber ? String(number + 1).padStart(g1.length, '0') : `${g1}.1`; }); } // file => file1 // file1 => file2 let noExtensionRegex = RegExp('(.*)(d*)$'); if (!isFolder && lastIndexOfDot === -1 && name.match(noExtensionRegex)) { return name.replace(noExtensionRegex, (match, g1?, g2?) => { let number = parseInt(g2); if (isNaN(number)) { number = 0; } return number < maxNumber ? g1 + String(number + 1).padStart(g2.length, '0') : `${g1}${g2}.1`; }); } </ins> // folder.1=>folder.2 if (isFolder && name.match(/(d+)$/)) { return name.replace(/(d+)$/, (match, ...groups) => {

Discussion:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Please search existing issues to avoid creating duplicates. --<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: --<!-- Use Help Report Issue to prefill these. --Version: 1.52.1 Commit: Date: 2020-12-16T16:30:02.420Z Electron: 9.3.5 Chrome: 83.0.4103.122 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 20.2.0 Steps to Reproduce: a file called in the explorer. that file. that file. new file name is , where it should be . <img width="220" alt="Screenshot 2021-01-05 at 11 08 23" src="https://user-"<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: <!-- score: 0.485 --- <!-- score: 0.474 --<!-- potentialduplicatescomment --
I think the code is in Last time I checked there was also no test case for that.
Thanks. I acknowledge the issue. And we would welcome a PR that neatly fixes this and adds a test, thus adding help wanted label.
Not a Typescript magician here, otherwise I would have provided a pull request.
I can submit a PR. looking at the file/folder checks it looks like these two sets should be . If they look right, I will send a PR for them. File without extension - Version number only, without extension =
makes sense. Make sure to cover with tests and no need to go too fancy! Thanks
One other incrementing that I am not sure about. becomes , without the leading 0. Is this right, or should it maintain the number of leading 0s?
If you have zero leading paddings it usually means the amount of characters should be maintained. So making out of 0999 would be wrong IMO. It should just become 1000. Me two cents.

I agree with
it would be great if you can try this out with vscode insdiers from tomorrow and give us feedback. Thanks to for providing a PR
Will there be a release or how do I get my hands on the right version to test locally?
releases every day. Just get the release tomorrow and you should be good.
Tested the latest insider build. I could not break it. Works for me. Thanks a lot for the contribution.
Thanks for letting us know. Adding verified label.