From 5b63b6bfa714eabfcbd40347b49eda72039b2a39 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Sun, 27 Dec 2015 13:48:28 +0900 Subject: [PATCH] Fix #294 --- Source/SwiftLintFramework/Rules/ValidDocsRule.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SwiftLintFramework/Rules/ValidDocsRule.swift b/Source/SwiftLintFramework/Rules/ValidDocsRule.swift index 0d6eaf3fa..b0aa30ef3 100644 --- a/Source/SwiftLintFramework/Rules/ValidDocsRule.swift +++ b/Source/SwiftLintFramework/Rules/ValidDocsRule.swift @@ -83,7 +83,7 @@ func superfluousOrMissingParameterDocumentation(declaration: String, substructur $0["key.name"] as? String } ?? [] let labelsAndParams = parameterNames.map { parameter -> (label: String, parameter: String) in - let fullRange = NSRange(location: 0, length: Int(bodyOffset - offset)) + let fullRange = NSRange(location: 0, length: declaration.utf16.count) let firstMatch = regex("([^,\\s(]+)\\s+\(parameter)\\s*:") .firstMatchInString(declaration, options: [], range: fullRange) if let match = firstMatch {