File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
lib/ASTGen/Sources/ASTGen Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -407,11 +407,17 @@ extension String {
407407 /// Simple check to determine whether the string looks like the start of a
408408 /// URL.
409409 fileprivate var looksLikeURL : Bool {
410+ var sawColon : Bool = false
410411 var forwardSlashes : Int = 0
411412 for c in self {
412- if c == " / " {
413+ if c == " : " {
414+ sawColon = true
415+ continue
416+ }
417+
418+ if c == " / " && sawColon {
413419 forwardSlashes += 1
414- if forwardSlashes > 2 {
420+ if forwardSlashes >= 2 {
415421 return true
416422 }
417423
@@ -420,6 +426,7 @@ extension String {
420426
421427 if c. isLetter || c. isNumber {
422428 forwardSlashes = 0
429+ sawColon = false
423430 continue
424431 }
425432
Original file line number Diff line number Diff line change 1- // RUN: %target-swift-frontend -typecheck %s 2>&1 | %FileCheck %s --check-prefix=CHECK
1+ // RUN: %target-swift-frontend -typecheck %s 2>&1 | %FileCheck %s --check-prefix=CHECK-FILE -check-prefix CHECK
2+ // RUN: %target-swift-frontend -typecheck %s -diagnostic-documentation-path https://www.swift.org/documentation/compiler/diagnostics/ 2>&1 | %FileCheck %s --check-prefix=CHECK-HTTPS -check-prefix CHECK
23// REQUIRES: swift_swift_parser
34
45// CHECK: warning: file 'print-diagnostic-groups.swift' is part of module 'main'; ignoring import{{$}}
@@ -13,4 +14,6 @@ func bar() {
1314// CHECK: warning: 'bar()' is deprecated: renamed to 'bar2' [#DeprecatedDeclaration]{{$}}
1415bar ( )
1516
16- // CHECK: [#DeprecatedDeclarations]: <{{.*}}deprecated-declaration.md>
17+ // CHECK-FILE: [#DeprecatedDeclarations]: <file://{{.*}}deprecated-declaration.md>
18+
19+ // CHECK-HTTPS: [#DeprecatedDeclaration]: <https://www.swift.org/documentation/compiler/diagnostics/deprecated-declaration.md>
You can’t perform that action at this time.
0 commit comments