Check for language serivice enabled when including source files

This commit is contained in:
Sheetal Nandi 2019-06-21 14:22:11 -07:00
parent 746b01e577
commit ecf875112b

View file

@ -1427,12 +1427,12 @@ namespace ts.server {
/* @internal */
useSourceInsteadOfReferenceRedirect() {
return true;
return !!this.languageServiceEnabled;
}
fileExists(file: string): boolean {
// Project references go to source file instead of .d.ts file
if (this.getSourceOfProjectReferenceRedirect) {
if (this.languageServiceEnabled && this.getSourceOfProjectReferenceRedirect) {
const source = this.getSourceOfProjectReferenceRedirect(file);
if (source) return isString(source) ? super.fileExists(source) : true;
}