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

Suggestion improvements (2) #111

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

LinqLover
Copy link
Collaborator

@LinqLover LinqLover commented Mar 4, 2022

This PR proposes further improvements, new hooks, and some fixes to the suggestions infrastructure. Depends on (and includes) #108.

st/core: dispatch gathering of completion suggestions to containingArtefact for specialization (ab393e3)

For instance, sonyx overrides some of these new 'artefactCompletion' hooks in order to minimize the selector list, add custom selectors, or insert instances from a subclass of SBSuggestionItem.

image image

Video (🔊):

sonyxSoundSuggestions.mp4

Open issues on this change:

  • Test thoroughly. There might be use cases of the suggestions I am not aware of and thus might have broken. Especially, please check the experience for ordering and availability of suggestions depending on their length vs. typographic distance (fuzzy matching) vs. semantic distance (type guessing).
  • Maybe we should even have real acceptance tests for this to make sure that all relevant use cases are covered?
  • Discuss the right place for the dispatching hooks. Currently, the collection of completions and suggestions is delegated to the containingArtefact, making it possible for other projects (like sonyx) to subclass SBStContainer. However, this is not necessarily the single truth. Maybe alternatively/additionally dispatch the creation via the editor, the grammar handler, or a completely new entity?

st/core: provide hook Class>>#sandblocksMetaSuggestionsFor: (5f84560)

For instance, you could override the hook like this on Color to prioritize color names:

sandblocksMetaSuggestionsFor: aBlock
	
	^ self colorNames, (super sandblocksMetaSuggestionsFor: aBlock)

Sonyx makes use of this hook, too.

misc

- SBStNameBehavior>>suggestions: Do not distinguish between syntactical casing (lowercase/uppercase) of the suggestions but rather between their origin (local/global), since class vars are actually scoped locally
- new sibling class SBStDeclarationForClassVariable of SBStDeclarationForInstanceVariable with common features extracted into new superclass SBStDeclarationForBehaviorVariable
- improved type guessing for class variables and instance variables of singleton (class objects)
…tefact for specialization

For instance, sonyx overrides somes of the 'artefactCompletion' hooks in order to minimize the selector list, add custom selectors, or insert instances from a subclass of SBSuggestionItem.
For instance, you could override the hook like this on Color to prioritize color names:

	sandblocksMetaSuggestionsFor: aBlock
		
		^ self colorNames, (super sandblocksMetaSuggestionsFor: aBlock)

Sonyx makes use of this hook, too.
@coveralls
Copy link

coveralls commented Mar 4, 2022

Pull Request Test Coverage Report for Build 1936438058

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 0.0%

Totals Coverage Status
Change from base Build 1922503786: 0.0%
Covered Lines: 0
Relevant Lines: 0

💛 - Coveralls

@LinqLover LinqLover changed the title Suggestions 2 Suggestion improvements (2) Mar 4, 2022
LinqLover added a commit to LinqLover/sonyx that referenced this pull request Mar 5, 2022
- Only suggest class names of sonyx sound classes + disable projections
- For arbitrary message sends, suggest #from:to: and #from:to:into:to:

Depends on hpi-swa/sandblocks#111.
LinqLover added a commit to LinqLover/sonyx that referenced this pull request Mar 5, 2022
This PR improves the suggestions convenience based on user feedback:

* Customize sandblocks completion suggestions (fcb6c29)
  
  * Only suggest class names of sonyx sound classes + disable projections
  * For arbitrary message sends, suggest #from:to: and #from:to:into:to:
  
  Depends on hpi-swa/sandblocks#111.

* Add sounding suggestions (35a710e)

  * visual indication to distinguish between earcons and audicons
  * press and hold shift in the suggestions menu to prehear each squeakSound
@LinqLover LinqLover marked this pull request as ready for review March 5, 2022 14:30
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.

None yet

2 participants