genericptr / pascal-language-server

LSP server implementation for Pascal
GNU General Public License v3.0
49 stars 12 forks source link

Ability to choose between TCP/IP and pipes as comunication layer #88

Closed JoostVanDerSluis closed 2 months ago

JoostVanDerSluis commented 2 months ago

This patch implements a TCP/IP layer, without the need of a proxy.

The trick is to use THandleStream as a base communication-class, which can be used for tcp/ip and pipe-based communication. (I use the same algorithm in fpcdebug/fpdserver and LazaruCode)

This implementation only allows one tcp/ip connection, and the language server quits when this tcp/ip connection is closed. (Other models could be used as well. One session for each connection?)

The current code uses pipe-based communication as a default, and only on compile time it can be switched to TCP/IP. (see pasls.lpr, line 135)

Problem is that I don't see an easy way to implement a command-line setting, because the command-line is used to execute command line messages. Maybe use TLSPServerConfig instead?

mvancanneyt commented 2 months ago

Nice one, thanks!