Describe your feature request
The thing with repls are, they use a lot of resources depending on the language you’re using. That also implies for language servers, which are running on the same repl. It would be good if they would get their own resource space to at least run normally, since the typescript language server shuts down a lot of times (don’t know if it’s because of the ram or cpu usage, but it just hangs up after like 10 mins)
What problem(s) would this feature solve?
Explain what you were trying to do when you came across the problem leading to this feature request
Also, please don’t tell me to “pay for extra resources”. Language servers are kinda their own thing, and imo everyone deserves a decent intellisense at coding.
This doesn’t seem to be a goal anymore (at least not a high-priority one), but an initial goal stated during the desktop app beta testing was to allow the LSP to be run on the user’s local computer to reduce resource usage.
An alternative could indeed be to allocate shared processes in virtual machines just for language servers, and this would make it work for users of mobiles or very slow/limited computers. (if not possible to share the LSP across global repls it could be shared across the user/team)
I haven’t noticed this issue, but it has been 3 months since I’ve properly used a Free plan / global cluster repl. Could you link a specific repl as well as steps to reproduce the issue? This could be a bug in the typescript language server itself:
After testing with a classic nodejs repl, the lsp seems to turn off after about 5-10 minutes. One thing I noticed is that when it’s running, the repl’s ram is almost always 100%. When the lsp gets shut down, the ram drops down to almost nothing. Here’s an image of the resource tab when the lsp dies (the ram is at the bottom):
When that happens, the website still thinks the lsp is running (it says “active” when checking it).
And as you might’ve guessed, this situation is the same as the one you linked at the end. The language server process stops working and the frontend doesn’t know it so nothing automatically restarts it (except kill 1 or reloading the page).
This means that intellisense, hovering over variables, formatting (if it’s the default one), and the variable renaming don’t work. When trying to rename a variable, it says that the client is not created (since the language server is not running), just like in the post you linked at the end.
A reason this may be happening is because of an oom killer of some sort (which is pretty much what brought me to make this post). No idea though, just speculating.
And that’s pretty much the issue. Also, to reproduce it, just make a repl with the typescript language server as a formatter (make the repl as a free plan repl, it probably doesn’t happen when you have more resources) and start typing some code. I tried it on this repl: https://replit.com/@AljaBerginc/lsp-test
As a temporary workaround, to not have to reload the page or kill 1 every time an LSP dies, you could try my LSP reloader extension. It shows you the LSPs you have configured and lets you kill them and have them restarted. It might work or it might not, but you can give it a try if you want to.