[SR-146] Move the swift indentation mechanism from SourceKit to libIDE and utilize it for a 'swift-format' tool
| Previous ID | SR-146 |
| Radar | None |
| Original Reporter | @akyrtzi |
| Type | New Feature |
| Status | Resolved |
| Resolution | Done |
Additional Detail from JIRA
| Votes | 3 |
| Component/s | Source Tooling |
| Labels | New Feature, StarterBug |
| Assignee | None |
| Priority | Medium |
md5: 9dbc0cc9b44435dff437b44922a6c8dd
is blocked by:
- SR-2188 Xcode closure auto-indentation is hard to read with some styles
Issue Description:
SourceKit contains indentation logic that is not exposed in the libIDE library; this is not desirable because SourceKit is not cross-platform. Here are some steps to improve on this:
-
Move the indentation logic from SourceKit to libIDE. Have SourceKit just expose the functionality contained in libIDE.
-
Start a 'swift-format' tool that uses the indentation mechanism from libIDE; given a file and source range it auto-indents it.
-
See prior work for 'clang-format' (http://clang.llvm.org/docs/ClangFormat.html) for investigation on how to specify and provide formatting options.
Comment by John Regner (JIRA)
Submitted PR-1686 https://github.com/apple/swift/pull/1686 . Which makes progress on this. The PR proposes to move the indentation logic from SourceKit -> libIDE.
(it does not include the creation of the `swift-format` tool)
Comment by Mohammed M. Ennabah (JIRA)
@akyrtzi I think this is merged and should be marked as resolved.
Comment by Eddy Gammon (JIRA)
Done in https://github.com/apple/swift/pull/1686
For posterity: https://github.com/apple/swift-format