madskristensen/WebEssentials2013 — pull request #659 by aaronpowell (2014-02-16 10:28:10+00:00)
Title: [WIP] Sweet.js compiler

_Note: This isn't ready to be merged, I'm just wanting some early feedback._

This is an editor for [Sweet.js](http://sweetjs.org), which adds macro support to JavaScript through a compiler step.

So far I've:

* Created a compiler (using the CoffeeScript one as the reference)
* Created a settings section
* Created a unit test (which is failing and I don't understand why at the moment)

I haven't been able to actually use this in Visual Studio yet as I'm assuming I need to create an item template, but I'm not really sure the way it needs to be structured, particularly in relation to the `[ContentType]` attribute (since the CoffeeScript one comes from within VS itself). If someone can point me to what needs to be done, I've added Side Waffle and created an item template but it still doesn't seem right, that'd be ace so I can run through it.

Also the test is failing like this:

Result Message:
Test method WebEssentialsTests.Tests.NodeExecutors.SweetjsCompilationTests.SweetjsBasicCompilationTest threw exception:
System.Runtime.InteropServices.ExternalException: module.js:340
throw err;
^
Error: Cannot find module './core.json'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:\_Projects\github\WebEssentials2013\WebEssentialsTests\bin\Debug\Resources\nodejs\tools\node_modules\resolve\lib\core.js:1:80)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
Result StackTrace:
at WebEssentialsTests.Extensions.d__0.MoveNext() in c:\_Projects\github\WebEssentials2013\WebEssentialsTests\Extensions.cs:line 37
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at WebEssentialsTests.Tests.NodeExecutors.SweetjsCompilationTests.d__1.MoveNext() in c:\_Projects\github\WebEssentials2013\WebEssentialsTests\Tests\NodeExecutors\SweetjsCompilationTests.cs:line 38
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()

But using the compiler from the CLI (the `sjs` compiler) it works fine, even using the `node.exe` that's been installed with my WebEssentials clone (`v0.10.22`, but I've also tried with `v0.10.24`), so again if someone can spot the issue that'd be ace.

Anyway, send the feedback!