Support multiple ide server instances #2586
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The primary issue this addresses is that there can be only one ide server running at the same time, because they all use the same socket number. (idris-community/idris2-mode#26).
Since the plugins read the socket number from stdout, this could be worked around by opening socket "0" which means "choose an open socket", but idris2 currently prints the configured value rather than the actual socket number that was chosen by the OS.
This PR changes
--ide-mode-socket
to print the number of the socket that was opened, rather than the configured value. This change enables--ide-mode-socket :0
to work correctly.It also changes the default socket to 0. This change allows existing clients to benefit from having more than one server running at a time, without change. But it assumes they respect the socket number printed on stdout. I don't see any evidence via google of anyone hardcoding the number 38398, so I think this is safe.
If clients do want a specific socket, they can still specify it on the command line.
Do any plugins besides the emacs ones use ide-mode-socket?