-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(swift) - correct class func/var declaration highighting (#4154)
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<span class="hljs-keyword">class</span> <span class="hljs-keyword">func</span> <span class="hljs-title function_">f1</span>() -> <span class="hljs-type">Void</span> { } | ||
|
||
<span class="hljs-keyword">class</span> <span class="hljs-keyword">func</span> <span class="hljs-title function_">f2</span><span class="hljs-operator"><</span><span class="hljs-type">T</span>: <span class="hljs-type">Comparable</span><span class="hljs-operator">></span>() -> <span class="hljs-type">T</span> { } | ||
|
||
<span class="hljs-keyword">class</span> <span class="hljs-keyword">func</span> <span class="hljs-title function_">f3</span><span class="hljs-operator"><</span><span class="hljs-type">T</span><span class="hljs-operator">></span>( | ||
<span class="hljs-keyword">_</span> p1: <span class="hljs-type">Int</span>, | ||
p2: <span class="hljs-type">String</span> | ||
) <span class="hljs-keyword">async</span> <span class="hljs-keyword">throws</span> -> [<span class="hljs-type">T</span>] { } | ||
|
||
<span class="hljs-keyword">class</span> <span class="hljs-keyword">var</span> v1: <span class="hljs-type">Int</span> { <span class="hljs-keyword">get</span> <span class="hljs-keyword">set</span> } | ||
|
||
<span class="hljs-keyword">class</span> <span class="hljs-keyword">var</span> v2: <span class="hljs-type">String</span> { | ||
<span class="hljs-keyword">get</span> { <span class="hljs-keyword">return</span> <span class="hljs-string">"test"</span> } | ||
<span class="hljs-keyword">set</span> { } | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class func f1() -> Void { } | ||
|
||
class func f2<T: Comparable>() -> T { } | ||
|
||
class func f3<T>( | ||
_ p1: Int, | ||
p2: String | ||
) async throws -> [T] { } | ||
|
||
class var v1: Int { get set } | ||
|
||
class var v2: String { | ||
get { return "test" } | ||
set { } | ||
} |