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

Links to source files are not generated under Windows with older MSYS (mingw) #2113

Closed
royaltm opened this issue Dec 9, 2022 · 2 comments
Closed
Labels
bug Functionality does not match expectation

Comments

@royaltm
Copy link

royaltm commented Dec 9, 2022

Search terms

Links to source files are not generated under Windows under older mingw versions or non-standard configuration.

Expected Behavior

Typedoc should generate source links.

Actual Behavior

Typedoc does not generate source links because here
fileName does not match the files produced by git -C {path} ls-files.

For example:

  • fileName is "c:/Path/To/Repo"
  • paths in the files start with "C:/Path/To/Repo" because they are being run through BasePath.normalize and fileName is not.

Steps to reproduce the bug

This is actually hard, because I can not pinpoint why my MSYS is converting the windows path with the small drive letter.

Get MSYS (mingw version 1) on Windows, try to generate docs to any repository, check if the source links are being generated.

There are probably some other MSYS configurations that produce the windows path with the small drive letter.

Environment

  • Typedoc version: 0.23.21
  • TypeScript version: 4.9.4
  • Node.js version: 16.16.0
  • OS: Windows 10 + mingw

How to fix

The bug can be fixed easily if you add:

fileName = BasePath.normalize(fileName);

before this line here

If the possible fix wasn't this easy I would rather not bother filing this issue. However I think the purpose of adding BasePath.normalize was to address such issues under Windows. If the paths in Repository#files set are being normalized already, then paths that are being matched against the set should be normalized as well.

@royaltm royaltm added the bug Functionality does not match expectation label Dec 9, 2022
@royaltm royaltm changed the title Links to source files are not generated under Windows with older mingw Links to source files are not generated under Windows with older MSYS (mingw) Dec 9, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 11, 2022

Oh Windows, how I dislike you... seems like a pretty innocuous fix.

@royaltm
Copy link
Author

royaltm commented Dec 12, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants