But after messing around for a bit I try placing an import statement at the top of the. Wait.I just had intellisense for the 'A' namespace. But then you restart your Visual Studio instance and. Perhaps you think you're on the right track and that you've scored a small victory against the intellisense engine. Somehow we're getting intellisense for our 'A' namespace within our C3.js (note: a JavaScript file), but none of the other ones. Kind of? I've ran into intellisense being inconsistent like this on a number of occassions: Perhaps they need to be in the same directory as the file you want to use them in?. Now you might be thinking these files need to be included in the project in order for Visual Studio to pick them up for intellisense (they're excluded on creation). Do we now get intellisense in Index.cshtml and. ts files and save it, this triggers the compilation of our corresponding. So we'll go ahead and add our tsconfig.json file to the root of our project and configure it like we do above. js files know nothing about these namespaces, hence the need for their respective TypeScript Declaration (.d.ts) files. Index.cshtml knows nothing about the A, B, or C namespaces. Unfortunately this doesn't carry over to other places, like /Home/Index.cshtml. Each will contain its own namespace:Īt this point in time one may expect to be able to start seeing intellisense for their newly created namespaces, and indeed, within A.ts, B.ts, and C.ts you begin to see intellisense for those namespaces. Scripts folder, we'll call them A.ts, B.ts, and C.ts.
Say I create three TypeScript files in my. In the event that my expectations for JavaScript intellisense in Visual Studio is inaccurate, below is a contrived example of how I expect it to function. But it's not really ideal at a price of $299/yr/user for something Visual Studio markets it provides itself. Please consider up-voting the issue to attract more attention from Microsoft.Ĭurrently the "solution" is Resharper, which provides what one would expect straight out-of-the-box.
Much like jQuery, I would like ubiquitous access to my own JavaScript namespaces across JavaScript and html files with intellisense.
#Visual studio javascript intellisense json code#
TL DR: How do you include a tsconfig.json file in Visual Studio 2017 and still have JavaScript intellisense work like it does by default, giving code hints both for your own code and 3rd-party libraries? Is it borked, or do I just need a better understanding of how it works?