psc-ide-vim icon indicating copy to clipboard operation
psc-ide-vim copied to clipboard

Startup on random port, use `.psc-ide-port`

Open natefaubion opened this issue 7 years ago • 8 comments

Other psc-ide plugins startup on a random port, and tag the port in a .psc-ide-port file. A global config means you can only have one instance running at a time.

natefaubion avatar Jul 09 '17 16:07 natefaubion

I've been thinking about it for a while, and we are really missing that feature. For the moment I have an autocommand which changes the port number:

    au BufRead $HOME/repos/gravicus/ospreyui/** let psc_ide_server_port = 4343

coot avatar Jul 31 '17 06:07 coot

You can have local .vimrc in project directory with let g:psc_ide_server_port = PORT_NUMBER which I'm using extensively. I think that random port can be used, but only when psc_ide_server_port is not defined.

paluh avatar Jul 31 '17 07:07 paluh

Yes, that's a good point.

coot avatar Jul 31 '17 15:07 coot

Oh, my, I'm an idiot. I have this working since December 2016 (on a fork at https://github.com/kika/psc-ide-vim) and I never submitted a PR. I'll merge the upstream and submit.

kika avatar Sep 09 '17 21:09 kika

Great, then it's battle tested :)

coot avatar Sep 09 '17 21:09 coot

I've merged my changes but can't get through testing phase yet. I'm seeing a strange bug, which seems to be not related to port selection. Sometimes (typically when I hit TAB to get the completion) vim rescans the imports and suddenly reformats all my import lists. I've made a few 2-line changes to my sources which caused 20+ line commits, because of the changed import lists (they just got rearranged, nothing changes semantically). Any ideas?

kika avatar Oct 09 '17 23:10 kika

That's not a bug, that's a feature of purs ide. It formats imports when one is adding ones and we run it in CompleDone autocommand to import the identifier. You can turn it off though.

coot avatar Oct 10 '17 01:10 coot

Hm, but I'm not adding anything, I just write some code.

kika avatar Oct 10 '17 01:10 kika