Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ileitch committed Mar 4, 2023
1 parent c92f3a3 commit 4015861
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "4ad606ba5d7673ea60679a61ff867cc1ff8c8e86",
"version": "1.2.1"
"revision": "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a",
"version": "1.2.2"
}
},
{
Expand All @@ -51,8 +51,8 @@
"repositoryURL": "https://github.com/peripheryapp/swift-syntax",
"state": {
"branch": null,
"revision": "a2d31e8880224f5a619f24bf58c122836faf99ff",
"version": "1.0.0"
"revision": "d81f0bfa1e14446a8c42e94ff6d44fddf866d72e",
"version": "1.0.1"
}
},
{
Expand All @@ -69,17 +69,17 @@
"repositoryURL": "https://github.com/tuist/xcodeproj",
"state": {
"branch": null,
"revision": "b6de1bfe021b861c94e7c83821b595083f74b997",
"version": "8.8.0"
"revision": "fae27b48bc14ff3fd9b02902e48c4665ce5a0793",
"version": "8.9.0"
}
},
{
"package": "Yams",
"repositoryURL": "https://github.com/jpsim/Yams",
"state": {
"branch": null,
"revision": "01835dc202670b5bb90d07f3eae41867e9ed29f6",
"version": "5.0.1"
"revision": "f47ba4838c30dbd59998a4e4c87ab620ff959e8a",
"version": "5.0.5"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var dependencies: [Package.Dependency] = [
.package(url: "https://github.com/tadija/AEXML", from: "4.0.0"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
.package(url: "https://github.com/kateinoigakukun/swift-indexstore", from: "0.0.0"),
.package(url: "https://github.com/peripheryapp/swift-syntax", .exact("1.0.0"))
.package(url: "https://github.com/peripheryapp/swift-syntax", .exact("1.0.1"))
]

#if os(macOS)
Expand Down
10 changes: 5 additions & 5 deletions Sources/PeripheryKit/Syntax/DeclarationSyntaxVisitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor {
guard node.initializer == nil,
let identifier = node.pattern.as(IdentifierPatternSyntax.self)?.identifier,
let parentStmt = node.parent?.parent?.parent,
(parentStmt.is(IfStmtSyntax.self) || parentStmt.is(GuardStmtSyntax.self))
(parentStmt.is(IfExprSyntax.self) || parentStmt.is(GuardStmtSyntax.self))
else { return }
letShorthandIdentifiers.insert(identifier.text)
}

func visit(_ node: FunctionCallExprSyntax) {
if let identifierExpr = node.calledExpression.as(IdentifierExprSyntax.self),
identifierExpr.identifier.rawTokenKind == .capitalSelfKeyword {
identifierExpr.identifier.tokenKind == .keyword(.Self) {
didVisitCapitalSelfFunctionCall = true
}
}
Expand All @@ -317,10 +317,10 @@ final class DeclarationSyntaxVisitor: PeripherySyntaxVisitor {
consumeCapitalSelfFunctionCalls: Bool = false,
at position: AbsolutePosition
) {
let modifierNames = modifiers?.withoutTrivia().map { $0.name.text } ?? []
let modifierNames = modifiers?.map { $0.name.text } ?? []
let accessibility = modifierNames.mapFirst { Accessibility(rawValue: $0) }
let attributeNames = attributes?.withoutTrivia().compactMap {
AttributeSyntax($0)?.attributeName.text ?? CustomAttributeSyntax($0)?.attributeName.firstToken?.text
let attributeNames = attributes?.compactMap {
AttributeSyntax($0)?.attributeName.trimmedDescription ?? AttributeSyntax($0)?.attributeName.firstToken?.text
} ?? []
let location = sourceLocationBuilder.location(at: position)
var letShorthandIdentifiers = Set<String>()
Expand Down
2 changes: 1 addition & 1 deletion Sources/PeripheryKit/Syntax/ImportSyntaxVisitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class ImportSyntaxVisitor: PeripherySyntaxVisitor {

func visit(_ node: ImportDeclSyntax) {
let parts = node.path.map { $0.name.text }
let attributes = node.attributes?.compactMap { $0.as(AttributeSyntax.self)?.attributeName.text } ?? []
let attributes = node.attributes?.compactMap { $0.as(AttributeSyntax.self)?.attributeName.trimmedDescription } ?? []
importStatements.append((parts, attributes.contains("testable")))
}
}
2 changes: 1 addition & 1 deletion Sources/PeripheryKit/Syntax/TypeSyntaxInspector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct TypeSyntaxInspector {
} else if let funcType = typeSyntax.as(FunctionTypeSyntax.self) {
// Function type.
let locations = funcType.arguments.flatMap { typeLocations(for: $0.type) }
return typeLocations(for: funcType.returnType).union(locations)
return typeLocations(for: funcType.output.returnType).union(locations)
} else if let arrayType = typeSyntax.as(ArrayTypeSyntax.self) {
// Array type.
return typeLocations(for: arrayType.elementType)
Expand Down
4 changes: 2 additions & 2 deletions Sources/PeripheryKit/Syntax/UnusedParameterParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ struct UnusedParameterParser {
if optBindingCondition.initializer == nil,
let pattern = optBindingCondition.pattern.as(IdentifierPatternSyntax.self),
let parentStmt = optBindingCondition.parent?.parent?.parent,
(parentStmt.is(IfStmtSyntax.self) || parentStmt.is(GuardStmtSyntax.self)) {
(parentStmt.is(IfExprSyntax.self) || parentStmt.is(GuardStmtSyntax.self)) {
// Handle `let x {}` syntax.
parsed = parse(identifier: pattern.identifier)
} else {
Expand Down Expand Up @@ -335,7 +335,7 @@ struct UnusedParameterParser {
let items = parse(node: body, collector)?.items ?? []
let fullName = buildFullName(for: name, with: params)
let genericParamNames = genericParams?.genericParameterList.compactMap { $0.name.text } ?? []
let attributeNames = attributes?.children(viewMode: .sourceAccurate).compactMap { AttributeSyntax($0)?.attributeName.text } ?? []
let attributeNames = attributes?.children(viewMode: .sourceAccurate).compactMap { AttributeSyntax($0)?.attributeName.trimmedDescription } ?? []

let function = Function(
name: name,
Expand Down

0 comments on commit 4015861

Please sign in to comment.