Search code examples
scriptcs

How to use a custom processor directive in scriptcs?


I've written a custom processor directive for scriptcs based on this answer, but I can't figure out how to make it available for use. I just get the error "Preprocessor directive expected". I'm guessing there's some special way of registering the directive, but I haven't found it yet.

Edit: I added some info to this issue on github.


Solution

  • You need to register the line pre-processor with the services builder and in order to get that done you would need to use a module as explained here.

    Unfortunately right now there is not a lot of documentation available on using modules (we plan to improve that some time in the future), but the previous link provides a link to this sample project which you can use as guidance.

    For module development you don't need to install the module globally. You can take advantage of the feature described here. You will need to install the module using -g once you want to use it for real.