Pregunta

That's my setup. VS 2013, with the Node JS Tools, and Typescript. Adding a .ts file is handled without a hiccup. I am having some issues with the npm integration, but I've been able to work around them.

I've also added EdgeJS. It doesn't yet support TypeScript but I just write my EdgeJS calls with regular JS in my TS files. The problem is that EdgeJS allos you to write your CS functions a few different ways.

One way is like the following, where the entire body is enclosed in a comment block:

var hello = edge.func(function () {/*
    async(input) => {
      return ".NET welcomes " + input.ToString();
    }
*/});

Unfortunately, the TS compiler, by default, removes these comments and I can't find a way in this project type to change that behavior.

Am I just out of luck (for now)?

¿Fue útil?

Solución

To preserve comments for TypeScript, you'll need to start them on a new line. In the example you provided, the multi-line comment is not preserved as it starts on the end of a line with code.

Simply move the block comment start:

var edge = edge.func(() => {
    /*
      async(input) => {

      }
    */
});
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top