Send Diagnostic information on InitializationError #649
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.
I noticed that if one of my files had an error that caused an error on initialization (say including a file that doesn't exist). Then the whole language server would crash. I also noticed that the IDE didn't show where the issue was located. I had to look into the "Output" tab and go through the large error logs and backtrace.
I made the changes included in this MR to the
ruby-lsp-rails
gem directly on my system, and it enabled me to see the problem right in the "Problems" tab, and it underlined the problem line directly in the editor.I'm guessing this code isn't structured as the project might want, but I figured this would demonstrate the issue being encountered and provide a jumping off point where maybe the maintainers could make a better version.