ReSharper 2025.2 Help

ShaderLab 的 EditorConfig 属性:ShaderLab 格式化样式

制表符和缩进

缩进样式

属性名称:

indent_style[resharper_]shaderlab_indent_style

可能的值:

  • tab: 制表符

  • space: 空格

示例:

制表符

something @section scripts { sdsds } something

空格

something @section scripts { sdsds } something

缩进大小

属性名称:

indent_size[resharper_]shaderlab_indent_size

可能的值:

一个整数

示例:

值:0

something @section scripts { sdsds } something

值:1

something @section scripts { sdsds } something

值:2

something @section scripts { sdsds } something

制表符宽度

属性名称:

tab_width[resharper_]shaderlab_tab_width

可能的值:

一个整数

示例:

值:0

something @section scripts { sdsds } something

值:1

something @section scripts { sdsds } something

值:2

something @section scripts { sdsds } something

制表符用于缩进时如何对齐

属性名称:

[resharper_]shaderlab_alignment_tab_fill_style[resharper_]alignment_tab_fill_style

可能的值:

  • use_spaces: 使用空格(在任何制表符大小下看起来都对齐)

  • use_tabs_only: 仅使用制表符(不准确)

  • optimal_fill: 混合使用制表符和空格以实现最佳填充

即使结果缩进过大也要对齐

属性名称:

[resharper_]shaderlab_allow_far_alignment[resharper_]allow_far_alignment

Allow alignment even if construct is located too far to the right, more than 2/3 of `Hard wrap at` limit

可能的值:

true | false

大括号规则

大括号样式

属性名称:

[resharper_]shaderlab_brace_style, [resharper_]shaderlab_brace_style, [resharper_]brace_style, [resharper_]brace_style

可能的值:

  • end_of_line :行尾(K&R 风格)

  • end_of_line_no_space :行尾(无空格)

  • next_line :下一行(BSD 风格)

  • next_line_shifted :下一行缩进(Whitesmiths 风格)

  • next_line_shifted_2 :下一行缩进 2(GNU 风格)

示例:

end_of_line

Shader "Unlit/NewUnlitShader" { Properties { _MainTex ("Texture", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } LOD 100 Pass {} } }

end_of_line_no_space

Shader "Unlit/NewUnlitShader"{ Properties{ _MainTex ("Texture", 2D) = "white" {} } SubShader{ Tags{ "RenderType"="Opaque" } LOD 100 Pass{} } }

下一行

Shader "Unlit/NewUnlitShader" { Properties { _MainTex ("Texture", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } LOD 100 Pass {} } }

下一行缩进

Shader "Unlit/NewUnlitShader" { Properties { _MainTex ("Texture", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } LOD 100 Pass {} } }

下一行缩进 2

Shader "Unlit/NewUnlitShader" { Properties { _MainTex ("Texture", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } LOD 100 Pass {} } }
最后修改日期: 2025年 9月 27日