Code-server: vscodevim doesn't work

Created on 5 Nov 2019  路  16Comments  路  Source: cdr/code-server

  • code-server version: 2.1665-vsc1.39.2-linux-x86_64
  • OS Version: Debian GNU/Linux 10 (buster)
  • Extension: https://github.com/VSCodeVim/Vim (1.11.3 installed from default marketplace)

Description

After installation it has no effect.

Steps to Reproduce

  1. In extensions tab, install vscodevim 1.11.3
  2. Open any file attempt to edit
extension

All 16 comments

Just to confirm, did you refresh the browser after installing the
extension? Currently the page needs to be reloaded after installing an
extension.

Yes I did refresh.

After some investigation it turns out because of Safari. It doesn't support the new RegExp feature that vscodevim used. Use Chrome then it will work as normal.

After installing vscodevim, if I keep refresh Safari, there's a 50% chance it will show a message saying failed to load the extension because of invalid group qualifier in RegExp. I guess the first few times the message didn't show so I assumed I got a silent failure.

This is very sad because for iOS devices, they are stuck with Safari (Chrome for iOS is still Safari engine). And for those devices vim key bindings are quite necessary.

I did a bisect and found the last working version of vscodevim that works inside Safari is 0.17.3.

During the investigation I also noticed that if I use --extra-extensions-dir to load the extension, without modifying publisher or name, then code-server will keep attempting to update the extension and download an extra copy of latest and put into <user-data-dir>/extensions

Ahh yeah that makes sense. I'd forgotten it has that issue on Firefox.
I think we'll need to send a fix to vscodevim (or Firefox/Safari but I
imagine that would be more difficult).

During the investigation I also noticed that if I use --extra-extensions-dir to load the extension, without modifying publisher or name, then code-server will keep attempting to update the extension and download an extra copy of latest and put into <user-data-dir>/extensions

Oof yeah I just ran into that yesterday. I'll open another issue for it.

Firefox seems working on their regex implementation to be the same as Chrome.

Yes. My work is to re-sync our irregexp implementation with the one that is used in V8. When I'm done, our regexps should be at feature parity with Chrome.
Link

But Safari seems not fixing this anytime soon.

I would love to contribute a fix to vscodevim. But I have such a difficult time trying to figure out how to debug extension when loaded in Safari. The error doesn't have any meaningful stack, I tried to put debugger; in the vscodevim source but Safari doesn't seem to respect that.

I cannot use vscode to do the debugging, because this only repros in Safari. Any pointers?

That's good news about Firefox!

Yeah debugging is going to be really hard due to the way we load
client-side extensions. I'm not sure it can be improved at all but I
should look into it at some point.

I think debugger; should work but since the extension is cached you
might need to check the "disable cache" box in the devtools if there is
one or clear the cache before loading the page.

Thanks for the tip about cache, that explains a lot of mysterious behavior when I was debugging it.

Unfortunately debugger; doesn't work even in Chrome, so I am pretty stuck to find out which exact RegExp is failing. For now I think I have to settle with vscodevim 0.17.3.

Thanks for the tip about cache, that explains a lot of mysterious behavior when I was debugging it.

Unfortunately debugger; doesn't work even in Chrome, so I am pretty stuck to find out which exact RegExp is failing. For now I think I have to settle with vscodevim 0.17.3.

Installing vscodevim 0.17.3 did not solve the problem for me.

Thanks for the tip about cache, that explains a lot of mysterious behavior when I was debugging it.
Unfortunately debugger; doesn't work even in Chrome, so I am pretty stuck to find out which exact RegExp is failing. For now I think I have to settle with vscodevim 0.17.3.

Installing vscodevim 0.17.3 did not solve the problem for me.

me, too

Has anyone figured out a workaround? For now I use the amVim extension on iOS but its feature set isn鈥檛 as good sadly.

Does anyone have a better alternative?

@muammar @black-desk, for 0.17.3 you will need to install the node_modules manually for the extension.

As of 1.12.0 of vscodevim released yesterday, even chrome stopped working because of the usage of fs.readFileSync() from the extension. @code-asher .

As an immediate remedy, maybe in the coder extension repo, we should take 1.11.X as max version.

@xbtsw I had tried 1.0.0,1.9.0 and 1.11.3, none of them work.

@black-desk if you load an older version, code-server will attempt to upgrade it to latest - which will make it stop working. You will need to modify the manifest file and give it a new name.

Regarding the missing modules see #1299

Otherwise, the issue is with firefox/safari.

I can happily confirm that with iPadOS 13.4 (GM) amVim works if you go into the Keyboard settings and map the Caps Lock key to Esc. I'm using the Brave browser.

I can happily confirm that with iPadOS 13.4 (GM) amVim works if you go into the Keyboard settings and map the Caps Lock key to Esc. I'm using the Brave browser.

Thanks for this. I confirm that amVim extension works for me. I am using Safari. I access the Esc key with Ctlr + [.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rcarmo picture rcarmo  路  3Comments

RealSlimMahdi picture RealSlimMahdi  路  3Comments

lshamis picture lshamis  路  3Comments

infogulch picture infogulch  路  3Comments

pchecinski picture pchecinski  路  3Comments