mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
feat: add swift indents (#4756)
This commit is contained in:
parent
b231afbad1
commit
864b4171de
5 changed files with 210 additions and 0 deletions
51
tests/indent/swift/declarations.swift
Normal file
51
tests/indent/swift/declarations.swift
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
@wrapper
|
||||
@modifier(
|
||||
*
|
||||
)
|
||||
class EquilateralTriangle: NamedShape {
|
||||
var sideLength: Double = 0.0
|
||||
|
||||
@attr
|
||||
init(
|
||||
sideLength: Double,
|
||||
name: String
|
||||
) {
|
||||
self.sideLength = sideLength
|
||||
}
|
||||
|
||||
var perimeter: Double {
|
||||
willSet {
|
||||
}
|
||||
}
|
||||
|
||||
@funcattr
|
||||
override func simpleDescription(a: int, b: int) -> String {
|
||||
return "An equilateral triangle with sides of length \(sideLength)."
|
||||
}
|
||||
}
|
||||
|
||||
@attr
|
||||
protocol ExampleProtocol {
|
||||
var simpleDescription: String { get }
|
||||
mutating func adjust()
|
||||
}
|
||||
|
||||
@available(*)
|
||||
func test() {
|
||||
|
||||
}
|
||||
|
||||
@attr(*)
|
||||
typealias Foo = Bar
|
||||
|
||||
@attr
|
||||
struct Foo<
|
||||
Bar
|
||||
> {
|
||||
@Provider
|
||||
var test = 1
|
||||
|
||||
subscript(index: Int) -> Int {
|
||||
var foo = 2
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue