Vim: Cannot read property 'options' of undefined

Created on 9 Jan 2018  Â·  2Comments  Â·  Source: VSCodeVim/Vim

When running tests with the latest master of this extension I get the error:

/Applications/Visual Studio Code.app/Contents/MacOS/Electron --debugBrkPluginHost=32139 --debugId=87cea423-3896-43c7-b629-e9f9283614bd --extensionDevelopmentPath=/Users/admin/Data/libraries/vscode-vim-master --extensionTestsPath=/Users/admin/Data/libraries/vscode-vim-master/out/test 

command-line lexer
    ✓ can lex empty string
    ✓ can lex comma
    ✓ can lex percent
    ✓ can lex dollar
Unhandled Rejection at: Promise 
Object
 reason:  TypeError: Cannot read property 'options' of undefined
    at /Users/admin/Data/libraries/vscode-vim-master/extension.ts:74:50
    at Generator.next (<anonymous>)
    at fulfilled (/Users/admin/Data/libraries/vscode-vim-master/out/extension.js:4:58)
    at <anonymous>

It seems like this is because curHandler.vimState.editor is undefined and that is because vscode.window.activeTextEditor is undefined.

My theory is that when VSCode first initializes there are no editors because those don't get created until later tests. There may be a race condition here because it seems like the lexer tests run before the vim extension finishes initializing, so it's possible that if it gets to tests that create an editor before it finishes initializing the vim extension you won't see this error.

I get the same error when I run the extension (instead of the tests) and it starts on the Welcome screen.

Environment:

  • Extension (VsCodeVim) version: 63be67e27dd7c5e387eaa146d9d86e9766a87e19 (latest master)
  • VSCode version: 1.19.1
  • OS version: macOS 10.13.2

Most helpful comment

I'm also running vscodevim 1.1.0 with VSCode 1.32.1 on OSX 10.14.3 and see this error pretty regularly.
Next time it comes up I'll try to run with developer mode to track it down.

All 2 comments

I'm getting this error. My extension version is 1.1.0 and VSCode is version 1.32.1.

I'm also running vscodevim 1.1.0 with VSCode 1.32.1 on OSX 10.14.3 and see this error pretty regularly.
Next time it comes up I'll try to run with developer mode to track it down.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajinder-yadav picture rajinder-yadav  Â·  3Comments

AndersenJ picture AndersenJ  Â·  3Comments

liamdawson picture liamdawson  Â·  3Comments

spinningarrow picture spinningarrow  Â·  3Comments

cckowin picture cckowin  Â·  3Comments