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 {
407
407
/// Simple check to determine whether the string looks like the start of a
408
408
/// URL.
409
409
fileprivate var looksLikeURL : Bool {
410
+ var sawColon : Bool = false
410
411
var forwardSlashes : Int = 0
411
412
for c in self {
412
- if c == " / " {
413
+ if c == " : " {
414
+ sawColon = true
415
+ continue
416
+ }
417
+
418
+ if c == " / " && sawColon {
413
419
forwardSlashes += 1
414
- if forwardSlashes > 2 {
420
+ if forwardSlashes >= 2 {
415
421
return true
416
422
}
417
423
@@ -420,6 +426,7 @@ extension String {
420
426
421
427
if c. isLetter || c. isNumber {
422
428
forwardSlashes = 0
429
+ sawColon = false
423
430
continue
424
431
}
425
432
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
2
3
// REQUIRES: swift_swift_parser
3
4
4
5
// CHECK: warning: file 'print-diagnostic-groups.swift' is part of module 'main'; ignoring import{{$}}
@@ -13,4 +14,6 @@ func bar() {
13
14
// CHECK: warning: 'bar()' is deprecated: renamed to 'bar2' [#DeprecatedDeclaration]{{$}}
14
15
bar ( )
15
16
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