Skip to content

Commit

Permalink
Enable UseSynthesizedInitializer and remove redundant initializers.
Browse files Browse the repository at this point in the history
  • Loading branch information
allevato committed Oct 2, 2024
1 parent f4acb89 commit 3390fcf
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .swift-format
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"NoBlockComments": false,
"OrderedImports": true,
"UseLetInEveryBoundCaseVariable": false,
"UseSynthesizedInitializer": false
"UseSynthesizedInitializer": true
}
}
4 changes: 1 addition & 3 deletions Sources/SwiftCompilerPlugin/CompilerPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ struct CompilerPluginError: Error, CustomStringConvertible {

struct MacroProviderAdapter<Plugin: CompilerPlugin>: PluginProvider {
let plugin: Plugin
init(plugin: Plugin) {
self.plugin = plugin
}

func resolveMacro(moduleName: String, typeName: String) throws -> Macro.Type {
try plugin.resolveMacro(moduleName: moduleName, typeName: typeName)
}
Expand Down
10 changes: 0 additions & 10 deletions Sources/SwiftCompilerPluginMessageHandling/PluginMessages.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,9 @@ public enum PluginMessage {
public struct Change: Codable {
public var range: PositionRange
public var newText: String

internal init(range: PositionRange, newText: String) {
self.range = range
self.newText = newText
}
}
public var message: String
public var changes: [Change]

internal init(message: String, changes: [Change]) {
self.message = message
self.changes = changes
}
}
public var message: String
public var severity: Severity
Expand Down
4 changes: 0 additions & 4 deletions Sources/SwiftParser/CharacterInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ extension Character {
fileprivate struct Info: OptionSet {
var rawValue: UInt8

init(rawValue: UInt8) {
self.rawValue = rawValue
}

static let IDENT_START: Self = .init(rawValue: 0x01)
static let IDENT_CONT: Self = .init(rawValue: 0x02)
static let DECIMAL: Self = .init(rawValue: 0x04)
Expand Down
5 changes: 0 additions & 5 deletions Sources/SwiftParser/Declarations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ extension Parser {
struct DeclAttributes {
var attributes: RawAttributeListSyntax
var modifiers: RawDeclModifierListSyntax

init(attributes: RawAttributeListSyntax, modifiers: RawDeclModifierListSyntax) {
self.attributes = attributes
self.modifiers = modifiers
}
}

/// Parse a declaration.
Expand Down
8 changes: 0 additions & 8 deletions Sources/SwiftParser/Statements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,6 @@ extension Parser {
struct StatementLabel {
var label: RawTokenSyntax
var colon: RawTokenSyntax

init(
label: RawTokenSyntax,
colon: RawTokenSyntax
) {
self.label = label
self.colon = colon
}
}

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

0 comments on commit 3390fcf

Please sign in to comment.