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

Wrong receiver for Inspectors #26

Closed
LinqLover opened this issue Jul 20, 2019 · 3 comments
Closed

Wrong receiver for Inspectors #26

LinqLover opened this issue Jul 20, 2019 · 3 comments

Comments

@LinqLover
Copy link
Contributor

Scenario:

  • Preference "include all selectors" is disabled
  • Open an inspector, e. g. on a Morph
  • Start typing into the right pane
  • If you select no instvar, the Autocompletion will suggest e. g. bounds correctly
  • But if you select any instvar (for example bounds), bounds will not be suggested -- but instead, origin and corner
  • But you can only evaluate bounds, not origin

Reason:

  • ECController asks the model for #selectedClassOrMetaClass
  • Default implementation of this is #selectedClass
  • Inspector>>#selectedClass returns the class of the current selected instvar
  • In this case, the selection does not affect the code that can be evaluated

Questions and solution approaches:

  • I am wondering whether the only purpose of #selectedClassOrMetaClass is to be used by Autocompletion? At least, it is in the Autocompletion category, but the on the other hand it has many other senders in Browser, Debugger, pp. In general, what differentiates #selectedClassOrMetaClass from #selectedClass? Are there historical reasons?
  • For what purpose does Inspector>>#selectedClass return the class of the selected instvar instead of object class?
  • If we could freely dispose of #selectedClassOrMetaClass, the solution would be to override it in Inspector to return object class.
  • Otherwise, we would probably need another selector?
@LeonMatthes
Copy link
Owner

This is a known bug, thanks for filing the issue.

I'm actually not sure myself where selectedClassOrMetaClass comes from orginally.
But overriding it in the Inspector seems to be the best option to solving this issue.

@LinqLover
Copy link
Contributor Author

Do you think this method should be overridden in the #'*Autocompletion' category or directly into the Inbox?

LinqLover added a commit to LinqLover/Autocompletion that referenced this issue Jul 21, 2019
@LeonMatthes
Copy link
Owner

Fixed in #29

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

No branches or pull requests

2 participants