//===----------------------------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// @_spi(SourceKitLSP) import LanguageServerProtocol @_spi(SourceKitLSP) import SKLogging import SourceKitLSP import SwiftParser import SwiftSyntax // MARK: - Attribute parsing /// Get the traits applied to a testing attribute. /// /// - Parameters: /// - testAttribute: The attribute to inspect. /// /// - Returns: An array of `ExprSyntax` instances representing the traits /// applied to `testAttribute`. If the attribute has no traits, the empty /// array is returned. private func traits(ofTestAttribute testAttribute: AttributeSyntax) -> [ExprSyntax] { guard let argument = testAttribute.arguments, case let .argumentList(argumentList) = argument else { return [] } // Skip the display name if present. var traitArgumentsRange = argumentList.startIndex..