-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuring tide to avoid starting tsserver immediately #294
Comments
I am not sure what will start to break when we don't start the tsserver. So probably you can come up with some approach and we could discuss the details. One thing you could try is to move all the variable setup etc into
this will give you more control over when to start the server. if we just disable the server-start, the |
I would assume there are various kinds of invocations which I would assume only occurs on actual end-user interaction:
Etc. Maybe we can try to lazy-load tsserver (and "configure" the buffer) when these kind of functions get invoked? And that works out well... Maybe we won't need a preference at all? |
I do prefer reducing the number of configuration variables as much as possible, but sometimes competing considerations weight more in the balance. Getting lazy-starting right is doable. However, I'm concerned about getting it right in various use-case scenarios that may be hard to predict. I'd be thrilled to put out a one-shot release that nails it in one go, but I'm not confident that will happen. The nightmare scenario is releasing something that works in the test suite, "works for me" (tm), and maybe works for all three of us, but once released we get a flurry of issues because a substantial part of the user base runs into trouble because they happen to do things I did not predict. I discovered that NaN was an issue in #279 purely by chance. The code worked fine, until I switched laptops and started getting CPU percentage numbers that were NaN. I can see that PR having been released and immediately getting issue reports that it crashes for some folks. If that had happened, one saving grace was that A naive implementation would lazy-start A less naive implementation would determine some conditions under which it lazy-start should be turned off and require the user to manually invoke @ananthakumaran You are bringing up issues that I'll have to address. Your observation about how plugins may behave is actually one other reason I'm skittish about the prospect of making lazy-starting |
Oops... forgot to close this when #303 was merged. |
This is a suggestion for a new feature.
The Problem
I use session management to record my Emacs session and restore it when I start Emacs again. I've used this setup for years. The only time I've had a problem before was with flymake but I fixed that by switching to flycheck. However, recently tide has started giving me issues, indirectly. I have a hand in a lot of different TypeScript projects. Restoring a session has become really slow due to all the
tsserver
instances that are immediately started and compete for CPU. It has been a problem for a long time but recently it's become unbearable. Maybe TS 3 has features that causetsserver
to need more processing power. I don't know. I've definitely been doing things that require me to restart Emacs more often lately. Right now, when I restart Emacs I havepkill -f tsserver
at the ready to kill alltsserver
instances. (Fortunately, Emacs is the only tool I use that startstsserver
.) Then I start them manually as needed.The Proposal
I'd like to be able to set a configuration variable such that the variable can be set to tell
tide-setup
to skip startingtsserver
immediately. I'd be perfectly happy with having to issuetide-restart-server
manually (like I'm doing now) whenever I need it. I thought about startingtsserver
lazily: whenever tide needs it andtsserver
is absent, then tide would start it automatically, but I'd be happy even without this functionality.I volunteer for implementing this, but if there are concerns or flat out objections I'd rather hear about them ahead of time.
The text was updated successfully, but these errors were encountered: