-
Notifications
You must be signed in to change notification settings - Fork 205
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
Fix the error that occurs when disable and then enable #1587
Conversation
Hmm. This seems like a very elaborate way of sidestepping poor shutdown... Definitely not a good idea to change priorities, because those may (likely will) have unexpected interactions with other packages. I didn't investigate the issue in any detail, but it seems the root of the issue is that either IDE-UI services should be disposed properly either internally by Atom or on the consumer side. What UI packages are you using? I see no errors with (admittedly no longer supported) atom-ide-ui. |
Thank you for seeing this. The package I'm using is the one included in atom-ide-base. |
Ah, the atom-ide-ui package returns disposable from the consumer, but the atom-ide-base package returns nothing from the consumer. This may be the cause. |
Thanks for investigating! I think the service disposal issue is a bug with atom-ide-outline then (and maybe others?) /cc @aminya |
This fixes #1550. I will look into the code. |
@aminya, please read the conversation, specifically #1587 (comment). The code in this PR, tbf, has issues, but the investigation is great. The "no project" issue I'll fix a bit more carefully in a bit (the code in this PR leaves dangling subscriptions, regrettably, so it's a half-measure). The service disposal needs to be fixed on atom-ide-outline end, hence the ping. |
I've (hopefully) fixed the "no project" error in v14.3.2. Also added some miscellaneous clean-up when the package is disabled (it did have a habit of leaving dangling tsservers running, apparently). @aminya please check if #1550 is reproducible with v14.3.2 (since I couldn't reproduce that one, and you didn't provide a detailed reproduction guide still, I can't really check). Also please check if atom-community/atom-ide-outline#128 has any relation to #1550 @ayame113, thank you very much for the investigation you did here. I'm sorry I didn't end up using any of your code. I did add you as a co-author on 555b5ff though. Let me know if you agree this can be closed. |
Sorry, I hadn't read the details once I left my previous comment. I can fix the outline issue in a future version of the outline. Is this urgent, or is it fine to defer it for a week or so? |
Well, as outlined in the OP, the issue only manifests when outline provider package is disabled and re-enabled, so I don't think it's urgent. Most users don't disable and re-enable packages often, and the state is fixed with Atom restart -- that's probably why the issue escaped notice until now. @ayame113, feel free to correct me if I'm wrong. |
@lierdakil I checked other provideServices and found that atom-ide-definitions have similar issues. Fixing atom-ide-outline and atom-ide-definitions should fix this issue completely. @aminya |
@ayame113 as far as I can gather, the issue has been fixed upstream a while back. Is it okay to close this PR? |
OK, let's close this PR. Thanks! |
When I enable and then disable this package I get the following error:
This pull request wants to fix this.
Delete the cache of TypescriptEditorPane and TypescriptBuffer at the time of invalidation, to prevent that use the old tsserver at the time of re-enable. (19a483f)
Re-enabling this package will provide "providedServices" again. The old "providedServices" cannot be disabled, so it conflicts with the new one and causes an error. Therefore, raise the "Priority" property of the newer to prevent conflicts. (c631edd)
With the above changes, I think that this is adapted to function as expected.
This is my first contribution to this repository, so please let me know if there are any fixes.