Consider example from http://www.typescriptlang.org/Handbook#modules-pitfalls-of-modules:
myModules.d.ts:
// In a .d.ts file or .ts file that is not an external module:
declare module "SomeModule" {
export function fn(): string;
}
myOtherModule.ts:
/// <reference path="myModules.d.ts" />
import m = require("SomeModule");
Current TypeScript master doesn't handle autocompletion in myOtherModule.ts since it fails when synchronizing host data, specifically calling
synchronizeHostData ->
createProgram ->
... ->
processImportedModules
which in order finds require("SomeModule") node and tries to call
findModuleSourceFile ->
findSourceFile ->
CompilerHost::getSourceFile
which fails due to assertion that sourceFile is found (which is not for the case of locally declared modules).
Consider example from http://www.typescriptlang.org/Handbook#modules-pitfalls-of-modules:
myModules.d.ts:myOtherModule.ts:Current TypeScript master doesn't handle autocompletion in
myOtherModule.tssince it fails when synchronizing host data, specifically callingsynchronizeHostData->createProgram->... ->
processImportedModuleswhich in order finds
require("SomeModule")node and tries to callfindModuleSourceFile->findSourceFile->CompilerHost::getSourceFilewhich fails due to assertion that
sourceFileis found (which is not for the case of locally declared modules).