eclipse-typescript icon indicating copy to clipboard operation
eclipse-typescript copied to clipboard

imports not reporting errors

Open mconner opened this issue 9 years ago • 5 comments

I'm using external modules in typescript. I have two imports: import {IDashWidgetData} from '../data/IDashWidgetData'; import {ITabularData} from '../../data/ITabularData';

The files are both in the same directory, and the correct path is the bottom one. However, the top is not reported as an error in the TypeScript editor (1.7.0.v20151201-1631). When actually compiling (command line) , using the typescript compiler, it fails to compile (cannot find module ...). If I get the name wrong (e.g: '../data/IDashWidgetDataZZZ' or '../dataZZZ/IDashWidgetData'), the editor correctly reports it as an error.

Basically, if I give it a path that could be valid, depending on where you start from, then the editor doesn't report it as an error (but the compiler does).

mconner avatar Dec 15 '15 19:12 mconner

Hmm, that's not good. The errors reported by the plug-in are from the TypeScript language services so this might either be a bug in how the service is being used or the service itself. Its likely going to be a while before I'll have a chance to look into this so if you'd like to take a shot at a fix I'd love to take back the PR.

derekcicerone-zz avatar Dec 15 '15 21:12 derekcicerone-zz

@mconner try setting module to commonjs. If that fixes it (starts giving error) report back :rose:

basarat avatar Dec 16 '15 18:12 basarat

@basarat good idea!

derekcicerone-zz avatar Dec 16 '15 19:12 derekcicerone-zz

@basarat I already had "Module code generation:" in Preferences>TypeScript>Compile set to CommonJS. (Sorry for the delayed response. I thought I had responded already.)

mconner avatar Jan 04 '16 15:01 mconner

this appears to be fixed in 1.8

thasner avatar Mar 28 '16 21:03 thasner