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

Impossible to implement LanguageServiceHost::resolveModuleNames without using TS internal getModeForResolutionAtIndex #49340

Closed
5 tasks done
cspotcode opened this issue Jun 1, 2022 · 0 comments Β· Fixed by #49360
Assignees
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.

Comments

@cspotcode
Copy link

cspotcode commented Jun 1, 2022

Suggestion

πŸ” Search Terms

LanguageServiceHost
resolveModuleNames
getModeForResolutionAtIndex

βœ… Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Expose ts.getModeForResolutionAtIndex as part of public API, or otherwise provide a way to implement LanguageServiceHost::resolveModuleNames with full NodeNext compatibility.

Alternatively, I might be wrong if there is a different correct way to implement resolveModuleNames.

πŸ“ƒ Motivating Example

This attempted bugfix, where I am using ts.getModeForResolutionAtIndex within my implementation of LanguageServiceHost::resolveModuleNames
TypeStrong/ts-node#1782
Link to the invocation of getModeForResolutionAtIndex https://github.com/TypeStrong/ts-node/pull/1782/files#diff-c654137f603e726b39295587f26aee8130da50d8c019ba7e176b201917f17e56R101-R107

πŸ’» Use Cases

ts-node, which JIT compiles and typechecks using the LanguageService, and supports NodeNext

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants