提交 2b129de3 编写于 作者: S Sam Harwell

Improve help text for Prefer Braces style

上级 1191414d
......@@ -628,6 +628,76 @@ void M2(string value)
//]
}}
}}
";
private static readonly string s_doNotPreferBraces = $@"
using System;
class Customer
{{
private int Age;
void M1()
{{
//[
// {ServicesVSResources.Allow_colon}
if (test) Console.WriteLine(""Text"");
// {ServicesVSResources.Allow_colon}
if (test)
Console.WriteLine(""Text"");
// {ServicesVSResources.Allow_colon}
if (test)
Console.WriteLine(
""Text"");
// {ServicesVSResources.Allow_colon}
if (test)
{{
Console.WriteLine(
""Text"");
}}
//]
}}
}}
";
private static readonly string s_preferBracesWhenMultiline = $@"
using System;
class Customer
{{
private int Age;
void M1()
{{
//[
// {ServicesVSResources.Allow_colon}
if (test) Console.WriteLine(""Text"");
// {ServicesVSResources.Allow_colon}
if (test)
Console.WriteLine(""Text"");
// {ServicesVSResources.Prefer_colon}
if (test)
{{
Console.WriteLine(
""Text"");
}}
//]
}}
void M2()
{{
//[
// {ServicesVSResources.Over_colon}
if (test)
Console.WriteLine(
""Text"");
//]
}}
}}
";
private static readonly string s_preferBraces = $@"
......@@ -643,7 +713,7 @@ void M1()
// {ServicesVSResources.Prefer_colon}
if (test)
{{
this.Display();
Console.WriteLine(""Text"");
}}
//]
}}
......@@ -652,7 +722,7 @@ void M2()
//[
// {ServicesVSResources.Over_colon}
if (test)
this.Display();
Console.WriteLine(""Text"");
//]
}}
}}
......@@ -1467,7 +1537,7 @@ private void AddBracesOptions(OptionSet optionSet, string bracesPreferenceGroupT
CSharpCodeStyleOptions.PreferBraces,
ServicesVSResources.Prefer_braces,
enumValues,
new[] { s_preferBraces, s_preferBraces, s_preferBraces },
new[] { s_preferBraces, s_doNotPreferBraces, s_preferBracesWhenMultiline },
this, optionSet, bracesPreferenceGroupTitle, bracesPreferences));
}
......
......@@ -19,7 +19,7 @@ namespace Microsoft.VisualStudio.LanguageServices {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class ServicesVSResources {
......@@ -206,6 +206,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Allow:.
/// </summary>
internal static string Allow_colon {
get {
return ResourceManager.GetString("Allow_colon", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Always for clarity.
/// </summary>
......
......@@ -1114,4 +1114,7 @@ I agree to all of the foregoing:</value>
<data name="Value_returned_by_invocation_is_implicitly_ignored" xml:space="preserve">
<value>Value returned by invocation is implicitly ignored</value>
</data>
<data name="Allow_colon" xml:space="preserve">
<value>Allow:</value>
</data>
</root>
\ No newline at end of file
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Vždy kvůli srozumitelnosti</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Immer zur besseren Unterscheidung</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Siempre por claridad</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Toujours pour plus de clarté</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Sempre per chiarezza</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">わかりやすくするために常に</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">명확하게 하기 위해 항상</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Zawsze w celu zachowania jednoznaczności</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Sempre para esclarecimento</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Всегда использовать для ясности</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">Açıklık sağlamak için her zaman</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">为始终保持清楚起见</target>
......
......@@ -7,6 +7,11 @@
<target state="new">All methods</target>
<note />
</trans-unit>
<trans-unit id="Allow_colon">
<source>Allow:</source>
<target state="new">Allow:</target>
<note />
</trans-unit>
<trans-unit id="Always_for_clarity">
<source>Always for clarity</source>
<target state="translated">一律使用以明確表示</target>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册