-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filters out parameters within parameters
For a function that takes a closure as default value, the array of parameter reported by sourcekit also includes the parameters of that closure. In other words, a function like func foo(param1: Int, param2: Bool, param3: (Int) -> Void = { (x: Int) in }) { } reports 4 parameters (param 1, param2, param3, and x). This commit uses the bounds of the method/function parameters to filter out parameters within parameters. Below, a 1, a 2, and a 3 would be filtered out since they're inside parameter 3. ----------------------------------------------------------------| | |---------| |---------| |----------------------------| | | | param 1 | | param 2 | | param 3: |a 1| |a 2| |a 3| | | | |---------| |---------| |----------------------------| | ----------------------------------------------------------------|
- Loading branch information
1 parent
95b798f
commit a4a1297
Showing
3 changed files
with
74 additions
and
6 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