-
Notifications
You must be signed in to change notification settings - Fork 3
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
Context-dependent suggestions #29
Conversation
Merge with MrModder:master
- Models can provide a #completionContext - ECController detects this and sends it to ECContext - in ECContext, search for temporaries is extended to temporaries from context
…in Inspector Closes LeonMatthes#26 and LeonMatthes#17
@LeonMatthes Any news on this? :-) |
I tried to analyze your changes, but I've not been able to figure out what exactly they achieve for the end user. Please provide more information on how to reproduce the introduced behavior and what problems exactly it solves. It seems your first commit adds entries to the Autocompletion for the local variables in the Context. However, at least in the Debugger, these are already provided from parsing the code. The additions of Please understand that I'm no longer an active Squeak user and reviewing complicated pull requests without detailed descriptions takes a lot of effort and keeps me from working on them. |
Sorry for the very late reply, @LeonMatthes, I have myself been much too busy during the latest months ... Sorry for not explaining this PR properly, it is already pretty old. But still works in the latest Trunk image. :-) The changes are visible when you type into the context variable inspector of a debugger: Without this patch, the completion menu is missing any temporary variables from the current stack frame:
This only applies to the main code pane of the debugger, but not to the inspectors at the bottom. |
Alright, I was now able to integrate your changes into the Autocompletion. Instead of passing the context to the ECContext/ECController to handle, I expanded and used the In my opinion, this is a much cleaner approach that also opens up a much easier way to integrate future info provided by the model and requires only 2 new methods. I've added you as a co-author to the commits that feature your code, because of how difficult it is to merge, I'll have to close this PR. But all your changes should be integrated. |
Sounds fine, thank you for integrating these changes! :-) |
(FYIO, today I found two other implementors of |
Okay, thanks for the info. Then one would just have to write: completionAdditionals
^ self doItContext ifNotNil: #completionAdditionals Or however access to the models context works... |
+1 for Nevertheless, here is another argument for moving this burden into Autocompletion: its analogy to the Shout (Syntax Highlighting As yoU Type) styling interface. Already back in 2019 when working on SqueakSheet, I observed that most models needed to implement both interfaces to provide nearly the same information, i.e. all data required for parsing the code in context (class, environment, context, whether there is code at all, etc.). If I were to write a new completion tool (but currently, I am not), I would probably even reuse the information provided by Anyhow, I understand and respect your point of API simplicity from above, so please take the above paragraph as some rather general and perspective thoughts only. :-) |
See commit message for details. This feature completes suggestions in ContextVariableInspector (we also can use it in SqueakSheet).
Accessing the Context in ECContext also provides new opportunities for guessing the type in an interactive context, like suggested in #17.