resharper-unity icon indicating copy to clipboard operation
resharper-unity copied to clipboard

Rider - Unity shader code completion doesn't work outside CGPROGRAM/ENDCG field

Open Wax8426 opened this issue 4 years ago • 5 comments

Hi, Just start using Rider for unity coding and pretty cool on C# coding, but when I try on shader, the code completion doesn't work outside the field of CGPROGRAM/ENDCG.

For instance, the Properties block, all the type of data can't be auto-completed. image

And: #pragma vertex vert / #pragma fragment frag the "#pragma" can be recognized, but the "vertex" and "fragment" can't be.

image

I read the manual of Rider on the official site and I found the image on the manual shows this should be working.

is there any settings I didn't finish?

Here is the system info: JetBrains Rider 2021.2.2 Build #RD-212.5284.64, built on October 9, 2021 Licensed to Rider Evaluator Expiration date: November 8, 2021 Runtime version: 11.0.12+7-b1504.28 x86_64 VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o. macOS 11.5.2 .NET 5.0.7 GC: G1 Young Generation, G1 Old Generation Memory: 1500M

Unity: 2020.3 LTS, JetBrains Rider Editor : 3.0.7 image

Thanks a lot!

Wax8426 avatar Oct 18 '21 09:10 Wax8426

The completion in the ShaderLab parts of a .shader file are not as advanced as inside the CGPROGRAM/ENDCG blocks. The only completion available is for completion of properties in blocks such as Blend [_MyVar]. Rider will provide completion, find usages and rename of the _MyVar property. We hope to offer more advanced completion of keywords, property types and so on in a future version.

With #pragma vertex and #pragma fragment, is the problem that vertex and fragment aren't being shown in code completion, or something else?

citizenmatt avatar Oct 22 '21 09:10 citizenmatt

What's your point? That's VSCode, not Rider. It's showing simple word completion, rather than smart IDE completion. As I've already mentioned, ShaderLab support is limited, and doesn't support completion other than property references such as for _MyColor in something like Blend [_MyColor] (but it also supports ctrl+click navigation, find usages, context highlighting and rename, which is more than VSCode does, which is suggesting COLOR11 in a location where it's not valid)

Again, as I mentioned above, there's no completion for the vertex or fragment keywords inside the CG block, but there is code completion for lots of other things, plus full semantic highlighting, find usages, inspections, quick fixes, refactoring, etc. As far as I'm aware TEXCOORD isn't valid at that location, so that code completion isn't helpful.

Is it only the vertex and fragment keywords missing, or is there anything else? Can you complete float4 for example?

citizenmatt avatar Oct 22 '21 15:10 citizenmatt

Hi i know this is old, but is there roadmap on shaderlab support on three render pipeline, i am plan to purchase subs for next months but if there is no planned to enhance this its sadly and i might to have to go to other options.

sdb7 avatar Jun 18 '22 03:06 sdb7

@sdb7 hi. Could you explain a bit more about "three render pipeline" please?

citizenmatt avatar Jun 18 '22 08:06 citizenmatt

@citizenmatt hi matt, what i meant is the shader in built in, URP, HDR pipeline those three had their way of write things, some keyword is cannot used on one of pipeline and some can it will be great if warning displayed etc.

sdb7 avatar Jun 30 '22 07:06 sdb7