Update SwiftSyntax to 509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-06-05-a (#5058)
Diff: https://github.com/apple/swift-syntax/compare/509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-05-02-a...509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-06-05-a
This commit is contained in:
parent
7462187191
commit
e5cf99088b
|
@ -41,8 +41,8 @@
|
||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/apple/swift-syntax.git",
|
"location" : "https://github.com/apple/swift-syntax.git",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "27cd6190ce0628847a3f8050794d6e627ad79c08",
|
"revision" : "165fc6d22394c1168ff76ab5d951245971ef07e5",
|
||||||
"version" : "509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-05-02-a"
|
"version" : "509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-06-05-a"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ let package = Package(
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.2.1")),
|
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "1.2.1")),
|
||||||
.package(url: "https://github.com/apple/swift-syntax.git", exact: "509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-05-02-a"),
|
.package(url: "https://github.com/apple/swift-syntax.git", exact: "509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-06-05-a"),
|
||||||
.package(url: "https://github.com/jpsim/SourceKitten.git", .upToNextMinor(from: "0.34.1")),
|
.package(url: "https://github.com/jpsim/SourceKitten.git", .upToNextMinor(from: "0.34.1")),
|
||||||
.package(url: "https://github.com/jpsim/Yams.git", from: "5.0.5"),
|
.package(url: "https://github.com/jpsim/Yams.git", from: "5.0.5"),
|
||||||
.package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", from: "0.9.0"),
|
.package(url: "https://github.com/scottrhoyt/SwiftyTextTable.git", from: "0.9.0"),
|
||||||
|
|
|
@ -48,12 +48,7 @@ private extension AnonymousArgumentInMultilineClosureRule {
|
||||||
override func visit(_ node: ClosureExprSyntax) -> SyntaxVisitorContinueKind {
|
override func visit(_ node: ClosureExprSyntax) -> SyntaxVisitorContinueKind {
|
||||||
let startLocation = locationConverter.location(for: node.leftBrace.positionAfterSkippingLeadingTrivia)
|
let startLocation = locationConverter.location(for: node.leftBrace.positionAfterSkippingLeadingTrivia)
|
||||||
let endLocation = locationConverter.location(for: node.rightBrace.endPositionBeforeTrailingTrivia)
|
let endLocation = locationConverter.location(for: node.rightBrace.endPositionBeforeTrailingTrivia)
|
||||||
|
return startLocation.line == endLocation.line ? .skipChildren : .visitChildren
|
||||||
guard let startLine = startLocation.line, let endLine = endLocation.line, startLine != endLine else {
|
|
||||||
return .skipChildren
|
|
||||||
}
|
|
||||||
|
|
||||||
return .visitChildren
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func visitPost(_ node: IdentifierExprSyntax) {
|
override func visitPost(_ node: IdentifierExprSyntax) {
|
||||||
|
|
|
@ -109,20 +109,16 @@ private extension ClosureParameterPositionRule {
|
||||||
}
|
}
|
||||||
|
|
||||||
override func visitPost(_ node: ClosureExprSyntax) {
|
override func visitPost(_ node: ClosureExprSyntax) {
|
||||||
guard let signature = node.signature,
|
guard let signature = node.signature else {
|
||||||
case let leftBracePosition = node.leftBrace.positionAfterSkippingLeadingTrivia,
|
|
||||||
let startLine = locationConverter.location(for: leftBracePosition).line else {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let localViolations = signature.positionsToCheck
|
let leftBracePosition = node.leftBrace.positionAfterSkippingLeadingTrivia
|
||||||
.filter { position in
|
let startLine = locationConverter.location(for: leftBracePosition).line
|
||||||
guard let line = locationConverter.location(for: position).line else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return line != startLine
|
let localViolations = signature.positionsToCheck.filter { position in
|
||||||
}
|
return locationConverter.location(for: position).line != startLine
|
||||||
|
}
|
||||||
|
|
||||||
violations.append(contentsOf: localViolations)
|
violations.append(contentsOf: localViolations)
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,8 +153,8 @@ private extension ClosureExprSyntax {
|
||||||
func shouldCheckForClosureSpacingRule(locationConverter: SourceLocationConverter) -> Bool {
|
func shouldCheckForClosureSpacingRule(locationConverter: SourceLocationConverter) -> Bool {
|
||||||
guard parent?.is(PostfixUnaryExprSyntax.self) == false, // Workaround for Regex literals
|
guard parent?.is(PostfixUnaryExprSyntax.self) == false, // Workaround for Regex literals
|
||||||
(rightBrace.position.utf8Offset - leftBrace.position.utf8Offset) > 1, // Allow '{}'
|
(rightBrace.position.utf8Offset - leftBrace.position.utf8Offset) > 1, // Allow '{}'
|
||||||
let startLine = startLocation(converter: locationConverter).line,
|
case let startLine = startLocation(converter: locationConverter).line,
|
||||||
let endLine = endLocation(converter: locationConverter).line,
|
case let endLine = endLocation(converter: locationConverter).line,
|
||||||
startLine == endLine // Only check single-line closures
|
startLine == endLine // Only check single-line closures
|
||||||
else {
|
else {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -55,12 +55,11 @@ private extension CollectionAlignmentRule {
|
||||||
return zip(remainingKeyLocations.indices, remainingKeyLocations)
|
return zip(remainingKeyLocations.indices, remainingKeyLocations)
|
||||||
.compactMap { index, location -> AbsolutePosition? in
|
.compactMap { index, location -> AbsolutePosition? in
|
||||||
let previousLocation = keyLocations[index - 1]
|
let previousLocation = keyLocations[index - 1]
|
||||||
guard let previousLine = previousLocation.line,
|
let previousLine = previousLocation.line
|
||||||
let locationLine = location.line,
|
let locationLine = location.line
|
||||||
let firstKeyColumn = firstKeyLocation.column,
|
let firstKeyColumn = firstKeyLocation.column
|
||||||
let locationColumn = location.column,
|
let locationColumn = location.column
|
||||||
previousLine < locationLine,
|
guard previousLine < locationLine, firstKeyColumn != locationColumn else {
|
||||||
firstKeyColumn != locationColumn else {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,12 +37,12 @@ private extension MultilineArgumentsRule {
|
||||||
}
|
}
|
||||||
|
|
||||||
override func visitPost(_ node: FunctionCallExprSyntax) {
|
override func visitPost(_ node: FunctionCallExprSyntax) {
|
||||||
guard node.argumentList.count > 1,
|
guard node.argumentList.count > 1 else {
|
||||||
case let functionCallPosition = node.calledExpression.positionAfterSkippingLeadingTrivia,
|
|
||||||
let functionCallLine = locationConverter.location(for: functionCallPosition).line else {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let functionCallPosition = node.calledExpression.positionAfterSkippingLeadingTrivia
|
||||||
|
let functionCallLine = locationConverter.location(for: functionCallPosition).line
|
||||||
let wrappedArguments: [Argument] = node.argumentList
|
let wrappedArguments: [Argument] = node.argumentList
|
||||||
.enumerated()
|
.enumerated()
|
||||||
.compactMap { idx, argument in
|
.compactMap { idx, argument in
|
||||||
|
@ -116,13 +116,8 @@ private struct Argument {
|
||||||
let expression: ExprSyntax
|
let expression: ExprSyntax
|
||||||
|
|
||||||
init?(element: TupleExprElementSyntax, locationConverter: SourceLocationConverter, index: Int) {
|
init?(element: TupleExprElementSyntax, locationConverter: SourceLocationConverter, index: Int) {
|
||||||
let offset = element.positionAfterSkippingLeadingTrivia
|
self.offset = element.positionAfterSkippingLeadingTrivia
|
||||||
guard let line = locationConverter.location(for: offset).line else {
|
self.line = locationConverter.location(for: offset).line
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
self.offset = offset
|
|
||||||
self.line = line
|
|
||||||
self.index = index
|
self.index = index
|
||||||
self.expression = element.expression
|
self.expression = element.expression
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,7 @@ private extension MultilineParametersRule {
|
||||||
var linesWithParameters = Set<Int>()
|
var linesWithParameters = Set<Int>()
|
||||||
|
|
||||||
for position in parameterPositions {
|
for position in parameterPositions {
|
||||||
guard let line = locationConverter.location(for: position).line else {
|
let line = locationConverter.location(for: position).line
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
linesWithParameters.insert(line)
|
linesWithParameters.insert(line)
|
||||||
numberOfParameters += 1
|
numberOfParameters += 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,20 +56,18 @@ extension SwitchCaseAlignmentRule {
|
||||||
|
|
||||||
override func visitPost(_ node: SwitchExprSyntax) {
|
override func visitPost(_ node: SwitchExprSyntax) {
|
||||||
let switchPosition = node.switchKeyword.positionAfterSkippingLeadingTrivia
|
let switchPosition = node.switchKeyword.positionAfterSkippingLeadingTrivia
|
||||||
guard
|
let switchColumn = locationConverter.location(for: switchPosition).column
|
||||||
let switchColumn = locationConverter.location(for: switchPosition).column,
|
guard node.cases.isNotEmpty,
|
||||||
node.cases.isNotEmpty,
|
let firstCasePosition = node.cases.first?.positionAfterSkippingLeadingTrivia
|
||||||
let firstCasePosition = node.cases.first?.positionAfterSkippingLeadingTrivia,
|
|
||||||
let firstCaseColumn = locationConverter.location(for: firstCasePosition).column
|
|
||||||
else {
|
else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let firstCaseColumn = locationConverter.location(for: firstCasePosition).column
|
||||||
|
|
||||||
for `case` in node.cases where `case`.is(SwitchCaseSyntax.self) {
|
for `case` in node.cases where `case`.is(SwitchCaseSyntax.self) {
|
||||||
let casePosition = `case`.positionAfterSkippingLeadingTrivia
|
let casePosition = `case`.positionAfterSkippingLeadingTrivia
|
||||||
guard let caseColumn = locationConverter.location(for: casePosition).column else {
|
let caseColumn = locationConverter.location(for: casePosition).column
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
let hasViolation = (indentedCases && caseColumn <= switchColumn) ||
|
let hasViolation = (indentedCases && caseColumn <= switchColumn) ||
|
||||||
(!indentedCases && caseColumn != switchColumn) ||
|
(!indentedCases && caseColumn != switchColumn) ||
|
||||||
|
|
|
@ -75,14 +75,12 @@ private extension SwitchCaseOnNewlineRule {
|
||||||
}
|
}
|
||||||
|
|
||||||
override func visitPost(_ node: SwitchCaseSyntax) {
|
override func visitPost(_ node: SwitchCaseSyntax) {
|
||||||
guard let caseEndLine = locationConverter.location(for: node.label.endPositionBeforeTrailingTrivia).line,
|
let caseEndLine = locationConverter.location(for: node.label.endPositionBeforeTrailingTrivia).line
|
||||||
case let statementsPosition = node.statements.positionAfterSkippingLeadingTrivia,
|
let statementsPosition = node.statements.positionAfterSkippingLeadingTrivia
|
||||||
let statementStartLine = locationConverter.location(for: statementsPosition).line,
|
let statementStartLine = locationConverter.location(for: statementsPosition).line
|
||||||
statementStartLine == caseEndLine else {
|
if statementStartLine == caseEndLine {
|
||||||
return
|
violations.append(node.positionAfterSkippingLeadingTrivia)
|
||||||
}
|
}
|
||||||
|
|
||||||
violations.append(node.positionAfterSkippingLeadingTrivia)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,10 +42,7 @@ private extension VerticalParameterAlignmentRule {
|
||||||
let paramLocations = params.compactMap { param -> (position: AbsolutePosition, line: Int, column: Int)? in
|
let paramLocations = params.compactMap { param -> (position: AbsolutePosition, line: Int, column: Int)? in
|
||||||
let position = param.positionAfterSkippingLeadingTrivia
|
let position = param.positionAfterSkippingLeadingTrivia
|
||||||
let location = locationConverter.location(for: position)
|
let location = locationConverter.location(for: position)
|
||||||
guard let line = location.line, let column = location.column else {
|
return (position, location.line, location.column)
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return (position, line, column)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
guard let firstParamLoc = paramLocations.first else { return [] }
|
guard let firstParamLoc = paramLocations.first else { return [] }
|
||||||
|
|
|
@ -34,9 +34,9 @@ final class BodyLengthRuleVisitor<Parent: Rule>: ViolationsSyntaxVisitor {
|
||||||
override func visitPost(_ node: EnumDeclSyntax) {
|
override func visitPost(_ node: EnumDeclSyntax) {
|
||||||
if kind == .type {
|
if kind == .type {
|
||||||
registerViolations(
|
registerViolations(
|
||||||
getLeftBrace: { node.memberBlock.leftBrace },
|
leftBrace: node.memberBlock.leftBrace,
|
||||||
getRightBrace: { node.memberBlock.rightBrace },
|
rightBrace: node.memberBlock.rightBrace,
|
||||||
getViolationNode: { node.enumKeyword }
|
violationNode: node.enumKeyword
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,9 @@ final class BodyLengthRuleVisitor<Parent: Rule>: ViolationsSyntaxVisitor {
|
||||||
override func visitPost(_ node: ClassDeclSyntax) {
|
override func visitPost(_ node: ClassDeclSyntax) {
|
||||||
if kind == .type {
|
if kind == .type {
|
||||||
registerViolations(
|
registerViolations(
|
||||||
getLeftBrace: { node.memberBlock.leftBrace },
|
leftBrace: node.memberBlock.leftBrace,
|
||||||
getRightBrace: { node.memberBlock.rightBrace },
|
rightBrace: node.memberBlock.rightBrace,
|
||||||
getViolationNode: { node.classKeyword }
|
violationNode: node.classKeyword
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,9 +54,9 @@ final class BodyLengthRuleVisitor<Parent: Rule>: ViolationsSyntaxVisitor {
|
||||||
override func visitPost(_ node: StructDeclSyntax) {
|
override func visitPost(_ node: StructDeclSyntax) {
|
||||||
if kind == .type {
|
if kind == .type {
|
||||||
registerViolations(
|
registerViolations(
|
||||||
getLeftBrace: { node.memberBlock.leftBrace },
|
leftBrace: node.memberBlock.leftBrace,
|
||||||
getRightBrace: { node.memberBlock.rightBrace },
|
rightBrace: node.memberBlock.rightBrace,
|
||||||
getViolationNode: { node.structKeyword }
|
violationNode: node.structKeyword
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,9 +64,9 @@ final class BodyLengthRuleVisitor<Parent: Rule>: ViolationsSyntaxVisitor {
|
||||||
override func visitPost(_ node: ActorDeclSyntax) {
|
override func visitPost(_ node: ActorDeclSyntax) {
|
||||||
if kind == .type {
|
if kind == .type {
|
||||||
registerViolations(
|
registerViolations(
|
||||||
getLeftBrace: { node.memberBlock.leftBrace },
|
leftBrace: node.memberBlock.leftBrace,
|
||||||
getRightBrace: { node.memberBlock.rightBrace },
|
rightBrace: node.memberBlock.rightBrace,
|
||||||
getViolationNode: { node.actorKeyword }
|
violationNode: node.actorKeyword
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,45 +74,40 @@ final class BodyLengthRuleVisitor<Parent: Rule>: ViolationsSyntaxVisitor {
|
||||||
override func visitPost(_ node: ClosureExprSyntax) {
|
override func visitPost(_ node: ClosureExprSyntax) {
|
||||||
if kind == .closure {
|
if kind == .closure {
|
||||||
registerViolations(
|
registerViolations(
|
||||||
getLeftBrace: { node.leftBrace },
|
leftBrace: node.leftBrace,
|
||||||
getRightBrace: { node.rightBrace },
|
rightBrace: node.rightBrace,
|
||||||
getViolationNode: { node.leftBrace }
|
violationNode: node.leftBrace
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func visitPost(_ node: FunctionDeclSyntax) {
|
override func visitPost(_ node: FunctionDeclSyntax) {
|
||||||
if kind == .function {
|
if kind == .function, let body = node.body {
|
||||||
registerViolations(
|
registerViolations(
|
||||||
getLeftBrace: { node.body?.leftBrace },
|
leftBrace: body.leftBrace,
|
||||||
getRightBrace: { node.body?.rightBrace },
|
rightBrace: body.rightBrace,
|
||||||
getViolationNode: { node.identifier }
|
violationNode: node.identifier
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func visitPost(_ node: InitializerDeclSyntax) {
|
override func visitPost(_ node: InitializerDeclSyntax) {
|
||||||
if kind == .function {
|
if kind == .function, let body = node.body {
|
||||||
registerViolations(
|
registerViolations(
|
||||||
getLeftBrace: { node.body?.leftBrace },
|
leftBrace: body.leftBrace,
|
||||||
getRightBrace: { node.body?.rightBrace },
|
rightBrace: body.rightBrace,
|
||||||
getViolationNode: { node.initKeyword }
|
violationNode: node.initKeyword
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func registerViolations(
|
private func registerViolations(
|
||||||
getLeftBrace: () -> TokenSyntax?, getRightBrace: () -> TokenSyntax?, getViolationNode: () -> some SyntaxProtocol
|
leftBrace: TokenSyntax, rightBrace: TokenSyntax, violationNode: SyntaxProtocol
|
||||||
) {
|
) {
|
||||||
guard
|
let leftBracePosition = leftBrace.positionAfterSkippingLeadingTrivia
|
||||||
let leftBracePosition = getLeftBrace()?.positionAfterSkippingLeadingTrivia,
|
let leftBraceLine = locationConverter.location(for: leftBracePosition).line
|
||||||
let leftBraceLine = locationConverter.location(for: leftBracePosition).line,
|
let rightBracePosition = rightBrace.positionAfterSkippingLeadingTrivia
|
||||||
let rightBracePosition = getRightBrace()?.positionAfterSkippingLeadingTrivia,
|
let rightBraceLine = locationConverter.location(for: rightBracePosition).line
|
||||||
let rightBraceLine = locationConverter.location(for: rightBracePosition).line
|
|
||||||
else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
let lineCount = file.bodyLineCountIgnoringCommentsAndWhitespace(leftBraceLine: leftBraceLine,
|
let lineCount = file.bodyLineCountIgnoringCommentsAndWhitespace(leftBraceLine: leftBraceLine,
|
||||||
rightBraceLine: rightBraceLine)
|
rightBraceLine: rightBraceLine)
|
||||||
let severity: ViolationSeverity, upperBound: Int
|
let severity: ViolationSeverity, upperBound: Int
|
||||||
|
@ -132,7 +127,7 @@ final class BodyLengthRuleVisitor<Parent: Rule>: ViolationsSyntaxVisitor {
|
||||||
"""
|
"""
|
||||||
|
|
||||||
let violation = ReasonedRuleViolation(
|
let violation = ReasonedRuleViolation(
|
||||||
position: getViolationNode().positionAfterSkippingLeadingTrivia,
|
position: violationNode.positionAfterSkippingLeadingTrivia,
|
||||||
reason: reason,
|
reason: reason,
|
||||||
severity: severity
|
severity: severity
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,8 +8,8 @@ public extension SourceRange {
|
||||||
///
|
///
|
||||||
/// - returns: Whether the specified position is contained within this range.
|
/// - returns: Whether the specified position is contained within this range.
|
||||||
func contains(_ position: AbsolutePosition, locationConverter: SourceLocationConverter) -> Bool {
|
func contains(_ position: AbsolutePosition, locationConverter: SourceLocationConverter) -> Bool {
|
||||||
let startPosition = locationConverter.position(ofLine: start.line ?? 1, column: start.column ?? 1)
|
let startPosition = locationConverter.position(ofLine: start.line, column: start.column)
|
||||||
let endPosition = locationConverter.position(ofLine: end.line ?? 1, column: end.column ?? 1)
|
let endPosition = locationConverter.position(ofLine: end.line, column: end.column)
|
||||||
return startPosition <= position && position <= endPosition
|
return startPosition <= position && position <= endPosition
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,10 +47,11 @@ public extension SwiftLintFile {
|
||||||
let sourceRange = token
|
let sourceRange = token
|
||||||
.trimmed
|
.trimmed
|
||||||
.sourceRange(converter: locationConverter)
|
.sourceRange(converter: locationConverter)
|
||||||
let startLine = sourceRange.start.line!
|
let startLine = sourceRange.start.line
|
||||||
let endLine = sourceRange.end.line!
|
let endLine = sourceRange.end.line
|
||||||
linesWithTokens.formUnion(startLine...endLine)
|
linesWithTokens.formUnion(startLine...endLine)
|
||||||
} else if let line = locationConverter.location(for: token.positionAfterSkippingLeadingTrivia).line {
|
} else {
|
||||||
|
let line = locationConverter.location(for: token.positionAfterSkippingLeadingTrivia).line
|
||||||
linesWithTokens.insert(line)
|
linesWithTokens.insert(line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,16 +31,14 @@ private extension Trivia {
|
||||||
triviaOffset += trivia.sourceLength
|
triviaOffset += trivia.sourceLength
|
||||||
switch trivia {
|
switch trivia {
|
||||||
case .lineComment(let comment), .blockComment(let comment):
|
case .lineComment(let comment), .blockComment(let comment):
|
||||||
if
|
guard let lower = comment.range(of: "swiftlint:")?.lowerBound else {
|
||||||
let lower = comment.range(of: "swiftlint:")?.lowerBound,
|
break
|
||||||
case let actionString = String(comment[lower...]),
|
|
||||||
case let end = locationConverter.location(for: offset + triviaOffset),
|
|
||||||
let line = end.line,
|
|
||||||
let column = end.column
|
|
||||||
{
|
|
||||||
let command = Command(actionString: actionString, line: line, character: column)
|
|
||||||
results.append(command)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let actionString = String(comment[lower...])
|
||||||
|
let end = locationConverter.location(for: offset + triviaOffset)
|
||||||
|
let command = Command(actionString: actionString, line: end.line, character: end.column)
|
||||||
|
results.append(command)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,9 +20,9 @@ def swiftlint_repos(bzlmod = False):
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "SwiftSyntax",
|
name = "SwiftSyntax",
|
||||||
sha256 = "8d21552ba8e28646ba11081d790d38d0986bd9920eaa67d8f9910402390f1e6e",
|
sha256 = "7a3795ce1c94add3aeffafc84d0c94453655928dfe02ad8aefebdf24902c98a0",
|
||||||
strip_prefix = "swift-syntax-509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-05-02-a",
|
strip_prefix = "swift-syntax-509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-06-05-a",
|
||||||
url = "https://github.com/apple/swift-syntax/archive/refs/tags/509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-05-02-a.tar.gz",
|
url = "https://github.com/apple/swift-syntax/archive/refs/tags/509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-06-05-a.tar.gz",
|
||||||
)
|
)
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
|
|
Loading…
Reference in New Issue