VSCodeVim / VSCodeVim/Vim

Failed to handle key `F`: Cannot read properties of undefined (reading 'fileName')

Open
#8,260 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. install Go lang plugin
  2. bind "Go: Fill struct" to vim shortcut
  3. in go code press shortcut to trigger "Go: Fill struct"
  4. See error

vim shortcut binding:

        {
            "before": [
                "<leader>",
                "F"
            ],
            "commands": [
                "go.fill.struct"
            ]
        }

go code:

package main

type T struct {
	A int
	B string
}

func main() {
	t := T{
              **// shortcut press in here**
	}
}

go plugin:
image

VSCodeVim version: 1.24.3

Stack trace
Error: Cannot read properties of undefined (reading 'fileName')
	at s.h (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:96:108192)
	at s.$executeContributedCommand (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:96:108744)
	at l.N (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:106:11239)
	at l.M (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:106:10957)
	at l.H (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:106:10044)
	at l.G (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:106:9022)
	at /data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:106:7810
	at f.invoke (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
	at g.deliver (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:2029)
	at d.fire (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:1667)
	at p.fire (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:72:14861)
	at /data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:122:15815
	at f.invoke (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
	at g.deliver (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:2029)
	at d.fire (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:1667)
	at p.fire (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:72:14861)
	at t.E (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:72:18927)
	at /data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:72:18106
	at f.invoke (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
	at g.deliver (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:2029)
	at d.fire (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:1667)
	at h.acceptChunk (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:72:12592)
	at /data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:72:11879
	at f.invoke (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:145)
	at g.deliver (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:2029)
	at d.fire (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:63:1667)
	at d.t (/data00/home/liuxiguang/.vscode-server/bin/441438abd1ac652551dbe4d408dfcec8a499b8bf/out/vs/workbench/api/node/extensionHostProcess.js:72:28518)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Go: Fill struct command through the shown VSCodeVim mapping inside a Go struct literal, then trace the command execution path associated with the reported fileName error. There are no repository files or tests named in the report; done means the shortcut no longer throws and the command completes in this scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.