Make code_reload act regardless of diagnostics #1423
Merged
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.
Description
See #1409 for background. Given that hot-reloading from an editor is a development feature it should not matter if there are diagnostic errors while iterating.
The reason I moved the code out from
els_compiler_diagnostics
is that it seemed a bit misplaced in there and looking at commit history it looks like code reload was added before theels_diagnostics
behavior existed, and it was just insideels_text_synchronization_provider
. If it is to be detached from diagnostics results it seems there is little reason to keep it inels_compiler_diagnostics
.Fixes #1409
Extras
Stop trying to compile and reload files that are not ".erl" files. It doesn't work and just gives popup spam.
Testing
The moved test cases work fine. I also manually tested that code reloading still works.
Notes
If the remote node has a cookie it is not possible to configure code reload to work with it. Perhaps the "code_reload" section in the config file needs to get a "cookie" attribute (but for a future PR I guess).