code-server icon indicating copy to clipboard operation
code-server copied to clipboard

vscodevim doesn't work

Open ccstr opened this issue 7 years ago • 16 comments

  • 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

ccstr avatar Nov 05 '19 20:11 ccstr

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

code-asher avatar Nov 06 '19 17:11 code-asher

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

ccstr avatar Nov 07 '19 06:11 ccstr

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).

code-asher avatar Nov 07 '19 16:11 code-asher

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.

code-asher avatar Nov 07 '19 16:11 code-asher

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?

ccstr avatar Nov 07 '19 21:11 ccstr

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.

code-asher avatar Nov 07 '19 23:11 code-asher

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.

ccstr avatar Nov 08 '19 05:11 ccstr

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.

muammar avatar Dec 02 '19 01:12 muammar

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

black-desk avatar Dec 09 '19 08:12 black-desk

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

Does anyone have a better alternative?

patrikzudel avatar Dec 10 '19 12:12 patrikzudel

@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.

ccstr avatar Dec 17 '19 08:12 ccstr

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

black-desk avatar Dec 18 '19 13:12 black-desk

@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.

ccstr avatar Dec 31 '19 08:12 ccstr

Regarding the missing modules see #1299

Otherwise, the issue is with firefox/safari.

nhooyr avatar Jan 30 '20 18:01 nhooyr

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.

dmin7b5 avatar Mar 19 '20 17:03 dmin7b5

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 + [.

muammar avatar Apr 12 '20 02:04 muammar