-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
Fix service host interface to support ts2.5 #366
Conversation
src/index.ts
Outdated
@@ -278,6 +278,9 @@ export function register (options: Options = {}): Register { | |||
}, | |||
getDirectories: getDirectories, | |||
directoryExists: directoryExists, | |||
fileExists: ts.sys.fileExists, | |||
readFile: ts.sys.readFile, | |||
readDirectory: ts.sys.readDirectory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have existing implementations of two of these functions, should we just use those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blakeembrey Fixed
@blakeembrey - do you know if we need to make a similar change to ts-loader here: https://github.com/TypeStrong/ts-loader/blob/master/src/servicesHost.ts#L34 ? |
@johnnyreilly I would think so, yes. You can just use the |
Thanks @blakeembrey - I've tested and it looks good. |
In typescript 2.5 language service host needs to implement fileExists, readFile and readDirectory to be able to correctly resolve the modules (otherwise only ambient modules would be resolved)
Described here https://github.com/Microsoft/TypeScript/blame/master/src/services/types.ts#L166