Open slrtbtfs opened 5 years ago
Some googling shows. TCP connections are nice but cannot be accessed from Webbrowsers so it might make sense to just implement both.
github.com/gorilla/websocket seems to be the sanest go websocket lib around.
This is mostly implemented here: https://github.com/prometheus-community/promql-langserver/blob/master/langserver/websocket.go
However this code still is still untested, so this issue won't be closed until this functionality is verified to work.
Update: There exists the experimental websocket package for this now.
similar implementation in rest package would be implemented with the websocket package right ?
Regarding metrics?
The main difference is that http requests are upgraded to websocket connections that are kept open as long as the client is running.
not regarding metrics. i mean would the websocket protocol also expose similar endpoint like hover, completion etc. as exposed in rest(using http) package?
No, it opens one endpoint that upgrades to a websocket connection that serves as a transport layer for the Language Server Protocol.
The rest package is a alternative API for use cases where the LSP would be to complex, but only works for single queries which are usually small enough for HTTP GET requests (i.e. YAML files are intentionally not supported).
For an extensive discussion, see https://github.com/prometheus/prometheus/issues/6160 .
clear now. Thanks. seems like the remaining checklist for this to close is testing the websocket module?
Yes.
The go language server just does it's communication over plain tcp. That might actually be better than websockets.