From 48dcf37154476a8529cceea89225a943e8f00afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20Ambrus?= <32463042+tothambrus11@users.noreply.github.com> Date: Wed, 26 Jun 2024 01:26:59 +0200 Subject: [PATCH 1/3] Fix GNU source location presentation The common syntax for referring to lines and columns is to write line:column instead of line.column. When I make this change, the link will become clickable in VSCode. --- Sources/FrontEnd/SourceRange.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FrontEnd/SourceRange.swift b/Sources/FrontEnd/SourceRange.swift index 949909736..4d488b672 100644 --- a/Sources/FrontEnd/SourceRange.swift +++ b/Sources/FrontEnd/SourceRange.swift @@ -104,7 +104,7 @@ extension SourceRange: CustomStringConvertible { /// [Gnu-standard](https://www.gnu.org/prep/standards/html_node/Errors.html). public var gnuStandardText: String { let start = self.start.lineAndColumn - let head = "\(file.url.relativePath):\(start.line).\(start.column)" + let head = "\(file.url.relativePath):\(start.line):\(start.column)" if regionOfFile.isEmpty { return head } let end = file.position(endIndex).lineAndColumn From dca78f681813a0825bbe624a709ba2e003ae11c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20Ambrus?= <32463042+tothambrus11@users.noreply.github.com> Date: Sat, 29 Jun 2024 15:11:39 +0200 Subject: [PATCH 2/3] Make start and end locations consistently formatted in source range --- Sources/FrontEnd/SourceRange.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/FrontEnd/SourceRange.swift b/Sources/FrontEnd/SourceRange.swift index 4d488b672..bb4a95bd2 100644 --- a/Sources/FrontEnd/SourceRange.swift +++ b/Sources/FrontEnd/SourceRange.swift @@ -104,14 +104,14 @@ extension SourceRange: CustomStringConvertible { /// [Gnu-standard](https://www.gnu.org/prep/standards/html_node/Errors.html). public var gnuStandardText: String { let start = self.start.lineAndColumn - let head = "\(file.url.relativePath):\(start.line):\(start.column)" + let head = "\(file.url.relativePath):\(start.line).\(start.column)" if regionOfFile.isEmpty { return head } let end = file.position(endIndex).lineAndColumn if end.line == start.line { return head + "-\(end.column)" } - return head + "-\(end.line):\(end.column)" + return head + "-\(end.line).\(end.column)" } public var description: String { gnuStandardText } From 806ebc6191e643caa16683ce611150ad41cc229f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20Ambrus?= <32463042+tothambrus11@users.noreply.github.com> Date: Sat, 29 Jun 2024 17:11:21 +0200 Subject: [PATCH 3/3] See whether CI flakes --- Sources/FrontEnd/SourceRange.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/FrontEnd/SourceRange.swift b/Sources/FrontEnd/SourceRange.swift index bb4a95bd2..0f6b68502 100644 --- a/Sources/FrontEnd/SourceRange.swift +++ b/Sources/FrontEnd/SourceRange.swift @@ -113,6 +113,7 @@ extension SourceRange: CustomStringConvertible { } return head + "-\(end.line).\(end.column)" } + public var description: String { gnuStandardText }