You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When implementing a LanguageServiceHost without implementing optional fileExists or readFile, the compilerHost instance silently skips import statements:
exportclassInMemoryLanguageServiceHostimplementsts.LanguageServiceHost{// only required members implemented here..}
The above implementation compiled without errors against 2.4.2, but all import statements in source files added to the language server failed to resolve, resulting in diagnostics, missing definitions, completions, etc.
Expected behavior:
Either:
Compilation failure indicating that LanguageServiceHost is now incomplete
Module resolver falls back to ModuleResolutionHost to access fileExists / readFile
Actual behavior:
Imports fail to resolve where they do exist, in nodeModuleResolverWorker, following the path:
TypeScript Version: 2.4.2, also in master
This issue was encountered when upgrading javascript-typescript-langserver from typescript 2.3.4 (see sourcegraph/javascript-typescript-langserver#356)
Code
When implementing a LanguageServiceHost without implementing optional
fileExists
orreadFile
, the compilerHost instance silently skipsimport
statements:The above implementation compiled without errors against 2.4.2, but all
import
statements in source files added to the language server failed to resolve, resulting in diagnostics, missing definitions, completions, etc.Expected behavior:
Either:
fileExists
/readFile
Actual behavior:
Imports fail to resolve where they do exist, in
nodeModuleResolverWorker
, following the path:Debugger screenshot showing the issue at runtime at https://github.com/Microsoft/TypeScript/blob/21bbdd33c51f07a46663e9b50fff62e9c007c806/src/services/services.ts#L1166
The typings published at https://github.com/Microsoft/TypeScript/blob/master/lib/typescript.d.ts#L3764-L3765 show that the two members are still optional.
This dependency appears to have been introduced at: 2ec92b9
The text was updated successfully, but these errors were encountered: