Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to specify --module flag in VS Code?

I'm using the brand new Visual Studio Code editor for some TypeScript. And, trying to import some classes from a d.ts like this:

import Polygon = require('esri/geometry/Polygon');

But, I'm getting a red squiggly that says:

Cannot compile external dependencies unless the --module flag is provided

My question is, where do I provide that flag? I believe it's a flag to the TypeScript compiler. In Visual Studio, it's a checkbox on the project. But in Code, I can't find any editor setting for that.

like image 645
AJ Morris Avatar asked Apr 30 '15 00:04

AJ Morris


People also ask

How do I load only the modules specified in the symbol?

To load only modules you specify from the symbol file locations, select Load only specified modules. Select Specify included modules, select the + icon, type the names of the modules to include, and then select OK. The symbol files for other modules are not loaded.

Where are the symbol files located when debugging managed code?

When debugging managed code on a remote device, all symbol files must be located either on the local machine, or in a location specified in the debugger options. The debugger also searches for symbol files in the following locations: The location that is specified inside the DLL or the executable ( .exe)...

How to work with symbols in the module window?

Work with symbols in the Modules window Option Description Load Symbols Appears for modules with skipped, not fo ... Symbol Load Information Shows the location of a loaded symbol fi ... Symbol Settings Opens the Options > Debugging > Symbols ... Always Load Automatically

How do I debug symbols in Visual Studio Code?

On the Tools > Options > Debugging > Symbols page, you can: Specify and select search paths and symbol servers for Microsoft, Windows, or third-party components. Specify modules that you do or don't want the debugger to automatically load symbols for. Change these settings while you are actively debugging.


2 Answers

I just want to call out the fact that restarting the editor is an important step. I created a tsconfig.json and bashed my head against the wall for a while before I noticed the comment by antfx, and sure enough, restarting VS Code solved the problem.

like image 65
arolson101 Avatar answered Oct 21 '22 13:10

arolson101


But in Code, I can't find any editor setting for that.

You need to use tsconfig.json : https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md

like image 26
basarat Avatar answered Oct 21 '22 13:10

basarat