Skip to content

Commit 4aee006

Browse files
[dotnet] Apply formatting on internal CDP generator (#15049)
1 parent d457c4e commit 4aee006

26 files changed

+155
-362
lines changed

third_party/dotnet/devtools/src/generator/CodeGen/CodeGenerationDefinitionTemplateSettings.cs

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public CodeGenerationDefinitionTemplateSettings()
1616
OutputPath = "{{domainName}}\\{{className}}Adapter.cs",
1717
};
1818

19-
CommandTemplate = new CodeGenerationTemplateSettings {
19+
CommandTemplate = new CodeGenerationTemplateSettings
20+
{
2021
TemplatePath = "command.hbs",
2122
OutputPath = "{{domainName}}\\{{className}}Command.cs",
2223
};
@@ -47,46 +48,21 @@ public CodeGenerationDefinitionTemplateSettings()
4748
}
4849

4950
[JsonProperty("domainTemplate")]
50-
public CodeGenerationTemplateSettings DomainTemplate
51-
{
52-
get;
53-
set;
54-
}
51+
public CodeGenerationTemplateSettings DomainTemplate { get; set; }
5552

5653
[JsonProperty("commandTemplate")]
57-
public CodeGenerationTemplateSettings CommandTemplate
58-
{
59-
get;
60-
set;
61-
}
54+
public CodeGenerationTemplateSettings CommandTemplate { get; set; }
6255

6356
[JsonProperty("eventTemplate")]
64-
public CodeGenerationTemplateSettings EventTemplate
65-
{
66-
get;
67-
set;
68-
}
57+
public CodeGenerationTemplateSettings EventTemplate { get; set; }
6958

7059
[JsonProperty("typeObjectTemplate")]
71-
public CodeGenerationTemplateSettings TypeObjectTemplate
72-
{
73-
get;
74-
set;
75-
}
60+
public CodeGenerationTemplateSettings TypeObjectTemplate { get; set; }
7661

7762
[JsonProperty("typeHashTemplate")]
78-
public CodeGenerationTemplateSettings TypeHashTemplate
79-
{
80-
get;
81-
set;
82-
}
63+
public CodeGenerationTemplateSettings TypeHashTemplate { get; set; }
8364

8465
[JsonProperty("typeEnumTemplate")]
85-
public CodeGenerationTemplateSettings TypeEnumTemplate
86-
{
87-
get;
88-
set;
89-
}
90-
66+
public CodeGenerationTemplateSettings TypeEnumTemplate { get; set; }
9167
}
9268
}
Lines changed: 9 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
1+
namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
22
{
33
using Newtonsoft.Json;
44
using System.Collections.Generic;
@@ -27,74 +27,42 @@ public CodeGenerationSettings()
2727
/// Collection of templates that will be parsed and output in the target folder.
2828
/// </summary>
2929
[JsonProperty("include")]
30-
public ICollection<CodeGenerationTemplateSettings> Include
31-
{
32-
get;
33-
set;
34-
}
30+
public ICollection<CodeGenerationTemplateSettings> Include { get; set; }
3531

3632
/// <summary>
3733
/// Indicates whether or not domains marked as depreciated will be generated. (Default: true)
3834
/// </summary>
3935
[JsonProperty("includeDeprecatedDomains")]
40-
public bool IncludeDeprecatedDomains
41-
{
42-
get;
43-
set;
44-
}
36+
public bool IncludeDeprecatedDomains { get; set; }
4537

4638
/// <summary>
4739
/// Indicates whether or not domains marked as depreciated will be generated. (Default: true)
4840
/// </summary>
4941
[JsonProperty("includeExperimentalDomains")]
50-
public bool IncludeExperimentalDomains
51-
{
52-
get;
53-
set;
54-
}
42+
public bool IncludeExperimentalDomains { get; set; }
5543

5644
/// <summary>
5745
/// Gets or sets the root namespace of generated classes.
5846
/// </summary>
5947
[JsonProperty("rootNamespace")]
60-
public string RootNamespace
61-
{
62-
get;
63-
set;
64-
}
48+
public string RootNamespace { get; set; }
6549

6650
/// <summary>
6751
/// Gets the version number of the runtime.
6852
/// </summary>
6953
[JsonProperty("runtimeVersion")]
70-
public string RuntimeVersion
71-
{
72-
get;
73-
set;
74-
}
54+
public string RuntimeVersion { get; set; }
7555

7656
[JsonProperty("definitionTemplates")]
77-
public CodeGenerationDefinitionTemplateSettings DefinitionTemplates
78-
{
79-
get;
80-
set;
81-
}
57+
public CodeGenerationDefinitionTemplateSettings DefinitionTemplates { get; set; }
8258

8359
[JsonProperty("templatesPath")]
84-
public string TemplatesPath
85-
{
86-
get;
87-
set;
88-
}
60+
public string TemplatesPath { get; set; }
8961

9062
/// <summary>
9163
/// The using statements that will be included on each generated file.
9264
/// </summary>
9365
[JsonProperty("usingStatements")]
94-
public ICollection<string> UsingStatements
95-
{
96-
get;
97-
set;
98-
}
66+
public ICollection<string> UsingStatements { get; set; }
9967
}
10068
}

third_party/dotnet/devtools/src/generator/CodeGen/CodeGenerationTemplateSettings.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,9 @@ namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
88
public class CodeGenerationTemplateSettings
99
{
1010
[JsonProperty("templatePath")]
11-
public string TemplatePath
12-
{
13-
get;
14-
set;
15-
}
11+
public string TemplatePath { get; set; }
1612

1713
[JsonProperty("outputPath")]
18-
public string OutputPath
19-
{
20-
get;
21-
set;
22-
}
14+
public string OutputPath { get; set; }
2315
}
2416
}

third_party/dotnet/devtools/src/generator/CodeGen/CodeGeneratorBase.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,17 @@ public abstract class CodeGeneratorBase<T> : ICodeGenerator<T>
1919
/// <summary>
2020
/// Gets the service provider associated with the generator.
2121
/// </summary>
22-
public IServiceProvider ServiceProvider
23-
{
24-
get { return m_serviceProvider; }
25-
}
22+
public IServiceProvider ServiceProvider => m_serviceProvider;
2623

2724
/// <summary>
2825
/// Gets the code generation settings associated with the generator.
2926
/// </summary>
30-
public CodeGenerationSettings Settings
31-
{
32-
get { return m_settings.Value; }
33-
}
27+
public CodeGenerationSettings Settings => m_settings.Value;
3428

3529
/// <summary>
3630
/// Gets a template manager associated with the generator.
3731
/// </summary>
38-
public TemplatesManager TemplatesManager
39-
{
40-
get { return m_templatesManager.Value; }
41-
}
32+
public TemplatesManager TemplatesManager => m_templatesManager.Value;
4233

4334
protected CodeGeneratorBase(IServiceProvider serviceProvider)
4435
{

third_party/dotnet/devtools/src/generator/CodeGen/CodeGeneratorContext.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@ namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
88
/// </summary>
99
public sealed class CodeGeneratorContext
1010
{
11-
public DomainDefinition Domain
12-
{
13-
get;
14-
set;
15-
}
11+
public DomainDefinition Domain { get; set; }
1612

17-
public Dictionary<string, TypeInfo> KnownTypes
18-
{
19-
get;
20-
set;
21-
}
13+
public Dictionary<string, TypeInfo> KnownTypes { get; set; }
2214
}
2315
}

third_party/dotnet/devtools/src/generator/CodeGen/CommandGenerator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ public override IDictionary<string, string> GenerateCode(CommandDefinition comma
1919
{
2020
var result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
2121

22-
if (String.IsNullOrWhiteSpace(Settings.DefinitionTemplates.CommandTemplate.TemplatePath))
22+
if (string.IsNullOrWhiteSpace(Settings.DefinitionTemplates.CommandTemplate.TemplatePath))
23+
{
2324
return result;
25+
}
2426

2527
var commandGenerator = TemplatesManager.GetGeneratorForTemplate(Settings.DefinitionTemplates.CommandTemplate);
2628

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
1-
namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
1+
namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
22
{
33
/// <summary>
44
/// Represents information about a Chrome Debugger Protocol command.
55
/// </summary>
66
public sealed class CommandInfo
77
{
8-
public string CommandName
9-
{
10-
get;
11-
set;
12-
}
8+
public string CommandName { get; set; }
139

14-
public string FullTypeName
15-
{
16-
get;
17-
set;
18-
}
19-
public string FullResponseTypeName
20-
{
21-
get;
22-
set;
23-
}
10+
public string FullTypeName { get; set; }
11+
12+
public string FullResponseTypeName { get; set; }
2413
}
2514
}

third_party/dotnet/devtools/src/generator/CodeGen/DomainGenerator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public override IDictionary<string, string> GenerateCode(DomainDefinition domain
4545
.ForEach(x => result.Add(x.Key, x.Value));
4646
}
4747

48-
if (String.IsNullOrWhiteSpace(Settings.DefinitionTemplates.DomainTemplate.TemplatePath))
48+
if (string.IsNullOrWhiteSpace(Settings.DefinitionTemplates.DomainTemplate.TemplatePath))
49+
{
4950
return result;
51+
}
5052

5153
var domainGenerator = TemplatesManager.GetGeneratorForTemplate(Settings.DefinitionTemplates.DomainTemplate);
5254

third_party/dotnet/devtools/src/generator/CodeGen/EventGenerator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ public override IDictionary<string, string> GenerateCode(EventDefinition eventDe
1919
{
2020
var result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
2121

22-
if (String.IsNullOrWhiteSpace(Settings.DefinitionTemplates.EventTemplate.TemplatePath))
22+
if (string.IsNullOrWhiteSpace(Settings.DefinitionTemplates.EventTemplate.TemplatePath))
23+
{
2324
return result;
25+
}
2426

2527
var eventGenerator = TemplatesManager.GetGeneratorForTemplate(Settings.DefinitionTemplates.EventTemplate);
2628

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
1+
namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
22
{
33
/// <summary>
44
/// Represents information about a Chrome Debugger Protocol event.
55
/// </summary>
66
public sealed class EventInfo
77
{
8-
public string EventName
9-
{
10-
get;
11-
set;
12-
}
8+
public string EventName { get; set; }
139

14-
public string FullTypeName
15-
{
16-
get;
17-
set;
18-
}
10+
public string FullTypeName { get; set; }
1911
}
2012
}

0 commit comments

Comments
 (0)