Skip to content

Commit 030b1b8

Browse files
committed
Update documentations and wordings
1 parent d59cae7 commit 030b1b8

File tree

8 files changed

+965
-62
lines changed

8 files changed

+965
-62
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repository. Follow the guidelines below to make sure everything goes smoothly.
3939
- Follow the coding conventions already in use
4040
- Verify Emacs Lisp code with `checkdoc`
4141
- Add unit tests whenever possible
42-
- Run `make check` and ensure no errors other than known-bugs.
42+
- Run `make test` and ensure no errors other than known-bugs.
4343
- Open a [pull request](https://help.github.com/articles/using-pull-requests)
4444
relating to a single issue.
4545

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Major-mode for Apple's [Swift programming language](https://developer.apple.com/
1111

1212
Install `swift-mode` package from MELPA.
1313

14-
To install without MELPA, download [latest release](https://github.com/swift-emacs/swift-mode/releases) and execute `M-x package-install-file`.
14+
To install without MELPA, download [latest release](https://github.com/swift-emacs/swift-mode/releases) and execute `M-x package-install-file` for the .tar archive.
1515

1616
## Features
1717

@@ -91,19 +91,19 @@ Some syntax constructs removed from Swift 3.0 are not supported:
9191
}
9292
```
9393

94-
Indentation may not accurate. For example, `foo(Bar < A, B > (c))` is indented like either
94+
Indentation may not accurate. For example, `foo(Bar < A, B > (c))` can be indented like either
9595
```swift
9696
foo(Bar < A,
9797
B > (c)) // Passing two Boolean arguments to foo
9898
```
9999
or
100100
```swift
101101
foo(Bar < A,
102-
B > (c)) // constructing Bar with two type arguments and a value
102+
B > (c)) // Passing a new Bar with two type arguments and a value
103103
```
104104
The Swift compiler disambiguates this case using tokens after `>`, but those tokens may not available at editing time. We use some heuristic for this.
105105

106-
Another example is difficulty of handling of colons. We have to pair all `?` and `:` of conditional operators to decide indentation. This is a future work.
106+
Another example is difficulty of handling of colons. We have to pair all `?` and `:` of conditional operators to decide indentation of the below snippet. This is a future work.
107107

108108
```swift
109109
switch foo {
@@ -128,7 +128,7 @@ var x = foo
128128
}
129129
```
130130

131-
while we also want to indent if body like this:
131+
while we also want to indent the body of `if` like this:
132132

133133
```swift
134134
if anotherVeryLongVariableName
@@ -137,7 +137,9 @@ if anotherVeryLongVariableName
137137
}
138138
```
139139

140-
Then, how should we indent this when the cursor is before `@`?
140+
That is, we have to indent the closing brace with offset if it is a part of expressions while it should be aligned with the beginning of the statement/declaration if it is a part of a statement/declaration.
141+
142+
Then, how should we indent the following code when the cursor is before `@`?
141143

142144
```swift
143145
var x = foo
@@ -153,6 +155,7 @@ var x = foo
153155
aaa
154156
}
155157
}
158+
// property declaration
156159
```
157160
or
158161
```swift
@@ -161,6 +164,7 @@ var x = foo
161164
@abc var x = 1
162165
x
163166
}
167+
// property initialization
164168
```
165169

166170
Both are syntactically correct code. We cannot handle this case properly. This is also a future work.
@@ -177,9 +181,9 @@ For other commands, run `make help`.
177181

178182
## Related projects
179183

180-
- [Official swift-mode.el by Apple](https://github.com/apple/swift/blob/master/utils/swift-mode.el) Seems still in very early stage for now. We cannot contribute to it due to the license incompatibility.
181-
- [company-sourcekit](https://github.com/nathankot/company-sourcekit) Completion for Swift projects via SourceKit with the help of SourceKitten.
182-
- [flycheck-swift](https://github.com/swift-emacs/flycheck-swift) Flycheck extensions for Swift.
184+
- [Official swift-mode.el by Apple](https://github.com/apple/swift/blob/master/utils/swift-mode.el): Seems still in very early stage for now. We cannot contribute to it due to the license incompatibility.
185+
- [company-sourcekit](https://github.com/nathankot/company-sourcekit): Completion for Swift projects via SourceKit with the help of SourceKitten.
186+
- [flycheck-swift](https://github.com/swift-emacs/flycheck-swift): Flycheck extensions for Swift.
183187

184188
## Contributing
185189

doc/string.png

18.8 KB
Loading

doc/string.svg

Lines changed: 237 additions & 0 deletions
Loading

doc/string_properties.png

39.1 KB
Loading

0 commit comments

Comments
 (0)