Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only capitalise the Module name instead of changing its case completely #111

Open
MangelMaxime opened this issue Jul 26, 2022 · 0 comments

Comments

@MangelMaxime
Copy link
Contributor

Describe the bug

Right now when loading a generator/loader Fornax transform the name of the file using textInfo.ToTitleCase meaning that if the user write postLoader.fsx it will be transformed into Postloader for the open instruction.

From what I see, when using #load "postLoader.fsx" the name of the module generated by the F# compiler is PostLoader meaning that it only capitalise the name of the file.

Can we change

let internal getOpen (path : string) =
    let filename = Path.GetFileNameWithoutExtension path
    let textInfo = (CultureInfo("en-US", false)).TextInfo
    textInfo.ToTitleCase filename

to

let internal getOpen (path : string) =
    let filename = Path.GetFileNameWithoutExtension path
    let textInfo = (CultureInfo("en-US", false)).TextInfo
    string (textInfo.ToUpper filename[0]) + filename[1..]

// or this one as I am not sure if the CultureInfo is required
let internal getOpen (path : string) =
    let filename = Path.GetFileNameWithoutExtension path
    (string filename[0]).ToUpperInvariant() + filename[1..]

Doing this change would allow the user have better naming for its files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant