T3S
T3S copied to clipboard
Multiple files not working
Hi,
when I split my TypeScipt code among multiple files, I get errors.
i have three files in my sublime-project:
ts/main.ts:
/// <reference path="Person.ts" />
var paul:any = new People.Person('Paul', 'Smith');
ts/Person.ts:
module People {
export class Person {
constructor(public firstname: string, public lastname: string) {}
}
}
and the configuration file helloTs.sublime-project:
{
"folders":
[
{
"follow_symlinks": true,
"path": "."
}
],
"settings":
{
"typescript":
[
"ts/main.ts"
]
}
}
In the main.ts file the module name People
is marked with the error message error TS2095: Could not find symbol 'People'
.
I can confirm this issue with a slightly different configuration (using .sublimets).
/.sublimets
{
"root": "app.ts"
}
/src/Transpiling/JavaScriptTranspiler.ts
/// <reference path="../Parsing/Nodes/BaseTreeNode.ts" />
module MyModule {
// Could not find symbol 'BaseTreeNode'
var btn = new BaseTreeNode();
}
/src/Parsing/Nodes/BaseTreeNode.ts
module MyModule {
export class BaseTreeNode { /* ... */ }
}
I think I just was able to resolve this issue. Adding the /// <reference path="..." />
to the root file will obviously index the files globally. Adding a reference to my root file app.ts
made it available in all other files as well. I'll try to improve the readme.