forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Omit needless words: don't prune "properties" of the context from the…
… base name. The properties of a context indicate those things that are considered "contained within" the context (among other things). This helps us avoid producing overly-generic names when we identify a redundancy in the base name. For example, NSView contains the following: var gestureRecognizers: [NSGestureRecognizer] func addGestureRecognizer(gestureRecognizer: NSGestureRecognizer) func removeGestureRecognizer(gestureRecognizer: NSGestureRecognizer) Normally, omit-needless-words would prune the two method names down to "add" and "remove", respectively, because they restate type information. However, this pruning is not ideal, because a view isn't primarily a collection of gesture recognizers. Use the presence of the property "gestureRecognizers" to indicate that we should not strip "gestureRecognizer" or "gestureRecognizers" from the base names of methods within that class (or its subclasses). Note that there is more work to do here to properly deal with API evolution: a newly-added property shouldn't have any effect on existing APIs. We should use availability information here, and only consider properties introduced no later than the entity under consideration.
- Loading branch information
1 parent
9491ec4
commit 106bf80
Showing
9 changed files
with
274 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.