Failed to handle key `s`: Cannot read properties of undefined (reading 'fileName')
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
To Reproduce
Steps to reproduce the behavior:
- When I use my VIM shortcut defined as:
{
"before": ["<leader>", "f", "s"],
"commands": ["go.fill.struct"]
}
or run the command Go: Fill struct I get the error message below.
- I see the error:
Failed to handle key
s: Cannot read properties of undefined (reading 'fileName')
Side note! It used to work. I haven't changed any keyboard shortcuts but I have updated VSCode and my installed extensions.
VSCodeVim version: 1.23.2
Stack trace
TypeError: Cannot read properties of undefined (reading 'fileName')
at getCommonArgs (/Users/tobstr/.vscode/extensions/golang.go-0.35.1/dist/goMain.js:78352:24)
at /Users/tobstr/.vscode/extensions/golang.go-0.35.1/dist/goMain.js:78341:16
at a._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:63922)
at a._doExecuteCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:62740)
at a.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:62600)
at Object.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:106:31928)
at p.handleRemapping (/Users/tobstr/.vscode/extensions/vscodevim.vim-1.23.2/src/configuration/remapper.ts:519:35)
at p.sendKey (/Users/tobstr/.vscode/extensions/vscodevim.vim-1.23.2/src/configuration/remapper.ts:369:20)
at t.Remappers.sendKey (/Users/tobstr/.vscode/extensions/vscodevim.vim-1.23.2/src/configuration/remapper.ts:39:26)
at process.handledAsRemap (node:internal/process/task_queues:96:5)
at N.text [as handleKeyEvent] (/Users/tobstr/.vscode/extensions/vscodevim.vim-1.23.2/src/mode/modeHandler.ts:487:9)
at /Users/tobstr/.vscode/extensions/vscodevim.vim-1.23.2/extensionBase.ts:359:73
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the shown Vim mapping and the Go: Fill struct command, then inspect src/configuration/remapper.ts and src/mode/modeHandler.ts using the stack trace as the entry point. Compare the remapped command path with direct command execution and confirm that the command no longer produces the fileName error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100