Skip to content

Format On Save Mode: modificationsIfAvailable Unable to read file error #253840

@RedCMD

Description

@RedCMD

Unable to read file error when git attempts to open a file ignored by the repo
trigger by formatOnSave with modificationsIfAvailable set

Steps to Reproduce:

  1. clone repo
  2. enable editor.formatOnSave true
    and set editor.formatOnSaveMode to modificationsIfAvailable
  3. open a file that is ignored by the repo
  4. ctrl+s (save)
  5. notice a Unable to read file in the console
log.ts:460   ERR il: Unable to read file 'git:/e:/repos/redcmd/redcmd.tmlanguage-syntax-highlighter/_test/tests.tmLanguage.json.git?{"path":"e:\\repos\\redcmd\\redcmd.tmlanguage-syntax-highlighter\\_test\\tests.tmLanguage.json","ref":""}' (Error: Unable to resolve nonexistent file 'git:/e:/repos/redcmd/redcmd.tmlanguage-syntax-highlighter/_test/tests.tmLanguage.json.git?{"path":"e:\\repos\\redcmd\\redcmd.tmlanguage-syntax-highlighter\\_test\\tests.tmLanguage.json","ref":""}')
    at jvt.G (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:3311:65456)
    at jvt.F (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:3311:65281)
    at async nwt.L (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:3312:9345)
    at async nwt.readStream (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:3312:9120)
    at async Zye.Eb (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:1835:12314)
    at async Zye.resolve (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:1835:10789)
    at async twt.W (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:3312:5991)
    at async tYe.r (vscode-file://vscode-app/e:/VSCode-win32-x64/resources/app/out/vs/workbench/workbench.desktop.main.js:1835:21348)

Image

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)bugIssue identified by VS Code Team member as probable bugscmGeneral SCM compound issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions