vscode-jest
vscode-jest copied to clipboard
Gutter icons go missing after changing file's capitalization with it open
Environment
-
vscode-jest version
: 4.2.1 -
node -v
: v14.17.5 -
npm -v
oryarn --version
: yarn 1.22.5 -
npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): [email protected] - your vscode-jest settings if customized:
"jest.autoRun": { "watch": true, "onStartup": ["all-tests"] }, // "onSave": "test-file",
"jest.testExplorer": {
"showInlineError": true,
"enabled": true
},
But this occurs even without these settings.
- Operating system: macOS 11.6.1
Prerequisite
- are you able to run jest test from the command line? Yes.
- how do you run your tests from the command line? (for example:
npm run test
ornode_modules/.bin/jest
)jest
Steps to Reproduce
- Clone this repo at this commit: https://github.com/phoenixeliot/line-puzzle/commit/fa953e9010a0e8998643fb2a0c3a59d7f36fde1c
- Run
yarn
in the repo folder - Open the folder in VS Code
- Open Cell.test.js
- Keeping the file open, rename it to cell.test.js (lowercase)
- In the test in that file, change
color: "O",
tocolor: "Y",
to make it fail - Observe the red underline from the test failure, but no gutter markings
- Rename the file to Cell.test.js and save it
- Observe the gutter markings return
Relevant Debug Info
This relates to a piece of VS Code editor state that is saved in the SQLite database at ~/Library/ApplicationSupport/Code/User/<session ID>/state.vscdb
, under the key memento/workbench.parts.editor
.
When this error is occurring, the JSON at that row looks like this (in this case, it's visible with the Board.test.ts
file, which is how I originally got this problem. The same pattern is visible in the entry for board.ts
). In particular, note the "resourceJSON" which contains the old capitalization, and "preferredResourceJSON" which has the new capitalization. In this case I had started lowercase and changed it to uppercase.
memento/workbench.parts.editor
{
"editorpart.state": {
"serializedGrid": {
"root": {
"type": "branch",
"data": [
{
"type": "leaf",
"data": {
"id": 3,
"editors": [
{
"id": "workbench.editors.files.fileEditorInput",
"value": "{\"resourceJSON\":{\"$mid\":1,\"fsPath\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/src/board.ts\",\"external\":\"file:///Users/phoenix/Code/_personal_projects/line-puzzle/src/board.ts\",\"path\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/src/board.ts\",\"scheme\":\"file\"},\"preferredResourceJSON\":{\"$mid\":1,\"fsPath\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/src/Board.ts\",\"external\":\"file:///Users/phoenix/Code/_personal_projects/line-puzzle/src/Board.ts\",\"path\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/src/Board.ts\",\"scheme\":\"file\"},\"encoding\":\"utf8\"}"
},
{
"id": "workbench.editors.files.fileEditorInput",
"value": "{\"resourceJSON\":{\"$mid\":1,\"fsPath\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/src/Area.ts\",\"external\":\"file:///Users/phoenix/Code/_personal_projects/line-puzzle/src/Area.ts\",\"path\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/src/Area.ts\",\"scheme\":\"file\"},\"encoding\":\"utf8\"}"
},
{
"id": "workbench.editors.files.fileEditorInput",
"value": "{\"resourceJSON\":{\"$mid\":1,\"fsPath\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/src/Cell.ts\",\"external\":\"file:///Users/phoenix/Code/_personal_projects/line-puzzle/src/Cell.ts\",\"path\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/src/Cell.ts\",\"scheme\":\"file\"},\"encoding\":\"utf8\"}"
},
{
"id": "workbench.editors.files.fileEditorInput",
"value": "{\"resourceJSON\":{\"$mid\":1,\"fsPath\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/tests/board.test.ts\",\"external\":\"file:///Users/phoenix/Code/_personal_projects/line-puzzle/tests/board.test.ts\",\"path\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/tests/board.test.ts\",\"scheme\":\"file\"},\"preferredResourceJSON\":{\"$mid\":1,\"fsPath\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/tests/Board.test.ts\",\"external\":\"file:///Users/phoenix/Code/_personal_projects/line-puzzle/tests/Board.test.ts\",\"path\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/tests/Board.test.ts\",\"scheme\":\"file\"},\"encoding\":\"utf8\"}"
},
{
"id": "workbench.editors.files.fileEditorInput",
"value": "{\"resourceJSON\":{\"$mid\":1,\"fsPath\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/tests/Area.test.ts\",\"external\":\"file:///Users/phoenix/Code/_personal_projects/line-puzzle/tests/Area.test.ts\",\"path\":\"/Users/phoenix/Code/_personal_projects/line-puzzle/tests/Area.test.ts\",\"scheme\":\"file\"},\"encoding\":\"utf8\"}"
},
{
"id": "workbench.input.settings2",
"value": ""
},
{
"id": "workbench.editors.files.fileEditorInput",
"value": "{\"resourceJSON\":{\"$mid\":1,\"fsPath\":\"/Users/phoenix/Library/Application Support/Code/User/settings.json\",\"external\":\"vscode-userdata:/Users/phoenix/Library/Application%20Support/Code/User/settings.json\",\"path\":\"/Users/phoenix/Library/Application Support/Code/User/settings.json\",\"scheme\":\"vscode-userdata\"},\"encoding\":\"utf8\"}"
}
],
"mru": [
3,
6,
5,
4,
0,
1,
2
]
},
"size": 965
}
],
"size": 609
},
"orientation": 1,
"width": 965,
"height": 609
},
"activeGroup": 3,
"mostRecentActiveGroups": [
3
]
}
}
Expected Behavior
The gutter icons should stay in place even after renaming the file with different capitalization.
Actual Behavior
The gutter icons disappear, and the exception is only underlined (not expanded).
Screenshot taken in my original bug case, where I renamed board.test.ts to Board.test.ts:
Workaround
The workaround is to close any affected file tabs, quit VS Code, relaunch, and then reopen the files.
yes I can indeed reproduce this issue, however, it turns out that this is a known issue within vscode because it does not support case sensitivity for macOS: microsoft/vscode#94307
I know, hard to believe... feel free to add your voice there. I am afraid we won't be able to address this use case until vscode fixes the issue above.