Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Edited Issue: TypeScript Intellisense broken when linking to a .ts file outside the project directory [1660]

$
0
0
We want to consolidate all the TypeScript definitions into one place in our code base so that multiple Node projects can link to the same one. However, this breaks TypeScript Intellisense, which is unable to process these linked files.

Repro steps:

1) Install Node.js Tools 1.0.21121.00.
2) Create TypeScript\Node.js\Blank Node.js Console Application.
3) Open app.ts and add:

import http = require("http");

4) Verify that it builds without errors and that Intellisense works (e.g. you get suggestions when typing http followed by period).
5) Open File Explorer, then move node.d.ts to the parent directory of the project.
6) Update the .njsproj file to point to the new node.d.ts location:

<TypeScriptCompile Include="..\node.d.ts">
<Link>node.d.ts</Link>
</TypeScriptCompile>

7) Reload the solution.

[expected] It builds without errors and Intellisense works.
[actual] It builds without errors, but there is a squiggly on require("http") saying:
"Cannot find external module 'http'."


Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>