Skip to content

Commit 3390fcf

Browse files
committed
Enable UseSynthesizedInitializer and remove redundant initializers.
1 parent f4acb89 commit 3390fcf

File tree

6 files changed

+2
-31
lines changed

6 files changed

+2
-31
lines changed

.swift-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"NoBlockComments": false,
1414
"OrderedImports": true,
1515
"UseLetInEveryBoundCaseVariable": false,
16-
"UseSynthesizedInitializer": false
16+
"UseSynthesizedInitializer": true
1717
}
1818
}

Sources/SwiftCompilerPlugin/CompilerPlugin.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ struct CompilerPluginError: Error, CustomStringConvertible {
9696

9797
struct MacroProviderAdapter<Plugin: CompilerPlugin>: PluginProvider {
9898
let plugin: Plugin
99-
init(plugin: Plugin) {
100-
self.plugin = plugin
101-
}
99+
102100
func resolveMacro(moduleName: String, typeName: String) throws -> Macro.Type {
103101
try plugin.resolveMacro(moduleName: moduleName, typeName: typeName)
104102
}

Sources/SwiftCompilerPluginMessageHandling/PluginMessages.swift

-10
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,9 @@ public enum PluginMessage {
208208
public struct Change: Codable {
209209
public var range: PositionRange
210210
public var newText: String
211-
212-
internal init(range: PositionRange, newText: String) {
213-
self.range = range
214-
self.newText = newText
215-
}
216211
}
217212
public var message: String
218213
public var changes: [Change]
219-
220-
internal init(message: String, changes: [Change]) {
221-
self.message = message
222-
self.changes = changes
223-
}
224214
}
225215
public var message: String
226216
public var severity: Severity

Sources/SwiftParser/CharacterInfo.swift

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ extension Character {
1414
fileprivate struct Info: OptionSet {
1515
var rawValue: UInt8
1616

17-
init(rawValue: UInt8) {
18-
self.rawValue = rawValue
19-
}
20-
2117
static let IDENT_START: Self = .init(rawValue: 0x01)
2218
static let IDENT_CONT: Self = .init(rawValue: 0x02)
2319
static let DECIMAL: Self = .init(rawValue: 0x04)

Sources/SwiftParser/Declarations.swift

-5
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,6 @@ extension Parser {
161161
struct DeclAttributes {
162162
var attributes: RawAttributeListSyntax
163163
var modifiers: RawDeclModifierListSyntax
164-
165-
init(attributes: RawAttributeListSyntax, modifiers: RawDeclModifierListSyntax) {
166-
self.attributes = attributes
167-
self.modifiers = modifiers
168-
}
169164
}
170165

171166
/// Parse a declaration.

Sources/SwiftParser/Statements.swift

-8
Original file line numberDiff line numberDiff line change
@@ -816,14 +816,6 @@ extension Parser {
816816
struct StatementLabel {
817817
var label: RawTokenSyntax
818818
var colon: RawTokenSyntax
819-
820-
init(
821-
label: RawTokenSyntax,
822-
colon: RawTokenSyntax
823-
) {
824-
self.label = label
825-
self.colon = colon
826-
}
827819
}
828820

829821
/// Parse an optional label that defines a named control flow point.

0 commit comments

Comments
 (0)