Matching "crontab" strings from a C# attribute #260
-
I had an idea to build a VSIX that interpreted the "crontab" string (eg. as used in an Azure Function Timer Trigger) and provided an explanation of the time string. eg. the [FunctionName("TimerTriggerCSharp")]
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log)
{
if (myTimer.IsPastDue)
{
log.LogInformation("Timer is running late!");
}
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
} I'm guessing I need to create a classifier to match the string, but just wondering what's going to be the most efficient way of doing that? Looking for the "TimerTrigger" string prefix, or can I make use of Roslyn somehow to match the attribute? |
Beta Was this translation helpful? Give feedback.
Answered by
madskristensen
Jan 13, 2022
Replies: 1 comment
-
I think a simple regex would do the trick just fine |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
flcdrg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think a simple regex would do the trick just fine