GNOME-Builder should use the percentage from $/progress
Language servers can send the $/progress
notification, that allows for the client to show e.g. some progress.
For example, if some work has progressed, the server sends a WorkDoneProgressReport. It has an optional percentage field that gives more details.
One example, if you open a rust project, like Fractal, you get this log:
17:06:10.9909 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"3/39 (std)","percentage":7}}}
17:06:11.3355 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","percentage":10}}}
17:06:11.3356 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"4/39 (proc_macro)","percentage":10}}}
17:06:11.4175 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"5/39 (ruma + 2 more)","percentage":12}}}
17:06:11.4177 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"5/39 (ruma + 3 more)","percentage":12}}}
17:06:11.4186 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"6/39 (ruma + 3 more)","percentage":15}}}
17:06:11.7220 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"7/39 (ruma + 3 more)","percentage":17}}}
17:06:11.7222 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"8/39 (ruma + 3 more)","percentage":20}}}
17:06:11.9327 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"9/39 (ruma + 3 more)","percentage":23}}}
17:06:11.9506 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"10/39 (ruma + 3 more)","percentage":25}}}
17:06:12.0112 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/39 (ruma + 3 more)","percentage":28}}}
17:06:12.1758 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"12/39 (ruma + 3 more)","percentage":30}}}
17:06:12.1771 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"13/39 (ruma + 3 more)","percentage":33}}}
17:06:12.6058 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"14/39 (ruma + 3 more)","percentage":35}}}
17:06:12.9897 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"15/39 (ruma + 3 more)","percentage":38}}}
17:06:12.9955 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"16/39 (ruma + 3 more)","percentage":41}}}
17:06:12.9958 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"17/39 (ruma + 3 more)","percentage":43}}}
17:06:13.0003 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"18/39 (ruma + 3 more)","percentage":46}}}
17:06:13.0009 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"19/39 (ruma + 3 more)","percentage":48}}}
17:06:13.0103 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"20/39 (ruma + 3 more)","percentage":51}}}
17:06:13.1846 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"21/39 (ruma + 3 more)","percentage":53}}}
17:06:13.7131 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"22/39 (ruma + 3 more)","percentage":56}}}
17:06:15.1950 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"23/39 (ruma + 3 more)","percentage":58}}}
17:06:15.2118 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"24/39 (ruma + 3 more)","percentage":61}}}
17:06:15.4653 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"25/39 (ruma + 3 more)","percentage":64}}}
17:06:15.4655 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"26/39 (ruma + 3 more)","percentage":66}}}
17:06:15.4660 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"27/39 (ruma + 3 more)","percentage":69}}}
17:06:15.5028 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"28/39 (ruma + 3 more)","percentage":71}}}
17:06:15.5239 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"29/39 (ruma + 2 more)","percentage":74}}}
17:06:15.6367 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"30/39 (ruma + 1 more)","percentage":76}}}
17:06:15.6368 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"30/39 (ruma + 2 more)","percentage":76}}}
17:06:15.9682 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"31/39 (ruma + 2 more)","percentage":79}}}
17:06:16.1365 jsonrpc-input-stream[ 2]: MESSAGE: <<< {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"32/39 (ruma + 1 more)","percentage":82}}}
It takes a lot of time to index all files/packages. The progressbar in the upper top, that is currently just moving around with no progress could be somehow extended to be a "real" progressbar. (Maybe the "message" field could be used, too, like "Indexing: 29/39 (ruma + 1 more)" in the title bar.)
I would also be willing to write the patch if this feature is desired