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

Exclude invalid selectors #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LinqLover
Copy link
Contributor

No more 'Preferences>>defaultAnnotationRequests' or '*Etoys-examples' as completion selectors!

NB: Maybe ECSymbols should be renamed to ECSelectors? Or not worth the effort? :)

No more 'Preferences>>defaultAnnotationRequests' or '*Etoys-examples' as completion selectors!
@LinqLover
Copy link
Contributor Author

Alternatively, we could even restrict the list to selectors that are actually implemented anywhere. Would this be of interest?

Would be more expensive, though. SystemNavigation>>#allImplementedMessages takes about 40 milliseconds in my image. We could try to cache this per invocation of Autocompletion (1 fps drop per Cmd+Space) or maintain a global cache and update it incrementally via SystemChangeNotifier (more complex to implement). Wdyt? :)

@LeonMatthes
Copy link
Owner

The idea behind including all selectors when we don't know the receiver is two-fold:

  1. We don't know the receiver type, so it could be any message
  2. There is no receiver, you may want to create a new receiver (e.g. all classes, pool variables, etc.).

It is for that second reason, that we want to include all selectors, as there is currently no mechanism that can select all relevant selectors that may work as a new receiver.

Imagine you're in a Browser in CogThreadManager and type: CTMW.
We should probably recommend CTMWantingOwnership from the VMThreadingConstants pool dictionary, though that would unfortunately now be filtered out.

So this PR would definitely improve the first use-case, but hurt the second.

If we want to merge this PR, we need to also improve initializeGlobalsSelectors, as that doesn't currently include things like Pool Dictionaries, class variables, member variables, etc.

Then combined with this change, we could indeed greatly improve performance and accuracy for the untyped case 😊

But as of now, I'd rather err on the side of recommending too much, instead of missing crucial selectors.
Especially if users explore their available API using Autocompletion, this may leave them hanging.

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