fix "Error rewriting command" warning triggered on startup #2277
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.
Fixes
Error rewriting command lsp_recheck_sessions. Encountered infinite loop
warning on startup.The warning is a bit misleading. It triggers not due to an infinite loop but due to triggering a window command directly from
plugin_loaded
. Basically means that triggering this command on startup had no effect but that's fine because at that point there is no sessions yet so it wouldn't really do anything anyway.This PR removes the
LspRecheckSessionsCommand
command in favor of a more explicit notification triggered from theWindowConfigManager
to theWindowManager
to let it know that sessions should be restarted (the approach with usingLspRecheckSessionsCommand
was just a hack around the fact thatWindowConfigManager
did not have access toWindowManager
).Also note that I've changed
WindowConfigManager
to not trigger sessions restart on__init__
since it's unnecessary since there are no sessions yet. That's why most of theupdate()
code was moved to_reload_configs()
and called on init.