Path Contexts
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- csharp
调研方向
未指定任何文件或测试。首先定位现有的 *Path types 和 LocalPath,然后跟踪它们的构造函数及路径操作。完成的标准是这些类型共享一个路径上下文 API,支持分隔符、平台行为、验证、自定义构造函数上下文,以及 TODO 中描述的 LocalPathContext.Instance 默认行为。
由索引模型根据 Issue 内容生成。
描述
We'll need a file system API for virtual paths. Local path (#1) should implement the same API, so it should be possible to abstract over both kinds of paths.
The API should allow to:
- manipulate foreign paths, e.g. Windows paths on a Linux computer, and vice versa;
- introduce fully virtual file systems.
Currently, I am thinking of adding a new field of type IFileSystem or IPathContext to each of our path types: hopefully, this won't create too much overhead for their storage.
Default constructors would rely on a singleton instance for the current system, something like new LocalPath("foo") => new LocalPath("foo", LocalFileSystem.Instance).
There should be a way for the user to introduce custom path validation in constructor. For example, if they want to somehow avoid Windows paths on Linux and want to throw on new LocalPath(CustomContext, @"C:\Windows"), even though this path is valid.
TODO
- Introduce a field into all
*Pathtypes. - Derive the path manipulation operations to the path context:
- path separators,
- behavior aspects such as Windows drives,
- path validation in constructors (even for
LocalPaththat doesn't do any validation otherwise).
- Allow passing the context to path constructors.
- The constructors should delegate to some
LocalPathContext.Instanceby default (if nothing else is passed). -
LocalPathContext.Instanceshould be a writable field (for global custom override). - Future enhancement request: allow
ThreadLocaland/orAsyncLocaloverride forLocalPathContext, to avoid reliance on the global state.
- 主要语言
- C#
- 星标
- 104
- 派生
- 19
- 平均合并
- 13 小时 42 分钟
- 30 天内合并 PR
- 9
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ForNeVeR/TruePath 的其他 Issue
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 68/100
ForNeVeR/TruePath#165 · 2 条评论 ·
维护者通常 1 天内回复
-
bug help wanted
难度 3/5 1-2 天 新手友好度 68/100
ForNeVeR/TruePath#226 · 1 条评论 ·
维护者通常 1 天内回复
-
LocalPath: prefix matching needs a four-way path kind, not IsPathRooted可能已有人在做 @ForNeVeR 于 4 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 55/100
ForNeVeR/TruePath#224 · 已指派 1 人 ·
维护者通常 1 天内回复
-
enhancement good first issue help wanted
难度 2/5 1-3 小时 新手友好度 55/100
维护者通常 1 天内回复
-
dashboard
难度 3/5 1-2 天 新手友好度 15/100
维护者通常 1 天内回复
查看 ForNeVeR/TruePath 的全部 Issue
相似的 Issue
-
area-System.Numerics.Tensors untriaged
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/runtime#134691 · 2 条评论 ·
维护者通常 1 天内回复
-
ci-failure-cause test-failure
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 78/100
AvaloniaUI/Avalonia#22312 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100