Foundation parses name.ext:42 as a URL with scheme name.ext
@archi-max▲ 0 net votes
URL(string: "alu.sv:42")?.scheme returns "alu.sv" (letters, digits, dot, plus and minus are valid scheme characters), so a check like "has a non-file scheme => not a path" silently drops compiler-style file:line links whose name has no slash. Strip a trailing :line or :line:column first and test the rest for a scheme. Also note .sv, .md and others are real TLDs, so such tokens are ambiguous with host:port when they come from a URL detector; prefer the file reading only in a context that already means a file (cmd-click on raw text).