typescript-ruby / typescript-rails

An asset pipeline wrapper for the TypeScript language
MIT License
255 stars 29 forks source link

Get path of original file #27

Closed paulrosen closed 9 years ago

paulrosen commented 9 years ago

When requesting a page in the browser, I get an error that looks like this:

/var/folders/9g/ty77r71s6c7g7lbcry0qhg700000gn/T/typescript-node20150528-50625-3fwnnp.ts(108,102): error TS2094: The property 'pss' does not exist on value of type 'Window'.

Is there any way to set this up so that the path of the error is the actual source file (that is, the my_code.ts file)?

Thanks!

amritk commented 9 years ago

@bdrazhzhov In compile.rb, if you could pass ts_path to the Node Compiler, you could then append the filepath to the end of the error message. I don't know if this is the best way, thats why I didn't make a pull request, but thats how I have it going right now

bdrazhzhov commented 9 years ago

I changed output for typescript-node gem when TS compilation error occurs. This output has more information about errors (including original file path). Try it please, it may help.

amritk commented 9 years ago

Strange, I'm running 1.4.1 of that gem and I see

/var/folders/yg/6_7zwgh545xgcz2qd6lpzlyw0000gn/T/typescript-node20150714-5421-14e3265.ts(25,13): error TS1005: ',' expected.
bdrazhzhov commented 9 years ago

I've added this feature in v0.6.1. Now it prints something like following: _Compilation error in file '/path/to/file_with_error.ts': /var/folders/yg/67zwgh545xgcz2qd6lpzlyw0000gn/T/typescript-node20150714-5421-14e3265.ts(14,14): error TS1005: ':' expected.

Please try it.

amritk commented 9 years ago

Works like a beauty now! Thanks