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

Fix suggest contracts race #544

Merged
merged 2 commits into from
May 23, 2021

Conversation

lukaszsamson
Copy link
Collaborator

Code lens request is handled asynchronously. If the file is closed and close notification handle_info executes before suggest_contracts handle_call the previous code added an entry to awaiting_contracts. That entry used URI of a closed file that would later lead to crash when handling analysis_ready
Fixes elixir-lsp/vscode-elixir-ls#186

Code lens request is handled asynchronously. If the file is closed and close notification handle_info executes before suggest_contracts handle_call the previous code added an entry to awaiting_contracts. That entry used URI of a closed file that would later lead to crash when handling analysis_ready
Fixes elixir-lsp/vscode-elixir-ls#186
@lukaszsamson lukaszsamson requested a review from axelson May 22, 2021 22:08
@axelson
Copy link
Member

axelson commented May 22, 2021

Any ideas on the failing tests? It's rather hard to read the output because the assertion is so large.

@pedro-lb
Copy link

pedro-lb commented May 22, 2021

@axelson here's a diff between the expected result and what the test got for this run:

image

There are other tests failing too, but they're mostly the same error - we're expecting %Protocol.SymbolInformation{} but encountering %ElixirLS.LanguageServer.Protocol.SymbolInformation{}

@lukaszsamson lukaszsamson changed the title Ls fix suggest contracts race Fix suggest contracts race May 23, 2021
@lukaszsamson
Copy link
Collaborator Author

@axelson the culprit is #537 - Macro.to_string behaviour must have changet between 1.9 and 1.10.

@pedro-lb thanks for investigation. Aliases are not the problem here though.

Anyway, it's not related to this PR and I'm going to fix it on master

Copy link
Member

@axelson axelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that sounds good 👍

❤️

@axelson axelson merged commit 1205f31 into elixir-lsp:master May 23, 2021
vanjabucic pushed a commit to vanjabucic/elixir-ls that referenced this pull request Jul 5, 2021
* use get_source_file

* fix race condition in suggest specs

Code lens request is handled asynchronously. If the file is closed and close notification handle_info executes before suggest_contracts handle_call the previous code added an entry to awaiting_contracts. That entry used URI of a closed file that would later lead to crash when handling analysis_ready
Fixes elixir-lsp/vscode-elixir-ls#186
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.

[Crash] function nil.dirty?/0 is undefined
3 participants