Skip to content

Some of the semantic diagnostics use fileName and not relative file name as part of semantic diagnostics and it makes tsbuildinfo unportable #59851

@sheetalkamat

Description

@sheetalkamat

🔎 Search Terms

semantic diagnostics file name, tsbuildinfo

🕗 Version & Regression Information

  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

No response

💻 Code

// Your code here

Errors like File_0_is_not_a_module use file name directly and that means they will have full paths in buildInfo making it report incorrect path if tsbuildInfo is ported.
Also need to search through code base to see if there are more such cases and use relative file name instead:
In Checker:
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName)
error(errorNode, diag, moduleReference, resolvedModule!.resolvedFileName)
error(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName);
chainDiagnosticMessages( errorInfo, Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName, ),

🙁 Actual behavior

File '/b.ts' is not module.

🙂 Expected behavior

File 'relativeToFileReportedIn("/b.ts")' not module.

Additional information about the issue

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions