Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ? as a string literal inside a custom function stops highlighting #10

Open
Kurounin opened this issue Feb 10, 2022 · 1 comment
Open
Labels

Comments

@Kurounin
Copy link

When using ? inside the body of a function the highlighting stops working (it's probably expecting an optional member access):

{{ func customFunc }}
private string _GetNullableValue(string? value, string defaultValue = string.Empty)
{
    return value ?? defaultValue;
}
{{ end }}

public partial class {{ Name }}
{
    {{ customFunc }}
}

Any idea on how to get around this? I can't put the func at the of the file or move it to a separate template file to include it.

@Kurounin
Copy link
Author

I worked around the issue by moving the content of the function to a separate template file and then include the template, since including supports arguments as well, which I needed in my case.

@xoofx xoofx added the question label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants