jonsmithers / vscode-open-in-vim

Plugin to open current file in vim
https://marketplace.visualstudio.com/items?itemName=jonsmithers.open-in-vim
MIT License
18 stars 7 forks source link

Doesn't seem to work with Linux Snap package #4

Open farzadmf opened 5 years ago

farzadmf commented 5 years ago

Hi,

I really like your extension, and I use it to open a file in Gvim:

"open-in-vim.openMethod": "gvim"

but there seems to be a problem with the vscode installed throught snap on Ubuntu 18.10. When I select the command "Open in Vim", nothing happens.

Do you know why that's happening, and if it can be solved?

Thank you

jonsmithers commented 5 years ago

Hm. I'd expect it to at least display an error message if something goes wrong. Does it work for other open methods, like integrated-terminal?

Also, is it perhaps an unnofficial/old snap of vscode? I saw a blurb about migrating vscode snaps:

Microsoft is now publishing an official snap of Visual Studio Code, you should migrate to it using these commands:

snap remove vscode
snap install code --classic

(https://snapcraft.io/vscode)

farzadmf commented 5 years ago

@jonsmithers Yes, it works with integrated-terminal, and also I'm using the official snap package.

I guess it could be due to a permission issue or something because of how snap packages are in a sandbox, but that's just a guess.

I tried in another system (a VirtualBox guest) with the same configuration as the other system, and I saw this error message; maybe it would be helpful: image

jonsmithers commented 5 years ago

That's really interesting. I'm travelling at the moment and have really spotty internet, so it might be a few days before I can try the snap for myself.

Presumably running gvim path/to/file "+call cursor(1, 2)" by itself from the terminal works fine.

farzadmf commented 5 years ago

It's OK. Take a look whenever you have time.

Also, I'm not sure if I'm missing something here, but when I run the command you mentioned, I get an error, and the terminal ends up showing vim in terminal and not Gvim, this is what I see: image

jonsmithers commented 5 years ago

Oh wow. That seems to suggest that this is an issue with gvim. I have some ideas for random things to try:

(As a side note, it would be nice if this open-in-vim plugin detected non-zero exits so that an issue like this doesn't unfold as a silent failure.)

farzadmf commented 5 years ago

Sorry @jonsmithers for the late reply, I tried a few things you suggested and:

Any ideas?

jonsmithers commented 5 years ago

Thanks for helping with all this experimentation. I feel fairly confident you are right about this being a snap permission issue. I was able to finally install the snap on Fedora and I can reproduce the issue myself too. I think the best place for further investigation is on vscode's side. I went ahead and made an issue there. Feel free to add anything I might have missed.

farzadmf commented 5 years ago

Thank you @jonsmithers for creating that issue; let's see what happens there :)