You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FileExtension/FullFileExtension throw ArgumentException for any path with a dot in a directory name ("./notes.txt", "/home/u/.config/a.json") #287
FileExtension (around line 14) searches the entire path with LastIndexOf('.').
FullFileExtension (around line 53) does the same with IndexOf('.').
Neither limits the search to the file-name segment. When a directory component contains a dot, the substring handed to FileExtension.Create includes a directory separator. IsFileExtensionAttribute rejects that, so the property getter throws.
throws for ".v2/README"; it should return an empty extension
Paths with ./, ../, dot-directories such as .config, .git and .vscode, or versioned folder names are everyday input. For all of them, a simple property read throws. The existing tests use bare file names only (for example "test.tar.gz"), so the bug goes unnoticed.
Suggested fix
Work on the file-name segment only. Slice after the last / or \ (or use Path.GetFileName) before searching for dots. For FullFileExtension, also skip a leading dot in the file name, so .bashrc is treated as a name with no extension rather than an extension.
Acceptance criteria
"./notes.txt" → FileExtension == ".txt" and FullFileExtension == ".txt".
"../data/archive.tar.gz" → FileExtension == ".gz" and FullFileExtension == ".tar.gz".
"/opt/app.v2/README" → both are empty.
"/home/user/.bashrc" → both are empty, per the chosen dotfile rule, which should be documented.
The tests cover both the netstandard2.0 branch and the span branch.
Priority: High. A plain property read throws ArgumentException for everyday inputs such as ./notes.txt, ../data/x.tar.gz and anything under .config/.git/.vscode.
Area / suggested assignee:Semantics.Paths/SemanticFilePath.cs — FileExtension / FullFileExtension, both the netstandard2.0 and span code paths. Owner: @matt-edmondson
Next step: Slice to the file-name segment before searching for dots. Decide and document the dotfile rule (.bashrc → no extension). Add tests with directory components for both target-framework branches.
Activity
matt-edmondson commentedon Sep 27, 2026
Triage
ArgumentExceptionfor everyday inputs such as./notes.txt,../data/x.tar.gzand anything under.config/.git/.vscode.Semantics.Paths/SemanticFilePath.cs—FileExtension/FullFileExtension, both the netstandard2.0 and span code paths. Owner: @matt-edmondsonRelativeDirectoryPath.Normalize()in the same package), which could ship in the same patch release..bashrc→ no extension). Add tests with directory components for both target-framework branches.Generated by Claude Code
[patch] Search only the file name for FileExtension and FullFileExten…