A projection suggestion is an item in a suggestion menu like a normal suggestion but will insert a substitution when chosen for completion. With this patch, projections appear with a small preview in the suggestions menu that should make the choice more intuitive for users.
Besides, on the class-side protocol of st substitutions, #instanceSuggestion is extracted which answers a factory block for a new instance, making it easier for subclasses to provide their suggestions.
Suggestions are added to the substitutions memoize, point, language box, regex, and toggled code.
´
Open issues (ideally to be addressed while/before merging this):
[ ] Previewed blocks are not styled correctly (note that I replaced them by an #imageForm as a simple way of locking them with all their submorphs against any kind of event handling - is there a better way to do this?)
Ideas for later:
Union the knowledge bases from instanceSuggestions and palettes
Provide these suggestions without using the explicit protocol from the substitutions classes. For instance, String >> #asRegex could also be completed with the regex substitution, or Color >> #red/#green/#r:g:b:/whatever else could be completed with a color substitution. As a general, is there already an "automatic substitution" mode? :)
A projection suggestion is an item in a suggestion menu like a normal suggestion but will insert a substitution when chosen for completion. With this patch, projections appear with a small preview in the suggestions menu that should make the choice more intuitive for users.
Besides, on the class-side protocol of st substitutions,
#instanceSuggestion
is extracted which answers a factory block for a new instance, making it easier for subclasses to provide their suggestions.Suggestions are added to the substitutions memoize, point, language box, regex, and toggled code.
´
Open issues (ideally to be addressed while/before merging this):
#imageForm
as a simple way of locking them with all their submorphs against any kind of event handling - is there a better way to do this?)Ideas for later:
instanceSuggestion
s and palettesString >> #asRegex
could also be completed with the regex substitution, orColor >> #red/#green/#r:g:b:
/whatever else could be completed with a color substitution. As a general, is there already an "automatic substitution" mode? :)