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.
There are two things here that are both aimed at reducing the amount of
resource clutter:
I've seen many tmp files left. Looking at the code, it seems to me
like a reasonable thing to get rid of them when a file is saved. I
did this via adding
tide-remove-tmp-file
onafter-save-hook
.I also saw that there is a general tendency to accumulate many
servers since they're never removed (actually, more than just the
servers -- the whole project resources are kept, but the server is
the main problem wrt resources). This is also mentioned in Only start one tsserver, not one per tsconfig #256.
So I implemented a function that scans all buffers and cleanup all
projects that have no live buffers. It looks to me like a good idea
to do this, since you can just kill old buffers to reduce resource
usage. (And killing old buffers is more obvious than explicitly
openning the server list to kill old ones, especially since there's
no way to tell if a server is used by some buffer or not.)
(I added this function onto
kill-buffer-hook
, but if that's tooextreme, then a more mild option is to not do that and just let
people add it themselves.)