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

Fix service host interface to support ts2.5 #366

Merged
merged 2 commits into from
Jun 21, 2017
Merged

Fix service host interface to support ts2.5 #366

merged 2 commits into from
Jun 21, 2017

Conversation

cevek
Copy link
Contributor

@cevek cevek commented Jun 20, 2017

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

@coveralls
Copy link

coveralls commented Jun 20, 2017

Coverage Status

Coverage remained the same at 86.538% when pulling 09c7482 on cevek:fix-ts2.5 into 28697b1 on TypeStrong:master.

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,
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blakeembrey Fixed

@coveralls
Copy link

coveralls commented Jun 21, 2017

Coverage Status

Coverage remained the same at 86.538% when pulling a99486f on cevek:fix-ts2.5 into 28697b1 on TypeStrong:master.

@johnnyreilly
Copy link
Member

@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 ?

@blakeembrey
Copy link
Member

@johnnyreilly I would think so, yes. You can just use the ts.sys functions though.

@johnnyreilly
Copy link
Member

Thanks @blakeembrey - I've tested and it looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants