Search Unity

Visual Studio comment frustration with .shader files

Discussion in 'Editor & General Support' started by MongooseJV, Jan 26, 2017.

  1. MongooseJV

    MongooseJV

    Joined:
    Feb 25, 2014
    Posts:
    20
    So in VS2015 Community I work with .shader files. I use the Hotkey CNTRL+K+C to comment code quickly. The problem is when I highlight multiple lines and perform the action it does the following:

    Code (CSharp):
    1.             struct v2f
    2.             {
    3.         /*        float2 uv : TEXCOORD0;
    4.                 UNITY_FOG_COORDS(1)
    5.                 floa*/t4 vertex : SV_POSITION;
    6.             };
    Instead of:

    Code (CSharp):
    1.             //struct v2f
    2.             //{
    3.             //    float2 uv : TEXCOORD0;
    4.             //    UNITY_FOG_COORDS(1)
    5.             //    float4 vertex : SV_POSITION;
    6.             //};
    I've researched a bit about this before but still cannot find a great solution. I have the Tools for Unity extension enabled and have even tried the Shader extension that is available through the Extensions and Updates. They still perform the same way.

    I know if I highlight ENTIRE lines I won't have this issue but that is not the point. I'm trying to get comments to work just like editing .cs files. You can highlight parts of lines and the entire line will comment out correctly using the double slashes.

    My last attempt I even set up a custom extension and told it to act like c# through the Tools->Options->Text Editor->File Extensions setting. The problem with this is it makes the entire experience like c# which means I get all sorts of Syntax error highlights as you would since it isn't a valid .cs format.

    Has anyone come across this and fixed it??

    Thanks,
    - Jeffrey A Voigt
     
  2. droolz

    droolz

    Joined:
    Apr 29, 2009
    Posts:
    34
  3. droolz

    droolz

    Joined:
    Apr 29, 2009
    Posts:
    34
    Actually, having used this for a while, it's great on < 100 lines, as it gets longer is starts to get really slow... I have a 2000 line cginc file that's basically unusable... :(