Reputation: 7602
I'm experimenting with TypeScript, and I'm using Notepad++ to compose TypeScript, and the NppExec plugin to compile my scripts. Seems like it should work, but there's one very strange problem: NppExec only shows me the output up to the :
before the text of the first warning/error message. For instance, let's say that the compilation output should be this:
C:/temp/tstest/test.ts(26,14): Supplied parameters do not match any signature of call target
C:/temp/tstest/test.ts(33,9): Supplied parameters do not match any signature of call target
What I will see in the NppExec Console window is:
node C:\temp\tstest\node_modules\typescript\bin\tsc.js C:\temp\tstest\test.ts
Process started >>>
C:/temp/tstest/test.ts(26,14): <<< Process finished. (Exit code 1)
================ READY ================
Notice that it terminated the output after the first ):
.
Very interestingly, if I change the JavaScript engine from Node to cscript (Windows Script Host), then it works... but takes forever! Here's what I see if I execute the same command with cscript:
cscript C:\temp\tstest\node_modules\typescript\bin\tsc.js C:\temp\tstest\test.ts
Process started >>>
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
C:/temp/tstest/test.ts(26,14): Supplied parameters do not match any signature of call target
C:/temp/tstest/test.ts(33,9): Supplied parameters do not match any signature of call target
<<< Process finished. (Exit code 1)
================ READY ================
Any suggestions on where to go with this? I'd much rather use Node, as it's much faster...
Here's a video demonstrating all this: http://screencast.com/t/xxgodAU8
Edit: It turns out if you pass the -w
switch (the "watch files and rebuild on change" switch) to tsc.js, it will work when executed by Node... but it doesn't build just once, it continues build and the process won't end until you kill it.
Upvotes: 0
Views: 1344
Reputation: 379
I started a feature request at Codeplex a time ago. Problem seems to be the way how nodejs flushes its buffer. See the discussions at github and codeplex:
http://typescript.codeplex.com/workitem/115
https://github.com/joyent/node/issues/4640#issuecomment-12542632
You may want to vote for the request so its priority goes up.
Upvotes: 0
Reputation: 1031
I started a notepad ++ plugin project. you can find it here: https://github.com/hansrwindhoff/nppPluginTypescript.git
does compile on save and runs js in nodejs
If someone wants to put intelli-sense, that would be great!
There is a syntax coloring xml file at: https://gist.github.com/wate/5077019 this gist is not related to me.
Upvotes: 1
Reputation: 4061
I don't have an answer for you but I could give you some ideas on a plan of attack.
Probably the whole message is being output but some special character or sequence is making Notepad++ stop processing it. Redirect the output to a file to see what's going on there. The hex editor plugin might help. With that knowledge you can pipe the command output through a tool like awk or sed to rewrite the offending bits so Notepad++ likes it.
Upvotes: 0