-
Notifications
You must be signed in to change notification settings - Fork 13k
Description
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