question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent/incorrect file path case from getFilePath

See original GitHub issue

Describe the bug Version: 13.0.0

Path returned by SourceFile.getFilePath() has incorrect case when retrieved via a Type -> Symbol -> InterfaceDeclaration, but not when retrieved via Project#getSourceFiles

Not sure if I’m doing something wrong, I’m very new to this library.

To Reproduce

project.getSourceFiles().forEach(sourceFile => {
    console.log("path " + sourceFile.getFilePath())
    // path /Users/rhys/Projects/ts-auto-guard-test/src/Thing.ts - CORRECT

// ...

if (type.isInterface()) {
    const declarations = type.getSymbol()!.getDeclarations();
    const declaration = declarations.find(TypeGuards.isInterfaceDeclaration)!;
    const sourcePath = declaration.getSourceFile()!.getFilePath()
    console.log("path " + sourcePath)
    // path /Users/rhys/Projects/ts-auto-guard-test/src/thing.ts - INCORRECT
}

Expected behavior

Paths are same as the file path, maintaining capitalization.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
rhys-vdwcommented, Aug 20, 2018

Thanks, loving your library btw, it’s made this project really easy. Open to any feedback on the code too if you see anything I’m doing wrong. I’m new to this.

0reactions
rhys-vdwcommented, Aug 21, 2018

This bug is lower priority than I initially thought.

Absolutely. Me too. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I obtain the case-sensitive path on Windows?
Here is a solution that worked for me to move files between Windows and a server using case sensitive paths. It walks down...
Read more >
How to get file path automatically in activity for another system?
@Yoga_Sandeep, Probably best way is to use relative path rather than full path. @Bhavik_Solanki We can't able to get file path automatically?
Read more >
How to get Case Sensitive Filename/Path in MFC - MSDN
Hi,. I need to get the Case sensitive Filename and Path to chek if the filename described in an XML file and the...
Read more >
Log files for IBM Case Manager installation
The IBM Case Manager installation log is located in the logs directory in the location where you installed IBM Case ... Operating system,...
Read more >
Changing exhibit file paths - LexisNexis
Linked exhibits and other case files should be stored in a network folder so other case users can access them. You can change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found