ShaderGraph #include_with_pragmas for CustomFunction node

I am in the process of updating some ShaderGraph’s that i’ve been using in old projects.

This ShaderGraphs use CustomFunction nodes to import HLSL related to custom lighting, and they include #pragma directives to define custom Keywords that are later enabled/disabled through a custom inspector.

Currently all hlsl files included through the CustomFunction node are added to the shader as simple #include directives. However, in current versions i need #include_with_pragmas for them to work.

I cannot find any option that could allow me to change the way they are included.

Currently my only way to make them work is going to “View Generated Shader”, and make a new .shader after modifying all relevant #include’s to #include_with_pragmas. But it’s awfully inconvenient and has to be done each time i edit them (and for builds, it also has to be done per platform or the code wont be compatible).

Is there any chance that this feature already exists and im just not seeing it?
If not, is this known by the team and done on purpose to avoid some kind of problem? Or could i hope for this to be implemented?

I found a post with a similar issue, and posted a reply with a temporary fix by modifying the ShaderGraph package.