microsoft / microsoft/TypeScript

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

Open
#59,851 1 comment 0 reactions 1 assignee View on GitHub

@sheetalkamat is already working on this.

Since Sep 5, 2024.

Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

🔎 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.