Skip to content

Make self type required for completion#794

Open
vinistock wants to merge 1 commit into
mainfrom
05-07-fix_self_type_in_class_module_body_completion
Open

Make self type required for completion#794
vinistock wants to merge 1 commit into
mainfrom
05-07-fix_self_type_in_class_module_body_completion

Conversation

@vinistock
Copy link
Copy Markdown
Member

@vinistock vinistock commented May 8, 2026

Completion is based on two things, depending on the scenario:

  1. Either the receiver type or lexical scope
  2. The type of self (which is not always the same as the lexical scope)

We were making the type of self optional before, but the reality is that we always need it. Consider this example:

class Foo
  # completion here

  def bar
    # and completion here
  end
end

In both cases, the lexical scope is the same, but the type of self is different Foo::<Foo> vs Foo. We already provide the tools for consumers to figure out the type of self for these cases, so let's make it required in the API in order to provide correct completion.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock self-assigned this May 8, 2026
@vinistock vinistock added the bugfix A change that fixes an existing bug label May 8, 2026
@vinistock vinistock force-pushed the 05-07-fix_self_type_in_class_module_body_completion branch from fe9881c to 6b4eda7 Compare May 8, 2026 13:26
@vinistock vinistock marked this pull request as ready for review May 8, 2026 13:26
@vinistock vinistock requested a review from a team as a code owner May 8, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes an existing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants