This introduces `FilePath.addExtension` to take a path that we know has no prior extension, and append a new extension to it. As this function is simpler than `FilePath.withExtension`, this change eagerly replaces uses of the latter with the former, except in a few cases where stripping the extension really is the right thing to do. This should fix the bug described at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Import.20file.20with.20multiple.20dots.20in.20file.20name/near/404508048, where `import «A.B».«C.D.lean»` is needed to import `A.B/C.D.lean`. Closes #2999 --------- Co-authored-by: Mac Malone <tydeu@hatpress.net> Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
20 lines
186 B
Text
20 lines
186 B
Text
true
|
|
false
|
|
"a/b"
|
|
"a/b/c"
|
|
"/b/c"
|
|
some "a"
|
|
some "a/b"
|
|
none
|
|
some "b"
|
|
some "b"
|
|
some "b.tar"
|
|
some ".gitignore"
|
|
"a/c"
|
|
none
|
|
some "txt"
|
|
none
|
|
"a/b.tar.xz"
|
|
"a/b.tar"
|
|
"a/b.tar.gz"
|
|
"a/b.tar.gz.bak"
|