Commit graph

17 commits

Author SHA1 Message Date
Kim Morrison
09e1a05ee9
chore: cleanup imports (#5825) 2024-10-23 23:51:13 +00:00
Austin Letson
83369f3d9f
fix: update System.FilePath.parent to handle edge cases for absolute paths (#3645)
System.FilePath.parent did not return the correct parent path in the
case of absolute file paths

Example of previous behavior
```
(FilePath.mk "/foo").parent -> some (FilePath.mk "")

(System.FilePath.mk "/").parent -> some (FilePath.mk "")
```

The new behavior is based on rust's std::path::Path::parent function (as
previously described in comment in System.FilePath)

Example of updated behavior
```
(System.FilePath.mk "/foo").parent -> some (FilePath.mk "/")

(System.FilePath.mk "/").parent -> none
```

Behavior for relative file paths is unchanged

Closes #3618
2024-03-26 05:09:44 +00:00
Eric Wieser
4169cac51f
fix: do not strip dotted components from lean module names (#2994)
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>
2024-01-10 14:24:26 +00:00
Sebastian Ullrich
8d34cc15cf fix: path normalization should not case-normalize entire path 2022-10-08 10:12:11 -07:00
Leonardo de Moura
3862e7867b refactor: make String.Pos opaque
TODO: this refactoring exposed bugs in `FuzzyMatching` and `Lake`

closes #410
2022-03-20 10:47:13 -07:00
Joscha
bce56fdc0c feat: implement reference request 2022-01-14 09:18:57 +01:00
Sebastian Ullrich
e4995ce8ba feat: add convenience coercion from String to FilePath 2021-05-28 14:19:59 +02:00
Sebastian Ullrich
619873c842 feat: make System.FilePath opaque 2021-05-28 14:19:59 +02:00
Sebastian Ullrich
4354534fda feat: make FilePath a concrete type
Resolves #363
2021-05-28 14:19:59 +02:00
Sebastian Ullrich
ed55fdfd3e chore: better error message when failing to find current package 2021-03-23 12:10:26 +01:00
Wojciech Nawrocki
28d6a1ebe1 fix: go-to-def paths on Windows 2021-01-28 11:45:33 -08:00
Sebastian Ullrich
3cdcdac921 feat: infer worker path 2020-12-23 20:00:36 +01:00
Leonardo de Moura
13c2a8ff51 chore: remove #lang lean4 header 2020-10-25 09:54:07 -07:00
Leonardo de Moura
427936fa63 chore: move to new frontend 2020-10-22 07:02:40 -07:00
Leonardo de Moura
05dda45a22 chore: remove { <structure-name> . ... } from stdlib
TODO: fix problems with `{ ... : <expected-type }` new syntax
2020-05-20 15:43:21 -07:00
Leonardo de Moura
b5eb64da3a fix: add mkFilePath and try to fix Windows build 2020-02-04 11:24:33 -08:00
Leonardo de Moura
c445199747 chore: library/Init ==> src/Init
cc @Kha @dselsam @cipher1024
2019-11-22 06:06:05 -08:00
Renamed from library/Init/System/FilePath.lean (Browse further)