Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haxe server should not use --wait stdio #217

Closed
ncannasse opened this issue Apr 8, 2018 · 7 comments
Closed

Haxe server should not use --wait stdio #217

ncannasse opened this issue Apr 8, 2018 · 7 comments

Comments

@ncannasse
Copy link
Member

Communications on stdout/stdin are error prone for several reasons:

  • a print left somewhere in the compiler will break the protocol
  • a macro starting a command that prints things will break the protocol

I recommend moving to proper socket and drop the hack that makes haxe language server opens a proxy socket

@Gama11
Copy link
Member

Gama11 commented Apr 8, 2018

It still seems nice to have a proxy in case we need to restart the server (haxe.executable changed or similar).

@nadako
Copy link
Member

nadako commented Apr 8, 2018

Although I can agree on the second point (the first one is just a compiler bug), I won't change this unless there's a "non-hack" solution to address issues mentioned in HaxeFoundation/haxe#5188.

@frabbit
Copy link

frabbit commented May 6, 2018

I also experience problems in a big project which i think are related to this, will try to figure that out when i have more time.

@nadako
Copy link
Member

nadako commented May 23, 2018

So I was taking a bath and suddenly it occured to me that we can do the same trick as in the eval debugger:

  • bind a free port and start listening on the IDE side
  • start haxe server passing the port to connect to as an argument
  • haxe connects to IDE and both proceed to do normal socket communication

@Gama11
Copy link
Member

Gama11 commented May 23, 2018

So finding a free port is the only blocker to not using --wait stdio? Your earlier comment sounded like it was more than that ("issues mentioned in HaxeFoundation/haxe#5188").

@nadako
Copy link
Member

nadako commented May 23, 2018

this should address all issues: free ports (just bind to 0) and knowing when connection can be/is established (Haxe will connect to us itself and then we're ready to communicate)

@nadako
Copy link
Member

nadako commented May 30, 2018

I started working on that, though I don't have a lot of free time nowadays.
On vshaxe side this requires some refactoring to properly abstract and separate the lowlevel haxe communication layer, so we can support both stdio and sockets.

nadako added a commit to HaxeFoundation/haxe that referenced this issue Aug 31, 2019
nadako added a commit to vshaxe/haxe-language-server that referenced this issue Aug 31, 2019
Simn pushed a commit to HaxeFoundation/haxe that referenced this issue Sep 1, 2019
* [server] implement --wait-connect (see vshaxe/vshaxe#217)

* [CLI] remove rogue parens

* [CLI] change to --server-listen and --server-connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants