I would like VSCode intellisense to understand the semantics of my TS import statements. If it did, then VSCode could try to resolve those statements to files and pull types from those files without any annotations. Sometimes it can, if it can find the typescript file that exports what I'm importing. However, there are times when it can't do that, specifically, when I'm importing a library that has been typed with an ambient declaration. But almost everything I want to import is typed with an ambient declaration, so this is a big deal.
I understand that this is complicated by the fact that import statements compile to different things depending on the module flag, and that generated import statements can have an additional layer of runtime routing that confuses a simple file-based search strategy.
In a perfect world, since we're dreaming, I would like to be able to reference a requirejs config object, defined as a standalone json file or literally defined in tsconfig.json, and have VS Code use requirejs routing semantics to resolve the imported moduleid to a file on disk (or else warning me at compile time when my import statement won't resolve to a module at runtime).
However, even being able to just have intellisense search all of the paths in a list to heuristically find the module that I'm importing would be nice, and that would be module-loader agnostic. With a routing layer like requirejs imposed over top, it would be possible in theory to resolve to a different module than the one that TS finds; in most cases it would work, but the oddballs could be handled with an annotation.
I don't think either of these things is currently possible in any editor, including VSCode. Quite possibly they'll be there in the future, but for now, I'm curious how other people are getting intellisense. I'm willing to go to extreme lengths to avoid the <reference path=.../> annotations, since they are code duplication.
Some of my libraries are typed with DefinitelyTyped packages, but some of them are not, e.g., some of them are internal modules that have been browserified. So tsd is not a full solution.
One level of "solution" is to simply make all the types of the project available in every file, e.g. by coalescing every type declaration from the entire project, including ambient modules from .d.ts files, and then referencing that agglomeration, so long as two ambient modules don't have a namespace collision. This solution works until there is a namespace collision, and then it permanently stops working. So I don't really like this idea.
Is there anything else better? Has anyone gotten tsserver to work? I can find scant little documentation about it - I only know it exists because I noticed that it was installed when I installed node's tsc implementation.
tsconfig.jsonin your project, VSCode will include all.tsfiles in that directory and sub directories by default. Beyond that, I'm not sure what you're asking for.