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

Do not crash when completion request context is missing #370

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

OlegSmelov
Copy link
Contributor

Sublime LSP plugin doesn't send the context when doing a textDocument/completion request:

:: --> ruby textDocument/completion(7): {'position': {'line': 10, 'character': 21}, 'textDocument': {'uri': 'file://[redacted]/app.rb'}}

This causes Steep to crash with NoMethodError (undefined method '[]' for nil:NilClass).

I'm not sure if this is a violation of the protocol, but it looks like trigger isn't used for anything important in Steep, so let's handle it gracefully.

Copy link
Owner

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Thanks! The change totally makes sense.

  • context is an optional parameter, and Steep should handle the case.
  • trigger is not used at all.

@soutaro soutaro merged commit fa82ed9 into soutaro:master Apr 21, 2021
@OlegSmelov OlegSmelov deleted the fix/trigger_character_missing branch April 21, 2021 15:08
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