Format using swift-format

Add `.swift-format` to the repo and format the repo with `swift-format`.

This commit does not add any automation to enforce formatting of sourcekit-lsp in CI. The goal of this commit is to get the majority of source changes out of the way so that the diff of actually enforcing formatting will have fewer changes or conflicts.
This commit is contained in:
Alex Hoppen
2023-10-10 13:44:10 -07:00
parent 2fb2e3a917
commit d0fc00ce98
180 changed files with 9575 additions and 6355 deletions

View File

@@ -11,14 +11,14 @@
//===----------------------------------------------------------------------===//
import BuildServerProtocol
import LanguageServerProtocol
import LSPLogging
import SKSupport
import Dispatch
import struct Foundation.URL
import LSPLogging
import LanguageServerProtocol
import SKSupport
import protocol TSCBasic.FileSystem
import struct Foundation.URL
import struct TSCBasic.AbsolutePath
import protocol TSCBasic.FileSystem
import var TSCBasic.localFileSystem
/// A `BuildSystem` based on loading clang-compatible compilation database(s).
@@ -61,7 +61,7 @@ public actor CompilationDatabaseBuildSystem {
let args = command.commandLine
for i in args.indices.reversed() {
if args[i] == "-index-store-path" && i != args.endIndex - 1 {
_indexStorePath = try? AbsolutePath(validating: args[i+1])
_indexStorePath = try? AbsolutePath(validating: args[i + 1])
return _indexStorePath
}
}
@@ -93,10 +93,12 @@ extension CompilationDatabaseBuildSystem: BuildSystem {
return nil
}
guard let db = database(for: url),
let cmd = db[url].first else { return nil }
let cmd = db[url].first
else { return nil }
return FileBuildSettings(
compilerArguments: Array(cmd.commandLine.dropFirst()),
workingDirectory: cmd.directory)
workingDirectory: cmd.directory
)
}
public func registerForChangeNotifications(for uri: DocumentURI, language: Language) async {