Skip to content
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

DocumentSymbols provider handles compilation errors gracefully #186

Merged
merged 1 commit into from
Apr 7, 2020
Merged

DocumentSymbols provider handles compilation errors gracefully #186

merged 1 commit into from
Apr 7, 2020

Conversation

axelson
Copy link
Member

@axelson axelson commented Apr 6, 2020

Rather than throwing an exception (which causes the spawned process to crash) the DocumentSymbols provider will now simply return an error.

This is beneficial because this is very much an expected error and thus it is confusing to show the exception in the logs. Possibly there are also performance benefits to this as well.

Ideally the DocumentSymbols provider could still return valid symbols in this case, but that is currently infeasible.

Rather than throwing an exception (which causes the spawned process to crash)
the DocumentSymbols provider will now simply return an error.

This is beneficial because this is very much an expected error and thus it is
confusing to show the exception in the logs. Possibly there are also performance
benefits to this as well.

Ideally the DocumentSymbols provider could still return valid symbols in this
case, but that is currently infeasible.
@lukaszsamson
Copy link
Collaborator

Ideally the DocumentSymbols provider could still return valid symbols in this case, but that is currently infeasible.

The easiest way of making it more error tolerant is by using elixir_sense Parser (elixir-lsp/elixir_sense#87). We'd need to refactor it though to separate parsing from metadata building.

@axelson
Copy link
Member Author

axelson commented Apr 6, 2020

Ah, I forgot about that issue. I agree that would be a good improvement. Tracking in #187

@axelson axelson merged commit b3f00a5 into elixir-lsp:master Apr 7, 2020
@axelson axelson deleted the document-symbol-handle-compilation-errors branch April 7, 2020 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants