diff --git a/.editorconfig b/.editorconfig
index b8bc2f73c..5ced2cd30 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,5 +1,327 @@
root = true
+###############################
+# Core EditorConfig Options #
+###############################
+
+[*]
+indent_style = space
+indent_size = 4
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.{xml,csproj,props,targets,slnx,json,yml,yaml}]
+indent_size = 2
+
+[*.md]
+trim_trailing_whitespace = false
+
+###############################
+# .NET / C# Code Style #
+###############################
+
[*.cs]
+
+#### Organize usings ####
+dotnet_sort_system_directives_first = true
+dotnet_separate_import_directive_groups = false
+
+#### this. and Me. preferences ####
+dotnet_style_qualification_for_field = false:warning
+dotnet_style_qualification_for_property = false:warning
+dotnet_style_qualification_for_method = false:warning
+dotnet_style_qualification_for_event = false:warning
+
+#### Language keywords vs BCL types preferences ####
+dotnet_style_predefined_type_for_locals_parameters_members = true:warning
+dotnet_style_predefined_type_for_member_access = true:warning
+
+#### Parentheses preferences ####
+dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
+dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
+dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
+dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
+
+#### Modifier preferences ####
+dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
+
+#### Expression-level preferences ####
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_explicit_tuple_names = true:warning
+dotnet_style_prefer_inferred_tuple_names = true:suggestion
+dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
+dotnet_style_prefer_auto_properties = true:suggestion
+dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
+dotnet_style_prefer_conditional_expression_over_return = true:suggestion
+dotnet_style_prefer_compound_assignment = true:suggestion
+dotnet_style_prefer_simplified_interpolation = true:suggestion
+dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
+
+#### Null-checking preferences ####
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
+
+#### File header ####
+file_header_template = Copyright (c) GraphZen LLC. All rights reserved.\nLicensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
+
+###############################
+# C# Code Style Rules #
+###############################
+
+#### var preferences ####
+csharp_style_var_for_built_in_types = true:suggestion
+csharp_style_var_when_type_is_apparent = true:suggestion
+csharp_style_var_elsewhere = true:suggestion
+
+#### Expression-bodied members ####
+csharp_style_expression_bodied_methods = true:suggestion
+csharp_style_expression_bodied_constructors = true:suggestion
+csharp_style_expression_bodied_operators = true:suggestion
+csharp_style_expression_bodied_properties = true:suggestion
+csharp_style_expression_bodied_indexers = true:suggestion
+csharp_style_expression_bodied_accessors = true:suggestion
+csharp_style_expression_bodied_lambdas = true:silent
+csharp_style_expression_bodied_local_functions = true:suggestion
+
+#### Pattern matching preferences ####
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
+csharp_style_prefer_switch_expression = true:suggestion
+csharp_style_prefer_pattern_matching = true:suggestion
+csharp_style_prefer_not_pattern = true:suggestion
+
+#### Null-checking preferences ####
+csharp_style_throw_expression = true:suggestion
+csharp_style_conditional_delegate_call = true:suggestion
+
+#### Modifier preferences ####
+csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:warning
+
+#### Code-block preferences ####
+csharp_prefer_braces = true:warning
+csharp_prefer_simple_using_statement = true:suggestion
+csharp_style_namespace_declarations = file_scoped:warning
+
+#### Expression-level preferences ####
+csharp_prefer_simple_default_expression = true:suggestion
+csharp_style_prefer_local_over_anonymous_function = true:suggestion
+csharp_style_prefer_index_operator = true:suggestion
+csharp_style_prefer_range_operator = true:suggestion
+csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
+csharp_style_prefer_tuple_swap = true:suggestion
+csharp_style_prefer_utf8_string_literals = true:suggestion
+csharp_style_deconstructed_variable_declaration = true:suggestion
+csharp_style_inlined_variable_declaration = true:suggestion
+csharp_style_unused_value_assignment_preference = discard_variable:suggestion
+csharp_style_unused_value_expression_statement_preference = discard_variable:silent
+csharp_using_directive_placement = outside_namespace:warning
+
+###############################
+# C# Formatting Rules #
+###############################
+
+#### New line preferences ####
+csharp_new_line_before_open_brace = all
+csharp_new_line_before_else = true
+csharp_new_line_before_catch = true
+csharp_new_line_before_finally = true
+csharp_new_line_before_members_in_object_initializers = true
+csharp_new_line_before_members_in_anonymous_types = true
+csharp_new_line_between_query_expression_clauses = true
+
+#### Indentation preferences ####
+csharp_indent_case_contents = true
+csharp_indent_switch_labels = true
+csharp_indent_labels = one_less_than_current
+csharp_indent_block_contents = true
+csharp_indent_braces = false
+csharp_indent_case_contents_when_block = true
+
+#### Space preferences ####
+csharp_space_after_cast = false
+csharp_space_after_keywords_in_control_flow_statements = true
+csharp_space_between_parentheses = false
+csharp_space_before_colon_in_inheritance_clause = true
+csharp_space_after_colon_in_inheritance_clause = true
+csharp_space_around_binary_operators = before_and_after
+csharp_space_between_method_declaration_parameter_list_parentheses = false
+csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
+csharp_space_between_method_declaration_name_and_open_parenthesis = false
+csharp_space_between_method_call_parameter_list_parentheses = false
+csharp_space_between_method_call_empty_parameter_list_parentheses = false
+csharp_space_between_method_call_name_and_opening_parenthesis = false
+csharp_space_after_comma = true
+csharp_space_before_comma = false
+csharp_space_after_dot = false
+csharp_space_before_dot = false
+csharp_space_after_semicolon_in_for_statement = true
+csharp_space_before_semicolon_in_for_statement = false
+csharp_space_around_declaration_statements = false
+csharp_space_before_open_square_brackets = false
+csharp_space_between_empty_square_brackets = false
+csharp_space_between_square_brackets = false
+
+#### Wrapping preferences ####
+csharp_preserve_single_line_statements = false
+csharp_preserve_single_line_blocks = true
+
+###############################
+# Naming Conventions #
+###############################
+
+#### Naming styles ####
+dotnet_naming_style.pascal_case_style.capitalization = pascal_case
+
+dotnet_naming_style.camel_case_style.capitalization = camel_case
+
+dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case
+dotnet_naming_style.underscore_camel_case_style.required_prefix = _
+
+dotnet_naming_style.interface_style.capitalization = pascal_case
+dotnet_naming_style.interface_style.required_prefix = I
+
+dotnet_naming_style.type_parameter_style.capitalization = pascal_case
+dotnet_naming_style.type_parameter_style.required_prefix = T
+
+#### Naming symbols ####
+dotnet_naming_symbols.interface_symbols.applicable_kinds = interface
+dotnet_naming_symbols.interface_symbols.applicable_accessibilities = *
+
+dotnet_naming_symbols.type_parameter_symbols.applicable_kinds = type_parameter
+dotnet_naming_symbols.type_parameter_symbols.applicable_accessibilities = *
+
+dotnet_naming_symbols.type_symbols.applicable_kinds = class, struct, enum, delegate
+dotnet_naming_symbols.type_symbols.applicable_accessibilities = *
+
+dotnet_naming_symbols.method_symbols.applicable_kinds = method
+dotnet_naming_symbols.method_symbols.applicable_accessibilities = *
+
+dotnet_naming_symbols.property_symbols.applicable_kinds = property, event
+dotnet_naming_symbols.property_symbols.applicable_accessibilities = *
+
+dotnet_naming_symbols.public_field_symbols.applicable_kinds = field
+dotnet_naming_symbols.public_field_symbols.applicable_accessibilities = public, internal, protected, protected_internal
+
+dotnet_naming_symbols.private_field_symbols.applicable_kinds = field
+dotnet_naming_symbols.private_field_symbols.applicable_accessibilities = private, private_protected
+
+dotnet_naming_symbols.private_static_readonly_field_symbols.applicable_kinds = field
+dotnet_naming_symbols.private_static_readonly_field_symbols.applicable_accessibilities = private, private_protected
+dotnet_naming_symbols.private_static_readonly_field_symbols.required_modifiers = static, readonly
+
+dotnet_naming_symbols.private_static_field_symbols.applicable_kinds = field
+dotnet_naming_symbols.private_static_field_symbols.applicable_accessibilities = private, private_protected
+dotnet_naming_symbols.private_static_field_symbols.required_modifiers = static
+
+dotnet_naming_symbols.local_symbols.applicable_kinds = local, parameter
+dotnet_naming_symbols.local_symbols.applicable_accessibilities = *
+
+dotnet_naming_symbols.local_function_symbols.applicable_kinds = local_function
+dotnet_naming_symbols.local_function_symbols.applicable_accessibilities = *
+
+dotnet_naming_symbols.const_field_symbols.applicable_kinds = field
+dotnet_naming_symbols.const_field_symbols.applicable_accessibilities = *
+dotnet_naming_symbols.const_field_symbols.required_modifiers = const
+
+dotnet_naming_symbols.namespace_symbols.applicable_kinds = namespace
+dotnet_naming_symbols.namespace_symbols.applicable_accessibilities = *
+
+#### Naming rules ####
+dotnet_naming_rule.interfaces_must_be_prefixed.severity = warning
+dotnet_naming_rule.interfaces_must_be_prefixed.symbols = interface_symbols
+dotnet_naming_rule.interfaces_must_be_prefixed.style = interface_style
+
+dotnet_naming_rule.type_parameters_must_be_prefixed.severity = warning
+dotnet_naming_rule.type_parameters_must_be_prefixed.symbols = type_parameter_symbols
+dotnet_naming_rule.type_parameters_must_be_prefixed.style = type_parameter_style
+
+dotnet_naming_rule.types_must_be_pascal_case.severity = warning
+dotnet_naming_rule.types_must_be_pascal_case.symbols = type_symbols
+dotnet_naming_rule.types_must_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_rule.methods_must_be_pascal_case.severity = warning
+dotnet_naming_rule.methods_must_be_pascal_case.symbols = method_symbols
+dotnet_naming_rule.methods_must_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_rule.properties_must_be_pascal_case.severity = warning
+dotnet_naming_rule.properties_must_be_pascal_case.symbols = property_symbols
+dotnet_naming_rule.properties_must_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_rule.const_fields_must_be_pascal_case.severity = warning
+dotnet_naming_rule.const_fields_must_be_pascal_case.symbols = const_field_symbols
+dotnet_naming_rule.const_fields_must_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_rule.public_fields_must_be_pascal_case.severity = warning
+dotnet_naming_rule.public_fields_must_be_pascal_case.symbols = public_field_symbols
+dotnet_naming_rule.public_fields_must_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_rule.private_static_readonly_fields_must_be_pascal.severity = warning
+dotnet_naming_rule.private_static_readonly_fields_must_be_pascal.symbols = private_static_readonly_field_symbols
+dotnet_naming_rule.private_static_readonly_fields_must_be_pascal.style = pascal_case_style
+
+dotnet_naming_rule.private_static_fields_must_be_underscore_camel.severity = warning
+dotnet_naming_rule.private_static_fields_must_be_underscore_camel.symbols = private_static_field_symbols
+dotnet_naming_rule.private_static_fields_must_be_underscore_camel.style = underscore_camel_case_style
+
+dotnet_naming_rule.private_fields_must_be_underscore_camel.severity = warning
+dotnet_naming_rule.private_fields_must_be_underscore_camel.symbols = private_field_symbols
+dotnet_naming_rule.private_fields_must_be_underscore_camel.style = underscore_camel_case_style
+
+dotnet_naming_rule.locals_must_be_camel_case.severity = warning
+dotnet_naming_rule.locals_must_be_camel_case.symbols = local_symbols
+dotnet_naming_rule.locals_must_be_camel_case.style = camel_case_style
+
+dotnet_naming_rule.local_functions_must_be_pascal_case.severity = warning
+dotnet_naming_rule.local_functions_must_be_pascal_case.symbols = local_function_symbols
+dotnet_naming_rule.local_functions_must_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_rule.namespaces_must_be_pascal_case.severity = warning
+dotnet_naming_rule.namespaces_must_be_pascal_case.symbols = namespace_symbols
+dotnet_naming_rule.namespaces_must_be_pascal_case.style = pascal_case_style
+
+###############################
+# Analyzer Severities #
+###############################
+
# IDE0005: Remove unnecessary using directives
dotnet_diagnostic.IDE0005.severity = warning
+
+# IDE0011: Add braces
+dotnet_diagnostic.IDE0011.severity = warning
+
+# IDE0160/IDE0161: Namespace declaration preferences
+dotnet_diagnostic.IDE0161.severity = warning
+
+# IDE0065: Using directive placement
+dotnet_diagnostic.IDE0065.severity = warning
+
+# IDE0003/IDE0009: this. and Me. preferences
+dotnet_diagnostic.IDE0003.severity = warning
+dotnet_diagnostic.IDE0009.severity = warning
+
+###############################
+# ReSharper Properties #
+###############################
+
+# Trailing comma in multiline lists
+resharper_trailing_comma_in_multiline_lists = true
+
+# Braces for control flow
+resharper_braces_for_for = required
+resharper_braces_for_foreach = required
+resharper_braces_for_while = required
+
+# Abbreviation overrides (allow AST, QL as valid naming)
+resharper_abbreviations = AST QL
+
+###############################
+# Test Projects #
+###############################
+
+[test/**/*.cs]
+
+# Disable naming rules for test projects (tests commonly use snake_case for methods, classes, and fields)
+dotnet_diagnostic.IDE1006.severity = none
diff --git a/.gitattributes b/.gitattributes
index 176a458f9..550914a99 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,4 @@
* text=auto
+
+*.cs text diff=csharp
+*.sh text eol=lf
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2d8af93b9..ca19508e6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,6 +29,9 @@ jobs:
- name: Build
run: dotnet build --no-restore --configuration Release
+ - name: Check formatting
+ run: dotnet format --verify-no-changes --verbosity diagnostic
+
- name: Test
run: dotnet test --no-build --configuration Release --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" --results-directory ./test-results
diff --git a/Directory.Build.props b/Directory.Build.props
index dc1fddb04..5b32da1f5 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -6,6 +6,9 @@
true
latest
enable
+ true
+ true
+ $(NoWarn);CS1591;CS1587
diff --git a/GraphZen.slnx.DotSettings b/GraphZen.slnx.DotSettings
index 39cc135d1..961182d99 100644
--- a/GraphZen.slnx.DotSettings
+++ b/GraphZen.slnx.DotSettings
@@ -1,20 +1,29 @@
-
-
+
+
+
True
-
True
True
True
-
-
-Latest
+
+
+ Latest
+
+
ExplicitlyExcluded
ExplicitlyExcluded
+
+
True
*.Generated_ignore.cs
+
+
SOLUTION
True
+ True
+
+
SUGGESTION
SUGGESTION
SUGGESTION
@@ -33,83 +42,26 @@
SUGGESTION
SUGGESTION
SUGGESTION
- True
+
+
<?xml version="1.0" encoding="utf-16"?><Profile name="GraphZen: Full Cleanup"><XMLReformatCode>True</XMLReformatCode><CppAddOverrideSpecifier>True</CppAddOverrideSpecifier><CppAddTypenameTemplateKeywords>True</CppAddTypenameTemplateKeywords><CppReplaceImportDirective>True</CppReplaceImportDirective><CppRemoveElseKeyword>True</CppRemoveElseKeyword><CppShortenQualifiedName>True</CppShortenQualifiedName><CppDeleteRedundantSpecifier>True</CppDeleteRedundantSpecifier><CppRemoveStatement>True</CppRemoveStatement><CppDeleteRedundantTypenameTemplateKeywords>True</CppDeleteRedundantTypenameTemplateKeywords><CppCStyleToStaticCastDescriptor>True</CppCStyleToStaticCastDescriptor><CppReplaceExpressionWithBooleanConst>True</CppReplaceExpressionWithBooleanConst><CppMakeIfConstexpr>True</CppMakeIfConstexpr><CppMakePostfixOperatorPrefix>True</CppMakePostfixOperatorPrefix><CppChangeSmartPointerToMakeFunction>True</CppChangeSmartPointerToMakeFunction><CppReplaceThrowWithRethrowFix>True</CppReplaceThrowWithRethrowFix><CppReplaceExpressionWithNullptr>True</CppReplaceExpressionWithNullptr><CppSortMemberInitializers>True</CppSortMemberInitializers><CppClangTidyCleanupDescriptor /><CppReformatCode>True</CppReformatCode><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeArgumentsStyle="True" ArrangeCodeBodyStyle="True" ArrangeVarStyle="True" /><RemoveCodeRedundanciesVB>True</RemoveCodeRedundanciesVB><CssAlphabetizeProperties>True</CssAlphabetizeProperties><JsInsertSemicolon>True</JsInsertSemicolon><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><CorrectVariableKindsDescriptor>True</CorrectVariableKindsDescriptor><VariablesToInnerScopesDescriptor>True</VariablesToInnerScopesDescriptor><StringToTemplatesDescriptor>True</StringToTemplatesDescriptor><JsReformatCode>True</JsReformatCode><JsFormatDocComments>True</JsFormatDocComments><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><OptimizeImportsTs>True</OptimizeImportsTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><AsInsteadOfCastTs>True</AsInsteadOfCastTs><HtmlReformatCode>True</HtmlReformatCode><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><VBOptimizeImports>True</VBOptimizeImports><VBShortenReferences>True</VBShortenReferences><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CssReformatCode>True</CssReformatCode><VBReformatCode>True</VBReformatCode><VBFormatDocComments>True</VBFormatDocComments><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSUpdateFileHeader>True</CSUpdateFileHeader><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags></Profile>
GraphZen: Full Cleanup
- Required
- Required
- Required
- ExpressionBody
- ExpressionBody
- ExpressionBody
- ExpressionBody
- FileScoped
- True
+
+
GraphZen.Infrastructure
JetBrains.Annotations
System.Diagnostics.CodeAnalysis
+
+
Copyright (c) GraphZen LLC. All rights reserved.
Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
- AST
- QL
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
- DO_NOTHING
- LIVE_MONITOR
- LIVE_MONITOR
- DO_NOTHING
- LIVE_MONITOR
- LIVE_MONITOR
- LIVE_MONITOR
- LIVE_MONITOR
- LIVE_MONITOR
- LIVE_MONITOR
- LIVE_MONITOR
- LIVE_MONITOR
- DO_NOTHING
- LIVE_MONITOR
+
+
True
+
+
True
True
True
True
- True
\ No newline at end of file
+ True
\ No newline at end of file
diff --git a/examples/SimpleBlog/FakeBlogData.cs b/examples/SimpleBlog/FakeBlogData.cs
index 76ff8f72f..ae08d29e2 100644
--- a/examples/SimpleBlog/FakeBlogData.cs
+++ b/examples/SimpleBlog/FakeBlogData.cs
@@ -1,9 +1,6 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using System.Diagnostics.CodeAnalysis;
-using GraphZen.Infrastructure;
-using JetBrains.Annotations;
using SimpleBlog.Models;
namespace SimpleBlog;
@@ -30,4 +27,4 @@ public static class FakeBlogData
new Comment { Id = 2, PostId = 1, Author = "Syed", Content = "Have you thought about doing a podcast?" },
new Comment { Id = 3, PostId = 2, Author = "Gene", Content = "This was a fun blog post." }
};
-}
\ No newline at end of file
+}
diff --git a/examples/SimpleBlog/Models/Comment.cs b/examples/SimpleBlog/Models/Comment.cs
index c60c9bf44..aea14b295 100644
--- a/examples/SimpleBlog/Models/Comment.cs
+++ b/examples/SimpleBlog/Models/Comment.cs
@@ -1,10 +1,6 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using System.Diagnostics.CodeAnalysis;
-using GraphZen.Infrastructure;
-using JetBrains.Annotations;
-
namespace SimpleBlog.Models;
public class Comment
@@ -13,4 +9,4 @@ public class Comment
public int PostId { get; set; }
public required string Author { get; set; }
public required string Content { get; set; }
-}
\ No newline at end of file
+}
diff --git a/examples/SimpleBlog/Models/Mutation.cs b/examples/SimpleBlog/Models/Mutation.cs
index 1e3e3dc27..a5827935b 100644
--- a/examples/SimpleBlog/Models/Mutation.cs
+++ b/examples/SimpleBlog/Models/Mutation.cs
@@ -1,10 +1,7 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
-using GraphZen.Infrastructure;
-using JetBrains.Annotations;
namespace SimpleBlog.Models;
@@ -44,7 +41,10 @@ public bool Comment(int postId, string author, string comment)
public bool DeleteComment(int id)
{
var commentModel = FakeBlogData.Comments.SingleOrDefault(_ => _.Id == id);
- if (commentModel != null) FakeBlogData.Comments.Remove(commentModel);
+ if (commentModel != null)
+ {
+ FakeBlogData.Comments.Remove(commentModel);
+ }
return true;
}
@@ -52,11 +52,14 @@ public bool DeleteComment(int id)
public bool EditPost(int id, string author, string title, string post)
{
var postModel = FakeBlogData.Posts.SingleOrDefault(_ => _.Id == id);
- if (postModel == null) return false;
+ if (postModel == null)
+ {
+ return false;
+ }
postModel.Author = author;
postModel.Title = title;
postModel.Content = post;
return true;
}
-}
\ No newline at end of file
+}
diff --git a/examples/SimpleBlog/Models/Post.cs b/examples/SimpleBlog/Models/Post.cs
index ae7fd47a8..88d4c2caf 100644
--- a/examples/SimpleBlog/Models/Post.cs
+++ b/examples/SimpleBlog/Models/Post.cs
@@ -1,10 +1,7 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
-using GraphZen.Infrastructure;
-using JetBrains.Annotations;
namespace SimpleBlog.Models;
@@ -17,4 +14,4 @@ public class Post
public required string Author { get; set; }
public required string Content { get; set; }
-}
\ No newline at end of file
+}
diff --git a/examples/SimpleBlog/Models/Query.cs b/examples/SimpleBlog/Models/Query.cs
index 5267f7336..03ce6f9f9 100644
--- a/examples/SimpleBlog/Models/Query.cs
+++ b/examples/SimpleBlog/Models/Query.cs
@@ -1,10 +1,7 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
-using GraphZen.Infrastructure;
-using JetBrains.Annotations;
namespace SimpleBlog.Models;
@@ -13,8 +10,11 @@ public class Query
[Description("Get the latests blog posts")]
public List Posts(int? postId)
{
- if (postId != null) return FakeBlogData.Posts.Where(_ => _.Id == postId.Value).ToList();
+ if (postId != null)
+ {
+ return FakeBlogData.Posts.Where(_ => _.Id == postId.Value).ToList();
+ }
return FakeBlogData.Posts;
}
-}
\ No newline at end of file
+}
diff --git a/examples/SimpleBlog/Program.cs b/examples/SimpleBlog/Program.cs
index d9e5f828e..1de2b57cf 100644
--- a/examples/SimpleBlog/Program.cs
+++ b/examples/SimpleBlog/Program.cs
@@ -1,9 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using System.Diagnostics.CodeAnalysis;
-using GraphZen.Infrastructure;
-using JetBrains.Annotations;
using Serilog;
using Serilog.Events;
@@ -43,4 +40,4 @@ public static int Main(string[] args)
Log.CloseAndFlush();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/AssemblyAttributes.cs b/src/GraphZen.Abstractions/AssemblyAttributes.cs
index e31583bd3..0cee824d3 100644
--- a/src/GraphZen.Abstractions/AssemblyAttributes.cs
+++ b/src/GraphZen.Abstractions/AssemblyAttributes.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Runtime.CompilerServices;
-using GraphZen.Infrastructure;
[assembly: InternalsVisibleTo("GraphZen")]
[assembly: InternalsVisibleTo("GraphZen.Client")]
@@ -36,4 +35,4 @@
[assembly: InternalsVisibleTo("GraphZen.TypeSystem")]
[assembly: InternalsVisibleTo("GraphZen.TypeSystem.Tests")]
[assembly: InternalsVisibleTo("GraphZen.TypeSystem.IntegrationTests")]
-[assembly: InternalsVisibleTo("GraphZen.TypeSystem.FunctionalTests")]
\ No newline at end of file
+[assembly: InternalsVisibleTo("GraphZen.TypeSystem.FunctionalTests")]
diff --git a/src/GraphZen.Abstractions/GraphQLCanBeNullAttribute.cs b/src/GraphZen.Abstractions/GraphQLCanBeNullAttribute.cs
index 7f4441bf6..da0316be8 100644
--- a/src/GraphZen.Abstractions/GraphQLCanBeNullAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLCanBeNullAttribute.cs
@@ -1,11 +1,9 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Parameter)]
public class GraphQLCanBeNullAttribute : Attribute
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLDeprecatedAttribute.cs b/src/GraphZen.Abstractions/GraphQLDeprecatedAttribute.cs
index e40cd527d..d43e0139c 100644
--- a/src/GraphZen.Abstractions/GraphQLDeprecatedAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLDeprecatedAttribute.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.ComponentModel;
-using GraphZen.Infrastructure;
using GraphZen.LanguageModel;
namespace GraphZen;
@@ -39,9 +38,21 @@ public IEnumerable GetDirectiveLocations()
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != GetType()) return false;
+ if (obj is null)
+ {
+ return false;
+ }
+
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
+
+ if (obj.GetType() != GetType())
+ {
+ return false;
+ }
+
return Equals((GraphQLDeprecatedAttribute)obj);
}
@@ -52,4 +63,4 @@ public override int GetHashCode()
return (base.GetHashCode() * 397) ^ (Reason != null ? Reason.GetHashCode() : 0);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLIgnoreAttribute.cs b/src/GraphZen.Abstractions/GraphQLIgnoreAttribute.cs
index e78dd32f4..b18e9fd9d 100644
--- a/src/GraphZen.Abstractions/GraphQLIgnoreAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLIgnoreAttribute.cs
@@ -1,8 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Class |
@@ -10,4 +8,4 @@ namespace GraphZen;
AttributeTargets.Field)]
public class GraphQLIgnoreAttribute : Attribute
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLListItemCanBeNullAttribute.cs b/src/GraphZen.Abstractions/GraphQLListItemCanBeNullAttribute.cs
index b207f67d1..fcd447644 100644
--- a/src/GraphZen.Abstractions/GraphQLListItemCanBeNullAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLListItemCanBeNullAttribute.cs
@@ -1,11 +1,9 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Parameter)]
public class GraphQLListItemCanBeNullAttribute : Attribute
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLListItemNonNullAttribute.cs b/src/GraphZen.Abstractions/GraphQLListItemNonNullAttribute.cs
index a534a1d03..8d7ee8d65 100644
--- a/src/GraphZen.Abstractions/GraphQLListItemNonNullAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLListItemNonNullAttribute.cs
@@ -1,11 +1,9 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
[AttributeUsage(AttributeTargets.Property)]
public class GraphQLListItemNonNullAttribute : Attribute
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLNameAttribute.cs b/src/GraphZen.Abstractions/GraphQLNameAttribute.cs
index 8e97f6a91..a6907bdb7 100644
--- a/src/GraphZen.Abstractions/GraphQLNameAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLNameAttribute.cs
@@ -18,4 +18,4 @@ public class GraphQLNameAttribute : Attribute
public string Name { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLNonNullAttribute.cs b/src/GraphZen.Abstractions/GraphQLNonNullAttribute.cs
index db62b5c66..6a46971f0 100644
--- a/src/GraphZen.Abstractions/GraphQLNonNullAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLNonNullAttribute.cs
@@ -1,11 +1,9 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
[AttributeUsage(AttributeTargets.Property)]
public class GraphQLNonNullAttribute : Attribute
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLObjectAttribute.cs b/src/GraphZen.Abstractions/GraphQLObjectAttribute.cs
index 1a6af60e6..4a6c61e8b 100644
--- a/src/GraphZen.Abstractions/GraphQLObjectAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLObjectAttribute.cs
@@ -1,11 +1,9 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
[AttributeUsage(AttributeTargets.Class)]
public class GraphQLObjectAttribute : Attribute
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLTypeAttribute.cs b/src/GraphZen.Abstractions/GraphQLTypeAttribute.cs
index 7f8e37588..0b521d85d 100644
--- a/src/GraphZen.Abstractions/GraphQLTypeAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLTypeAttribute.cs
@@ -10,4 +10,4 @@ public class GraphQLTypeAttribute : Attribute
public GraphQLTypeAttribute(Type clrType) => ClrType = Check.NotNull(clrType, nameof(clrType));
public Type ClrType { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/GraphQLUnionAttribute.cs b/src/GraphZen.Abstractions/GraphQLUnionAttribute.cs
index 60ca142ec..4d7e4c310 100644
--- a/src/GraphZen.Abstractions/GraphQLUnionAttribute.cs
+++ b/src/GraphZen.Abstractions/GraphQLUnionAttribute.cs
@@ -1,11 +1,9 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
[AttributeUsage(AttributeTargets.Interface)]
public class GraphQLUnionAttribute : Attribute
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/IGraphQLDirective.cs b/src/GraphZen.Abstractions/IGraphQLDirective.cs
index b9d3dd2dc..aac2a7d6d 100644
--- a/src/GraphZen.Abstractions/IGraphQLDirective.cs
+++ b/src/GraphZen.Abstractions/IGraphQLDirective.cs
@@ -1,7 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
using GraphZen.LanguageModel;
namespace GraphZen;
@@ -9,4 +8,4 @@ namespace GraphZen;
public interface IGraphQLDirective
{
IEnumerable GetDirectiveLocations();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/Infrastructure/Check.cs b/src/GraphZen.Abstractions/Infrastructure/Check.cs
index df6e65a93..fccdca7bc 100644
--- a/src/GraphZen.Abstractions/Infrastructure/Check.cs
+++ b/src/GraphZen.Abstractions/Infrastructure/Check.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Diagnostics;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -11,9 +10,13 @@ internal static class Check
{
[ContractAnnotation("value:null => halt")]
[return: NotNull]
- public static T NotNull([NotNull] [NoEnumeration] T value, [InvokerParameterName] string parameterName)
+ public static T NotNull([NotNull][NoEnumeration] T value, [InvokerParameterName] string parameterName)
{
- if (value is null) throw new ArgumentNullException(parameterName);
+ if (value is null)
+ {
+ throw new ArgumentNullException(parameterName);
+ }
+
return value;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Abstractions/LanguageModel/DirectiveLocation.cs b/src/GraphZen.Abstractions/LanguageModel/DirectiveLocation.cs
index 110fcec7e..d3340ebc0 100644
--- a/src/GraphZen.Abstractions/LanguageModel/DirectiveLocation.cs
+++ b/src/GraphZen.Abstractions/LanguageModel/DirectiveLocation.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.ComponentModel;
-using GraphZen.Infrastructure;
namespace GraphZen.LanguageModel;
@@ -13,57 +12,75 @@ namespace GraphZen.LanguageModel;
[GraphQLName("__DirectiveLocation")]
public enum DirectiveLocation
{
- [Description("Location adjacent to a query operation.")] [GraphQLName("QUERY")]
+ [Description("Location adjacent to a query operation.")]
+ [GraphQLName("QUERY")]
Query,
- [Description("Location adjacent to a mutation operation.")] [GraphQLName("MUTATION")]
+ [Description("Location adjacent to a mutation operation.")]
+ [GraphQLName("MUTATION")]
Mutation,
- [Description("Location adjacent to a subscription operation.")] [GraphQLName("SUBSCRIPTION")]
+ [Description("Location adjacent to a subscription operation.")]
+ [GraphQLName("SUBSCRIPTION")]
Subscription,
- [Description("Location adjacent to a field.")] [GraphQLName("FIELD")]
+ [Description("Location adjacent to a field.")]
+ [GraphQLName("FIELD")]
Field,
- [Description("Location adjacent to a fragment definition.")] [GraphQLName("FRAGMENT_DEFINITION")]
+ [Description("Location adjacent to a fragment definition.")]
+ [GraphQLName("FRAGMENT_DEFINITION")]
FragmentDefinition,
- [Description("Location adjacent to a fragment spread.")] [GraphQLName("FRAGMENT_SPREAD")]
+ [Description("Location adjacent to a fragment spread.")]
+ [GraphQLName("FRAGMENT_SPREAD")]
FragmentSpread,
- [Description("Location adjacent to an inline fragment.")] [GraphQLName("INLINE_FRAGMENT")]
+ [Description("Location adjacent to an inline fragment.")]
+ [GraphQLName("INLINE_FRAGMENT")]
InlineFragment,
- [Description("Location adjacent to a schema definition.")] [GraphQLName("SCHEMA")]
+ [Description("Location adjacent to a schema definition.")]
+ [GraphQLName("SCHEMA")]
Schema,
- [Description("Location adjacent to a scalar definition.")] [GraphQLName("SCALAR")]
+ [Description("Location adjacent to a scalar definition.")]
+ [GraphQLName("SCALAR")]
Scalar,
- [Description("Location adjacent to an object type definition.")] [GraphQLName("OBJECT")]
+ [Description("Location adjacent to an object type definition.")]
+ [GraphQLName("OBJECT")]
Object,
- [Description("Location adjacent to a field Definition.")] [GraphQLName("FIELD_DEFINITION")]
+ [Description("Location adjacent to a field Definition.")]
+ [GraphQLName("FIELD_DEFINITION")]
FieldDefinition,
- [Description("Location adjacent to an argument definition.")] [GraphQLName("ARGUMENT_DEFINITION")]
+ [Description("Location adjacent to an argument definition.")]
+ [GraphQLName("ARGUMENT_DEFINITION")]
ArgumentDefinition,
- [Description("Location adjacent to an interface definition.")] [GraphQLName("INTERFACE")]
+ [Description("Location adjacent to an interface definition.")]
+ [GraphQLName("INTERFACE")]
Interface,
- [Description("Location adjacent to a union Definition.")] [GraphQLName("UNION")]
+ [Description("Location adjacent to a union Definition.")]
+ [GraphQLName("UNION")]
Union,
- [Description("Location adjacent to an enum definition.")] [GraphQLName("ENUM")]
+ [Description("Location adjacent to an enum definition.")]
+ [GraphQLName("ENUM")]
Enum,
- [Description("Location adjacent to an enum value definition.")] [GraphQLName("ENUM_VALUE")]
+ [Description("Location adjacent to an enum value definition.")]
+ [GraphQLName("ENUM_VALUE")]
EnumValue,
- [Description("Location adjacent to an input object type Definition.")] [GraphQLName("INPUT_OBJECT")]
+ [Description("Location adjacent to an input object type Definition.")]
+ [GraphQLName("INPUT_OBJECT")]
InputObject,
- [Description("Location adjacent to an input object field definition.")] [GraphQLName("INPUT_FIELD_DEFINITION")]
+ [Description("Location adjacent to an input object field definition.")]
+ [GraphQLName("INPUT_FIELD_DEFINITION")]
InputFieldDefinition
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Playground/Playground/CursorShape.cs b/src/GraphZen.AspNetCore.Playground/Playground/CursorShape.cs
index d7d4d172e..a7855ca6b 100644
--- a/src/GraphZen.AspNetCore.Playground/Playground/CursorShape.cs
+++ b/src/GraphZen.AspNetCore.Playground/Playground/CursorShape.cs
@@ -1,8 +1,6 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Playground;
public enum CursorShape
@@ -10,4 +8,4 @@ public enum CursorShape
Line,
Block,
Underline
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Playground/Playground/EditorTheme.cs b/src/GraphZen.AspNetCore.Playground/Playground/EditorTheme.cs
index d9ebd9c74..4183d7cc0 100644
--- a/src/GraphZen.AspNetCore.Playground/Playground/EditorTheme.cs
+++ b/src/GraphZen.AspNetCore.Playground/Playground/EditorTheme.cs
@@ -1,12 +1,10 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Playground;
public enum EditorTheme
{
Dark,
Light
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Playground/Playground/Internal/PlaygroundHtmlWriter.cs b/src/GraphZen.AspNetCore.Playground/Playground/Internal/PlaygroundHtmlWriter.cs
index 9d45f507f..cd1b53f75 100644
--- a/src/GraphZen.AspNetCore.Playground/Playground/Internal/PlaygroundHtmlWriter.cs
+++ b/src/GraphZen.AspNetCore.Playground/Playground/Internal/PlaygroundHtmlWriter.cs
@@ -1,9 +1,8 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Text.Json;
using System.Text.Json.Serialization;
-using GraphZen.Infrastructure;
namespace GraphZen.Playground.Internal;
@@ -33,11 +32,15 @@ public class PlaygroundHtmlWriter
public static string GetHtml(PlaygroundOptions? options = null)
{
- if (options == null) return Html.Value;
+ if (options == null)
+ {
+ return Html.Value;
+ }
+
var html = Html.Value.Replace("var options = {};", $"var options = {GetPlaygroundOptionsJson(options)};");
return html;
}
public static string GetPlaygroundOptionsJson(PlaygroundOptions options) =>
JsonSerializer.Serialize(options, SerializerOptions);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundOptions.cs b/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundOptions.cs
index 009a0d8f0..53b5f06cc 100644
--- a/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundOptions.cs
+++ b/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundOptions.cs
@@ -1,8 +1,6 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Playground;
public class PlaygroundOptions
@@ -11,4 +9,4 @@ public class PlaygroundOptions
public string? SubscriptionEndpoint { get; set; }
public string? WorkspaceName { get; set; }
public PlaygroundSettings Settings { get; set; } = new();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundSettings.cs b/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundSettings.cs
index 6e9d1669b..d09387864 100644
--- a/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundSettings.cs
+++ b/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundSettings.cs
@@ -1,8 +1,7 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Text.Json.Serialization;
-using GraphZen.Infrastructure;
namespace GraphZen.Playground;
@@ -49,4 +48,4 @@ public class PlaygroundSettings
[JsonPropertyName("tracing.hideTracingResponse")]
public bool? HideTracingResponse { get; set; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Playground/Playground/RequestCredentials.cs b/src/GraphZen.AspNetCore.Playground/Playground/RequestCredentials.cs
index d99179e47..f263fd2b9 100644
--- a/src/GraphZen.AspNetCore.Playground/Playground/RequestCredentials.cs
+++ b/src/GraphZen.AspNetCore.Playground/Playground/RequestCredentials.cs
@@ -1,8 +1,6 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Playground;
public enum RequestCredentials
@@ -10,4 +8,4 @@ public enum RequestCredentials
Omit,
Include,
SameOrigin
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Playground/PlaygroundEndpointBuilderExtensions.cs b/src/GraphZen.AspNetCore.Playground/PlaygroundEndpointBuilderExtensions.cs
index ff0523f8e..eb4aa6583 100644
--- a/src/GraphZen.AspNetCore.Playground/PlaygroundEndpointBuilderExtensions.cs
+++ b/src/GraphZen.AspNetCore.Playground/PlaygroundEndpointBuilderExtensions.cs
@@ -1,7 +1,6 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
using GraphZen.Playground;
using GraphZen.Playground.Internal;
using Microsoft.AspNetCore.Http;
@@ -52,4 +51,4 @@ public static IEndpointConventionBuilder MapGraphQLPlayground(this IEndpointRout
var html = PlaygroundHtmlWriter.GetHtml(options);
return endpointRouteBuilder.MapGet(path ?? "/", http => http.Response.WriteAsync(html));
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Server/GraphZenApplicationBuilderExtensions.cs b/src/GraphZen.AspNetCore.Server/GraphZenApplicationBuilderExtensions.cs
index c1a881cd6..c43c04354 100644
--- a/src/GraphZen.AspNetCore.Server/GraphZenApplicationBuilderExtensions.cs
+++ b/src/GraphZen.AspNetCore.Server/GraphZenApplicationBuilderExtensions.cs
@@ -37,7 +37,10 @@ public static string TempDirectory
"ASPNETCORE_TEMP") ?? // ASPNETCORE_TEMP - User set temporary location.
Path.GetTempPath(); // Fall back.
- if (!Directory.Exists(temp)) throw new DirectoryNotFoundException(temp);
+ if (!Directory.Exists(temp))
+ {
+ throw new DirectoryNotFoundException(temp);
+ }
_sTempDirectory = temp;
}
@@ -59,7 +62,9 @@ public static IEndpointConventionBuilder MapGraphQL(this IEndpointRouteBuilder e
var memoryThreshold = DefaultMemoryThreshold;
var contentLength = request.ContentLength.GetValueOrDefault();
if (contentLength > 0 && contentLength < memoryThreshold)
+ {
memoryThreshold = (int)contentLength;
+ }
readStream = new FileBufferingReadStream(request.Body, memoryThreshold, null,
TempDirectoryFactory);
@@ -129,4 +134,4 @@ public static IEndpointConventionBuilder MapGraphQL(this IEndpointRouteBuilder e
await httpContext.Response.WriteAsync(resp);
});
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Server/GraphZenServiceCollectionExtensions.cs b/src/GraphZen.AspNetCore.Server/GraphZenServiceCollectionExtensions.cs
index ee2deff3f..e065b43f9 100644
--- a/src/GraphZen.AspNetCore.Server/GraphZenServiceCollectionExtensions.cs
+++ b/src/GraphZen.AspNetCore.Server/GraphZenServiceCollectionExtensions.cs
@@ -34,7 +34,7 @@ public static void AddGraphQLContext(
optionsAction != null
// ReSharper disable once ConstantConditionalAccessQualifier
? (p, b) => { optionsAction?.Invoke(b); }
- : (Action?)null;
+ : (Action?)null;
var contextType = typeof(TContext);
Logger.Debug($"Adding GraphQL context {contextType}");
@@ -42,8 +42,10 @@ public static void AddGraphQLContext(
{
var declaredConstructors = contextType.GetTypeInfo().DeclaredConstructors.ToList();
if (declaredConstructors.Count == 1 && declaredConstructors[0].GetParameters().Length == 0)
+ {
throw new ArgumentException(
$"{nameof(AddGraphQLContext)} was called with configuration, but the context type '{contextType}' only declares a parameterless constructor. This means that the configuration passed to {nameof(AddGraphQLContext)} will never be used. If configuration is passed to {nameof(AddGraphQLContext)}, then '{contextType}' should declare a constructor that accepts a {nameof(GraphQLContextOptions)}<{contextType.Name}> and must pass it to the base constructor for {nameof(GraphQLContext)}.");
+ }
}
Logger.Debug($"Registering {nameof(GraphQLContextOptions)}");
@@ -75,10 +77,16 @@ public static void AddGraphQLContext(
Logger.Debug("Building temporary service provider");
var context = tempServiceProvider.GetRequiredService();
var queryClrType = context.Schema.QueryType?.ClrType;
- if (queryClrType != null) serviceCollection.TryAddScoped(queryClrType);
+ if (queryClrType != null)
+ {
+ serviceCollection.TryAddScoped(queryClrType);
+ }
var mutationClrType = context.Schema.MutationType?.ClrType;
- if (mutationClrType != null) serviceCollection.TryAddScoped(mutationClrType);
+ if (mutationClrType != null)
+ {
+ serviceCollection.TryAddScoped(mutationClrType);
+ }
}
private static GraphQLContextOptions GraphQLContextOptionsFactory(
@@ -91,4 +99,4 @@ private static GraphQLContextOptions GraphQLContextOptionsFactory? Variables { get; set; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.AspNetCore.Server/PlaygroundApplicationBuilderExtensions.cs b/src/GraphZen.AspNetCore.Server/PlaygroundApplicationBuilderExtensions.cs
index ea587d88c..4d33c4deb 100644
--- a/src/GraphZen.AspNetCore.Server/PlaygroundApplicationBuilderExtensions.cs
+++ b/src/GraphZen.AspNetCore.Server/PlaygroundApplicationBuilderExtensions.cs
@@ -1,7 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
using Microsoft.AspNetCore.StaticFiles.Infrastructure;
using Microsoft.Extensions.FileProviders;
@@ -30,4 +29,4 @@ public static void UseGraphQLPlayground(this IApplicationBuilder app)
};
app.UseStaticFiles(staticFileOptions);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Client/GraphQLClient.cs b/src/GraphZen.Client/GraphQLClient.cs
index 894b8f7dc..b93c045ee 100644
--- a/src/GraphZen.Client/GraphQLClient.cs
+++ b/src/GraphZen.Client/GraphQLClient.cs
@@ -1,4 +1,4 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using GraphZen.Infrastructure;
@@ -20,4 +20,4 @@ public async Task SendAsync(GraphQLRequest request, Cancellatio
}
public Task SendAsync(GraphQLRequest request) => SendAsync(request, default);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Client/GraphQLError.cs b/src/GraphZen.Client/GraphQLError.cs
index 65dcf366f..34d156a2f 100644
--- a/src/GraphZen.Client/GraphQLError.cs
+++ b/src/GraphZen.Client/GraphQLError.cs
@@ -1,4 +1,4 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using GraphZen.Infrastructure;
@@ -14,4 +14,4 @@ public GraphQLError(string message)
}
public string Message { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Client/GraphQLRequest.cs b/src/GraphZen.Client/GraphQLRequest.cs
index 608b1f364..d33ab65ce 100644
--- a/src/GraphZen.Client/GraphQLRequest.cs
+++ b/src/GraphZen.Client/GraphQLRequest.cs
@@ -1,8 +1,6 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
public class GraphQLRequest
@@ -10,4 +8,4 @@ public class GraphQLRequest
public string? OperationName { get; set; }
public string? Query { get; set; }
public object? Variables { get; set; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Client/GraphQLResponse.cs b/src/GraphZen.Client/GraphQLResponse.cs
index 64356d843..59de73281 100644
--- a/src/GraphZen.Client/GraphQLResponse.cs
+++ b/src/GraphZen.Client/GraphQLResponse.cs
@@ -1,7 +1,6 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
using GraphZen.Internal;
namespace GraphZen;
@@ -26,9 +25,13 @@ public GraphQLResponse(string jsonResponse)
public T? GetData() where T : class
{
- if (_typedData.TryGetValue(typeof(T), out var data)) return (T?)data;
+ if (_typedData.TryGetValue(typeof(T), out var data))
+ {
+ return (T?)data;
+ }
+
var parsed = GraphQLJsonSerializer.ParseData(_jsonResponse);
_typedData[typeof(T)] = parsed;
return parsed;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Client/IGraphQLClient.cs b/src/GraphZen.Client/IGraphQLClient.cs
index c29091ec7..2c8d11129 100644
--- a/src/GraphZen.Client/IGraphQLClient.cs
+++ b/src/GraphZen.Client/IGraphQLClient.cs
@@ -1,12 +1,10 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen;
public interface IGraphQLClient
{
Task SendAsync(GraphQLRequest request, CancellationToken cancellationToken);
Task SendAsync(GraphQLRequest request);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Client/Infrastructure/GraphQLRequestExtensions.cs b/src/GraphZen.Client/Infrastructure/GraphQLRequestExtensions.cs
index 340e58769..5a426d1f9 100644
--- a/src/GraphZen.Client/Infrastructure/GraphQLRequestExtensions.cs
+++ b/src/GraphZen.Client/Infrastructure/GraphQLRequestExtensions.cs
@@ -1,9 +1,8 @@
-// Copyright (c) GraphZen LLC. All rights reserved.
+// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Text;
using System.Text.Json;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -13,8 +12,11 @@ public static HttpRequestMessage ToHttpRequest(this GraphQLRequest request)
{
Check.NotNull(request, nameof(request));
if (request.OperationName == null && request.Query == null)
+ {
throw new ArgumentException(
$"Cannot convert {nameof(GraphQLRequest)} to {nameof(HttpRequestMessage)}: query or operation name required.");
+ }
+
var requestJson = JsonSerializer.Serialize(request);
var requestJsonContent = new StringContent(requestJson, Encoding.UTF8, "application/json");
var message = new HttpRequestMessage
@@ -24,4 +26,4 @@ public static HttpRequestMessage ToHttpRequest(this GraphQLRequest request)
};
return message;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Client/Internal/GraphQLJsonSerializer.cs b/src/GraphZen.Client/Internal/GraphQLJsonSerializer.cs
index 649b282e9..12f629117 100644
--- a/src/GraphZen.Client/Internal/GraphQLJsonSerializer.cs
+++ b/src/GraphZen.Client/Internal/GraphQLJsonSerializer.cs
@@ -34,7 +34,10 @@ public static class GraphQLJsonSerializer
doc.RootElement.TryGetProperty("data", out var dataElement))
{
if (dataElement.ValueKind == JsonValueKind.Null)
+ {
return null;
+ }
+
return ConvertJsonElement(dataElement);
}
@@ -65,7 +68,10 @@ public static class GraphQLJsonSerializer
return element.GetString();
case JsonValueKind.Number:
if (element.TryGetInt64(out var longVal))
+ {
return longVal;
+ }
+
return element.GetDouble();
case JsonValueKind.True:
return true;
@@ -111,4 +117,4 @@ private class GraphQLDataJson where T : class
// ReSharper disable once UnusedAutoPropertyAccessor.Local
public T? Data { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.DevCli/CodeGen/CodeGenHelpers.cs b/src/GraphZen.DevCli/CodeGen/CodeGenHelpers.cs
index 70cf7060b..0cbaa9930 100644
--- a/src/GraphZen.DevCli/CodeGen/CodeGenHelpers.cs
+++ b/src/GraphZen.DevCli/CodeGen/CodeGenHelpers.cs
@@ -1,8 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.CodeGen;
public static class CodeGenHelpers
@@ -20,4 +18,4 @@ public static void WriteFile(string path, string contents)
File.AppendAllText(path, contents);
Console.WriteLine(" done)");
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.DevCli/CodeGen/CodeGenStringBuilderExtensions.cs b/src/GraphZen.DevCli/CodeGen/CodeGenStringBuilderExtensions.cs
index d1a3b3fe0..2021c281f 100644
--- a/src/GraphZen.DevCli/CodeGen/CodeGenStringBuilderExtensions.cs
+++ b/src/GraphZen.DevCli/CodeGen/CodeGenStringBuilderExtensions.cs
@@ -43,4 +43,4 @@ public static partial class {classPrefix}{propertyName}AccessorExtensions {{
";
csharp.Append(code);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.DevCli/CodeGen/CodeGenTasks.cs b/src/GraphZen.DevCli/CodeGen/CodeGenTasks.cs
index ba4cf3ced..f79a9d3b2 100644
--- a/src/GraphZen.DevCli/CodeGen/CodeGenTasks.cs
+++ b/src/GraphZen.DevCli/CodeGen/CodeGenTasks.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Text;
-using GraphZen.Infrastructure;
namespace GraphZen.CodeGen;
@@ -92,4 +91,4 @@ namespace GraphZen.TypeSystem {
csharp.Append("}");
CodeGenHelpers.WriteFile("../Linked/TypeSystem/TypeSystemAccessors.Generated.cs", csharp.ToString());
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.DevCli/Program.cs b/src/GraphZen.DevCli/Program.cs
index c33b19593..d57500dbe 100644
--- a/src/GraphZen.DevCli/Program.cs
+++ b/src/GraphZen.DevCli/Program.cs
@@ -4,7 +4,6 @@
using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Invocation;
-using GraphZen.Infrastructure;
using static GraphZen.CodeGen.CodeGenTasks;
namespace GraphZen;
@@ -18,4 +17,4 @@ private static void Main(string[] args)
var cli = cliBuilder.Build();
cli.InvokeAsync(args).Wait();
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/AssemblyAttributes.cs b/src/GraphZen.Infrastructure/AssemblyAttributes.cs
index a2bb9a3f4..7cdcff870 100644
--- a/src/GraphZen.Infrastructure/AssemblyAttributes.cs
+++ b/src/GraphZen.Infrastructure/AssemblyAttributes.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Runtime.CompilerServices;
-using GraphZen.Infrastructure;
[assembly: InternalsVisibleTo("GraphZen.Tests")]
[assembly: InternalsVisibleTo("GraphZen")]
@@ -17,4 +16,4 @@
[assembly: InternalsVisibleTo("GraphZen.QueryEngine")]
[assembly: InternalsVisibleTo("GraphZen.TypeSystem")]
[assembly: InternalsVisibleTo("GraphZen.TypeSystem.Tests")]
-[assembly: InternalsVisibleTo("GraphZen.Playground")]
\ No newline at end of file
+[assembly: InternalsVisibleTo("GraphZen.Playground")]
diff --git a/src/GraphZen.Infrastructure/Infrastructure/AccessorExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/AccessorExtensions.cs
index 93ab6a14e..97ed6c35f 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/AccessorExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/AccessorExtensions.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Diagnostics;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -11,4 +10,4 @@ public static class AccessorExtensions
[DebuggerStepThrough]
public static T GetInfrastructure(this IInfrastructure accessor) =>
Check.NotNull(accessor, nameof(accessor)).Instance;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/DynamicDictionary.cs b/src/GraphZen.Infrastructure/Infrastructure/DynamicDictionary.cs
index 29640074f..f892865e2 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/DynamicDictionary.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/DynamicDictionary.cs
@@ -5,7 +5,6 @@
using System.Diagnostics;
using System.Dynamic;
using System.Text;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -35,7 +34,10 @@ private string DebuggerDisplay
builder.AppendFormat(" {0} = {1}{2}", item.Key, item.Value, i < maxItems - 1 ? "," : string.Empty);
}
- if (maxItems < _dictionary.Count) builder.Append("...");
+ if (maxItems < _dictionary.Count)
+ {
+ builder.Append("...");
+ }
builder.Append(" }");
@@ -242,7 +244,10 @@ public bool Remove(KeyValuePair item)
/// An instance to compare with this instance.
public bool Equals(DynamicDictionary? other)
{
- if (ReferenceEquals(null, other)) return false;
+ if (other is null)
+ {
+ return false;
+ }
return ReferenceEquals(this, other) || Equals(other._dictionary, _dictionary);
}
@@ -309,18 +314,24 @@ public override bool TryGetMember(GetMemberBinder binder, out object result)
public override IEnumerable GetDynamicMemberNames() => _dictionary.Keys;
///
- /// Determines whether the specified is equal to this instance.
+ /// Determines whether the specified is equal to this instance.
///
- /// The to compare with this instance.
+ /// The to compare with this instance.
///
- /// if the specified is equal to this instance; otherwise,
+ /// if the specified is equal to this instance; otherwise,
/// .
///
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj.GetType() == typeof(DynamicDictionary) && Equals((DynamicDictionary)obj);
}
@@ -363,4 +374,4 @@ public Dictionary ToDictionary()
return data;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/Json/JsonNodeExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/Json/JsonNodeExtensions.cs
index 5361550f9..8e79db158 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/Json/JsonNodeExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/Json/JsonNodeExtensions.cs
@@ -3,7 +3,6 @@
using System.Text.Json;
using System.Text.Json.Nodes;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -27,7 +26,10 @@ public static IDictionary ObjectToDictionary(object value)
var json = JsonSerializer.Serialize(value, Json.SerializerOptions);
var node = JsonNode.Parse(json);
if (node is JsonObject jsonObject)
+ {
return jsonObject.ToDictionary();
+ }
+
throw new Exception("Unable to convert object to Dictionary");
}
@@ -57,9 +59,15 @@ private static object ConvertJsonValue(JsonValue value)
return element.GetString()!;
case JsonValueKind.Number:
if (element.TryGetInt32(out var intVal))
+ {
return intVal;
+ }
+
if (element.TryGetInt64(out var longVal))
+ {
return longVal;
+ }
+
return element.GetDouble();
case JsonValueKind.True:
return true;
@@ -71,4 +79,4 @@ private static object ConvertJsonValue(JsonValue value)
return element.ToString();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ConcurrentBagExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ConcurrentBagExtensions.cs
index 60962e568..097cc3177 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ConcurrentBagExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ConcurrentBagExtensions.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Collections.Concurrent;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -15,4 +14,4 @@ public static void AddRange(this ConcurrentBag bag, IEnumerable items)
bag.Add(item);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/DictionaryExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/DictionaryExtensions.cs
index cfc387a65..81ec5a84e 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/DictionaryExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/DictionaryExtensions.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Collections;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -13,7 +12,10 @@ public static ICollection GetItems(this IDictionary().ToList();
}
@@ -24,9 +26,13 @@ public static void AddItem(this IDictionary { item };
+ }
}
@@ -60,8 +66,12 @@ public static void Increment(this IDictionary dictionary, TKey
Check.NotNull(dictionary, nameof(dictionary));
Check.NotNull(key, nameof(key));
if (dictionary.TryGetValue(key, out var value))
+ {
dictionary[key] = value + 1;
+ }
else
+ {
dictionary.Add(key, 1);
+ }
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/EnumerableExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/EnumerableExtensions.cs
index 0b039a542..a19d75835 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/EnumerableExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/EnumerableExtensions.cs
@@ -97,4 +97,4 @@ internal static IEnumerable ToEnumerable(this TSource value)
{
yield return value;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ExpressionExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ExpressionExtensions.cs
index 493ed2ee6..7e6824398 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ExpressionExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ExpressionExtensions.cs
@@ -3,7 +3,6 @@
using System.Linq.Expressions;
using System.Reflection;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -23,9 +22,13 @@ public static PropertyInfo GetPropertyInfoFromExpression(
if (propertySelector.Body is UnaryExpression unExp)
{
if (unExp.Operand is MemberExpression expression)
+ {
exp = expression;
+ }
else
+ {
throw new ArgumentException();
+ }
}
else if (propertySelector.Body is MemberExpression expression)
{
@@ -38,4 +41,4 @@ public static PropertyInfo GetPropertyInfoFromExpression(
return (PropertyInfo)exp.Member;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StackExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StackExtensions.cs
index f5d8aa263..dd292149f 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StackExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StackExtensions.cs
@@ -1,12 +1,10 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Infrastructure;
internal static class StackExtensions
{
public static T? PeekOrDefault(this Stack stack) =>
Check.NotNull(stack, nameof(stack)).Count > 0 ? stack.Peek() : default;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StringExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StringExtensions.cs
index f43528907..7b8245b36 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StringExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StringExtensions.cs
@@ -1,8 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Infrastructure;
internal static class StringExtensions
@@ -26,7 +24,9 @@ internal static string TrimAsyncSuffix(this string value)
{
Check.NotNull(value, nameof(value));
if (value.EndsWith("Async") && value.Length > "Async".Length)
+ {
return value.Substring(0, value.Length - "Async".Length);
+ }
return value;
}
@@ -46,11 +46,20 @@ public static string ToUpperSnakeCase(this string value)
Check.NotNull(value, nameof(value));
- if (value.IsSnakeCase()) return value.ToUpper();
+ if (value.IsSnakeCase())
+ {
+ return value.ToUpper();
+ }
- if (value.IsKebabCase()) return value.Replace('-', '_').ToUpper();
+ if (value.IsKebabCase())
+ {
+ return value.Replace('-', '_').ToUpper();
+ }
- if (value.IsSpaceCase()) return value.Replace(' ', '_').ToUpper();
+ if (value.IsSpaceCase())
+ {
+ return value.Replace(' ', '_').ToUpper();
+ }
var chars = value.SelectMany((c, i) =>
{
@@ -60,4 +69,4 @@ public static string ToUpperSnakeCase(this string value)
return new string(chars);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/TaskExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/TaskExtensions.cs
index af9b065a8..a9c7a3e65 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/TaskExtensions.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/TaskExtensions.cs
@@ -1,8 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Infrastructure;
internal static class TaskExtensions
@@ -23,12 +21,17 @@ internal static class TaskExtensions
{
Check.NotNull(task, nameof(task));
if (!task.IsCompleted)
+ {
throw new InvalidOperationException(
"Attempted to get result of task prior to completion, ensure you are await task prior to getting its value.");
+ }
var resultProp = task.GetType().GetProperty("Result");
- if (resultProp != null) return resultProp.GetValue(task);
+ if (resultProp != null)
+ {
+ return resultProp.GetValue(task);
+ }
throw new InvalidOperationException("Unable to get result from task");
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/IInfrastructure.cs b/src/GraphZen.Infrastructure/Infrastructure/IInfrastructure.cs
index 351426c43..fd17eb5b2 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/IInfrastructure.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/IInfrastructure.cs
@@ -1,11 +1,9 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Infrastructure;
public interface IInfrastructure
{
T Instance { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/IInspectable.cs b/src/GraphZen.Infrastructure/Infrastructure/IInspectable.cs
index 110493eeb..d43414f64 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/IInspectable.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/IInspectable.cs
@@ -1,11 +1,9 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Infrastructure;
public interface IInspectable
{
string GetDisplayValue();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/InternalNumerics.cs b/src/GraphZen.Infrastructure/Infrastructure/InternalNumerics.cs
index e66e73c4e..09c385a97 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/InternalNumerics.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/InternalNumerics.cs
@@ -1,8 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Infrastructure;
internal static class InternalNumerics
@@ -55,4 +53,4 @@ public static bool TryConvertToInt32(double value, out int result)
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/Json.cs b/src/GraphZen.Infrastructure/Infrastructure/Json.cs
index d32150499..ff572ee79 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/Json.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/Json.cs
@@ -5,7 +5,6 @@
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -35,4 +34,4 @@ public static string SerializeObject(object value)
};
return JsonSerializer.Serialize(value, options);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/ResponsePath.cs b/src/GraphZen.Infrastructure/Infrastructure/ResponsePath.cs
index b0eba680f..efe030127 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/ResponsePath.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/ResponsePath.cs
@@ -3,7 +3,6 @@
using System.Diagnostics;
using System.Text;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -55,8 +54,11 @@ public override string ToString()
currentPath = currentPath.Previous;
}
- if (sb.Length > 0) sb.Insert(0, "value");
+ if (sb.Length > 0)
+ {
+ sb.Insert(0, "value");
+ }
return sb.ToString();
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/SpecScalarTypeNames.cs b/src/GraphZen.Infrastructure/Infrastructure/SpecScalarTypeNames.cs
index 5e3f07b7c..9dd07290c 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/SpecScalarTypeNames.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/SpecScalarTypeNames.cs
@@ -2,7 +2,6 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
using System.Collections.Immutable;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -20,4 +19,4 @@ internal static class SpecReservedNames
ImmutableArray.Create("__Type", "__Field", "__Schema", "__Directive", "__InputValue", "__EnumValue",
"__DirectiveLocation",
"__TypeKind");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/StringUtils.cs b/src/GraphZen.Infrastructure/Infrastructure/StringUtils.cs
index 41f2bb635..f695bb639 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/StringUtils.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/StringUtils.cs
@@ -1,8 +1,6 @@
// Copyright (c) GraphZen LLC. All rights reserved.
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
-using GraphZen.Infrastructure;
-
namespace GraphZen.Infrastructure;
public static class StringUtils
@@ -12,7 +10,11 @@ public static class StringUtils
public static string QuotedOrList(this IReadOnlyList source)
{
// TODO: source = Check.NotEmpty(source, nameof(source));
- if (source.Count == 0) throw new ArgumentException("Must contain at least one value.", nameof(source));
+ if (source.Count == 0)
+ {
+ throw new ArgumentException("Must contain at least one value.", nameof(source));
+ }
+
return source.Select(v => $"\"{v}\"").ToArray().OrList();
}
@@ -26,7 +28,10 @@ public static string OrList(
(list, value) =>
{
var (quoted, index) = value;
- if (index == 0) return quoted;
+ if (index == 0)
+ {
+ return quoted;
+ }
return list + (selected.Length > 2 ? ", " : " ") +
(index == selected.Length - 1 ? "or " : "") + quoted;
@@ -47,7 +52,10 @@ public static IReadOnlyList GetSuggestionList(string input,
{
var distance = GetLexicalDistance(input, option);
var threshold = Math.Max(Math.Max(inputThreshold, option.Length / 2), 1);
- if (distance <= threshold) optionsByDistance[option] = distance;
+ if (distance <= threshold)
+ {
+ optionsByDistance[option] = distance;
+ }
}
return optionsByDistance.OrderBy(_ => _.Value).Select(_ => _.Key).ToArray();
@@ -63,9 +71,15 @@ public static int GetLexicalDistance(string a, string b)
var bLength = b.Length;
var d = new int[aLength + 1, bLength + 1];
- if (aLength == 0) return bLength;
+ if (aLength == 0)
+ {
+ return bLength;
+ }
- if (bLength == 0) return aLength;
+ if (bLength == 0)
+ {
+ return aLength;
+ }
for (var i = 0; i <= aLength; d[i, 0] = i++)
{
@@ -76,15 +90,17 @@ public static int GetLexicalDistance(string a, string b)
}
for (var i = 1; i <= aLength; i++)
- for (var j = 1; j <= bLength; j++)
{
- var cost = b[j - 1] == a[i - 1] ? 0 : 1;
+ for (var j = 1; j <= bLength; j++)
+ {
+ var cost = b[j - 1] == a[i - 1] ? 0 : 1;
- d[i, j] = Math.Min(
- Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1),
- d[i - 1, j - 1] + cost);
+ d[i, j] = Math.Min(
+ Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1),
+ d[i - 1, j - 1] + cost);
+ }
}
return d[aLength, bLength];
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.Infrastructure/Infrastructure/ValueInspector.cs b/src/GraphZen.Infrastructure/Infrastructure/ValueInspector.cs
index c8c35ce47..367cd02ed 100644
--- a/src/GraphZen.Infrastructure/Infrastructure/ValueInspector.cs
+++ b/src/GraphZen.Infrastructure/Infrastructure/ValueInspector.cs
@@ -3,7 +3,6 @@
using System.Collections;
using System.Text.Json.Nodes;
-using GraphZen.Infrastructure;
namespace GraphZen.Infrastructure;
@@ -18,9 +17,13 @@ public static T Dump(this T value, Func selector, string? prefix =
public static T Dump(this T value, string label = "_", bool expanded = false)
{
if (expanded)
+ {
Console.WriteLine($"= {label} =\n{value.Inspect(true)}");
+ }
else
+ {
Console.WriteLine($"\t\t{label} \t\t-> {value.Inspect()}");
+ }
return value;
}
@@ -57,4 +60,4 @@ internal static string Inspect(this object? value, bool expanded = false)
return value.ToString() ?? string.Empty;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/AssemblyAttributes.cs b/src/GraphZen.LanguageModel/AssemblyAttributes.cs
index d21d98db5..e2222d1a9 100644
--- a/src/GraphZen.LanguageModel/AssemblyAttributes.cs
+++ b/src/GraphZen.LanguageModel/AssemblyAttributes.cs
@@ -5,4 +5,4 @@
[assembly: InternalsVisibleTo("GraphZen.Tests")]
[assembly: InternalsVisibleTo("GraphZen.QueryEngine")]
-[assembly: InternalsVisibleTo("GraphZen.TypeSystem")]
\ No newline at end of file
+[assembly: InternalsVisibleTo("GraphZen.TypeSystem")]
diff --git a/src/GraphZen.LanguageModel/DocumentValidator.cs b/src/GraphZen.LanguageModel/DocumentValidator.cs
index a03908b3f..eaa57d3a8 100644
--- a/src/GraphZen.LanguageModel/DocumentValidator.cs
+++ b/src/GraphZen.LanguageModel/DocumentValidator.cs
@@ -27,4 +27,4 @@ public IEnumerable Validate(DocumentSyntax schemaDocument,
validationVisitor.Visit(schemaDocument);
return validationContext.GetErrors();
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/GlobalUsings.cs b/src/GraphZen.LanguageModel/GlobalUsings.cs
index 5b5bc45b7..28f0d2a40 100644
--- a/src/GraphZen.LanguageModel/GlobalUsings.cs
+++ b/src/GraphZen.LanguageModel/GlobalUsings.cs
@@ -2,4 +2,4 @@
// Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information.
global using GraphZen.Infrastructure;
-global using GraphZen.LanguageModel.Internal;
\ No newline at end of file
+global using GraphZen.LanguageModel.Internal;
diff --git a/src/GraphZen.LanguageModel/GraphQLException.cs b/src/GraphZen.LanguageModel/GraphQLException.cs
index d0548e46a..9713f98bc 100644
--- a/src/GraphZen.LanguageModel/GraphQLException.cs
+++ b/src/GraphZen.LanguageModel/GraphQLException.cs
@@ -29,4 +29,4 @@ internal GraphQLException(GraphQLServerError error) : base(Check.NotNull(error,
public GraphQLServerError GraphQLError { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/GraphQLServerError.cs b/src/GraphZen.LanguageModel/GraphQLServerError.cs
index bd15a0eac..4185f0dc7 100644
--- a/src/GraphZen.LanguageModel/GraphQLServerError.cs
+++ b/src/GraphZen.LanguageModel/GraphQLServerError.cs
@@ -25,8 +25,11 @@ public GraphQLServerError(string message,
Source = source ?? nodes?.FirstOrDefault()?.Location?.Source;
InnerException = innerException;
if (Positions != null && Source != null)
+ {
Locations = Positions.Select(Source.GetLocation).ToList();
+ }
else if (Nodes != null && Source != null)
+ {
Locations = Nodes
.Where(_ => _?.Location != null)
.Select(n =>
@@ -34,6 +37,7 @@ public GraphQLServerError(string message,
Debug.Assert(n.Location != null);
return Source.GetLocation(n.Location.Start);
}).ToList();
+ }
}
@@ -60,11 +64,20 @@ private bool Equals(GraphQLServerError other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
- if (obj.GetType() != GetType()) return false;
+ if (obj.GetType() != GetType())
+ {
+ return false;
+ }
return Equals((GraphQLServerError)obj);
}
@@ -93,4 +106,4 @@ public GraphQLServerError WithLocationInfo(IReadOnlyList nodes, Resp
new(Message, nodes, Source, Positions,
Check.NotNull(path, nameof(path)).AsReadOnlyList(),
InnerException);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/IDocumentValidator.cs b/src/GraphZen.LanguageModel/IDocumentValidator.cs
index 1dd18dabd..324699187 100644
--- a/src/GraphZen.LanguageModel/IDocumentValidator.cs
+++ b/src/GraphZen.LanguageModel/IDocumentValidator.cs
@@ -9,4 +9,4 @@ public interface IDocumentValidator
{
IEnumerable Validate(DocumentSyntax schemaDocument,
DocumentSyntax? initialSchemaDocument = null);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/AssemblyAttributes.cs b/src/GraphZen.LanguageModel/LanguageModel/AssemblyAttributes.cs
index 2c613388c..6623be328 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/AssemblyAttributes.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/AssemblyAttributes.cs
@@ -4,4 +4,4 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("GraphZen")]
-[assembly: InternalsVisibleTo("GraphZen.Tests")]
\ No newline at end of file
+[assembly: InternalsVisibleTo("GraphZen.Tests")]
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Break.cs b/src/GraphZen.LanguageModel/LanguageModel/Break.cs
index a0927f49d..1aaa64dcb 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Break.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Break.cs
@@ -5,4 +5,4 @@ namespace GraphZen.LanguageModel;
public sealed class Break : VisitAction
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/ContinueAction.cs b/src/GraphZen.LanguageModel/LanguageModel/ContinueAction.cs
index 84fc58d8f..ebb14544a 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/ContinueAction.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/ContinueAction.cs
@@ -5,4 +5,4 @@ namespace GraphZen.LanguageModel;
public sealed class ContinueAction : VisitAction
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxVisitor.cs b/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxVisitor.cs
index 4ffe9d93c..11f9b4fa5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxVisitor.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxVisitor.cs
@@ -25,4 +25,4 @@ public abstract partial class GraphQLSyntaxVisitor
public virtual TResult OnEnter(SyntaxNode node) => default!;
public virtual TResult OnLeave(SyntaxNode node) => default!;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxWalker.cs b/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxWalker.cs
index 5a57487d4..218da1052 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxWalker.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxWalker.cs
@@ -51,4 +51,4 @@ public override void Visit(SyntaxNode node)
node.VisitLeave(this);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/IParser.cs b/src/GraphZen.LanguageModel/LanguageModel/IParser.cs
index 170706784..7bd50fdc4 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/IParser.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/IParser.cs
@@ -12,4 +12,4 @@ public interface IParser
TypeSyntax ParseType(string type);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/IPrinter.cs b/src/GraphZen.LanguageModel/LanguageModel/IPrinter.cs
index d01cb4048..97a58ee4c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/IPrinter.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/IPrinter.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
public interface IPrinter
{
string Print(SyntaxNode node);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DescriptionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DescriptionGrammar.cs
index 3c103926c..75623caf0 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DescriptionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DescriptionGrammar.cs
@@ -16,4 +16,4 @@ internal static partial class Grammar
return _;
})
.Named("description");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveDefinitionsGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveDefinitionsGrammar.cs
index 039c0623f..9e944f524 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveDefinitionsGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveDefinitionsGrammar.cs
@@ -12,17 +12,17 @@ internal static partial class Grammar
///
private static TokenListParser DirectiveDefinition { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from directive in Keyword("directive")!
- from at in AtSymbol!
- from name in Name!
- from args in ArgumentsDefinition!.AsNullable().OptionalOrDefault()
- from @on in Keyword("on")!
- from locations in DirectiveLocations!
- select new DirectiveDefinitionSyntax(name!, locations!, desc, args,
- SyntaxLocation.FromMany(desc, directive, at, name!,
- args?.GetLocation()
- , @on,
- locations!.GetLocation())))
+ from directive in Keyword("directive")!
+ from at in AtSymbol!
+ from name in Name!
+ from args in ArgumentsDefinition!.AsNullable().OptionalOrDefault()
+ from @on in Keyword("on")!
+ from locations in DirectiveLocations!
+ select new DirectiveDefinitionSyntax(name!, locations!, desc, args,
+ SyntaxLocation.FromMany(desc, directive, at, name!,
+ args?.GetLocation()
+ , @on,
+ locations!.GetLocation())))
.Try()
.Named("directive definition");
@@ -31,8 +31,8 @@ from locations in DirectiveLocations!
///
private static TokenListParser DirectiveLocations { get; } =
(from pipe in Parse.Ref(() => Pipe!).AsNullable().OptionalOrDefault()
- from locations in DirectiveLocation!.ManyDelimitedBy(Pipe!)
- select locations)
+ from locations in DirectiveLocation!.ManyDelimitedBy(Pipe!)
+ select locations)
.Try()
.Named("directive locations");
@@ -56,4 +56,4 @@ from locations in DirectiveLocations!
private static TokenListParser TypeSystemDirectiveLocation { get; } =
KeywordIn(DirectiveLocationHelper.TypeSystemDirectiveLocations.Values)
.Named("type system directive location");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveGrammar.cs
index 0a293399d..242382e4d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveGrammar.cs
@@ -18,9 +18,9 @@ internal static partial class Grammar
///
internal static TokenListParser Directive { get; } =
(from at in Parse.Ref(() => AtSymbol!.Named("directive symbol"))
- from name in Name!.Named("directive name")
- from args in Arguments!.AsNullable().OptionalOrDefault().Named("directive arguments")
- select new DirectiveSyntax(name!, args,
- SyntaxLocation.FromMany(at, name!, args.GetLocation()))).Try()
+ from name in Name!.Named("directive name")
+ from args in Arguments!.AsNullable().OptionalOrDefault().Named("directive arguments")
+ select new DirectiveSyntax(name!, args,
+ SyntaxLocation.FromMany(at, name!, args.GetLocation()))).Try()
.Named("directive");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveLocationHelper.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveLocationHelper.cs
index 6af1090b9..4b3bf5bf5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveLocationHelper.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveLocationHelper.cs
@@ -53,7 +53,9 @@ internal static string ToStringValue(this DirectiveLocation loc)
{
if (ExecutableDirectiveLocations.TryGetValue(loc, out var value) ||
TypeSystemDirectiveLocations.TryGetValue(loc, out value))
+ {
return value;
+ }
throw new Exception($"No string value defined for {loc}");
}
@@ -61,9 +63,15 @@ internal static string ToStringValue(this DirectiveLocation loc)
internal static DirectiveLocation Parse(string value)
{
Check.NotNull(value, nameof(value));
- if (TypeSystemDirectiveLocationsByName.TryGetValue(value, out var result)) return result;
+ if (TypeSystemDirectiveLocationsByName.TryGetValue(value, out var result))
+ {
+ return result;
+ }
- if (ExecutableDirectiveLocationsByName.TryGetValue(value, out result)) return result;
+ if (ExecutableDirectiveLocationsByName.TryGetValue(value, out result))
+ {
+ return result;
+ }
throw new Exception($"Unable to find Directive Location that matches value \"{value}\".");
}
@@ -96,4 +104,4 @@ public static class DirectiveLocationExtensions
public static string GetDisplayValue(this DirectiveLocation directiveLocation) =>
DirectiveLocationDisplayValues[directiveLocation];
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DocumentGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DocumentGrammar.cs
index 65d1d1828..2f0a1ff01 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DocumentGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DocumentGrammar.cs
@@ -13,10 +13,10 @@ internal static partial class Grammar
///
internal static TokenListParser Document { get; } =
(from leadingComments in Parse.Ref(() => Comment!.Many())
- from definitions in Parse.Ref(() => Definition!).Many()
- from trailingComments in Comment!.Many()
- select new DocumentSyntax(definitions,
- definitions.GetLocation().Location))
+ from definitions in Parse.Ref(() => Definition!).Many()
+ from trailingComments in Comment!.Many()
+ select new DocumentSyntax(definitions,
+ definitions.GetLocation().Location))
.Named("document");
///
@@ -24,11 +24,11 @@ from definitions in Parse.Ref(() => Definition!).Many()
///
private static TokenListParser Definition { get; } =
(from leadingComments in Parse.Ref(() => Comment!.Many())
- from def in ExecutableDefinition!.Select(_ => (DefinitionSyntax)_)
- .Or(TypeSystemDefinition!.Select(_ => (DefinitionSyntax)_))
- .Or(TypeSystemExtension!.Select(_ => (DefinitionSyntax)_))
- from trailingComments in Comment!.Many()
- select def)
+ from def in ExecutableDefinition!.Select(_ => (DefinitionSyntax)_)
+ .Or(TypeSystemDefinition!.Select(_ => (DefinitionSyntax)_))
+ .Or(TypeSystemExtension!.Select(_ => (DefinitionSyntax)_))
+ from trailingComments in Comment!.Many()
+ select def)
.Named("definition");
///
@@ -38,4 +38,4 @@ from definitions in Parse.Ref(() => Definition!).Many()
Parse.Ref(() => OperationDefintion!).Select(_ => (ExecutableDefinitionSyntax)_)
.Or(FragmentDefinition!.Select(_ => (ExecutableDefinitionSyntax)_))
.Named("executable definition");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeDefinitionGrammar.cs
index 0f548aa8b..889733ba1 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeDefinitionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeDefinitionGrammar.cs
@@ -12,12 +12,12 @@ internal static partial class Grammar
///
private static TokenListParser EnumTypeDefinition { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from @enum in Keyword("enum")!
- from name in Name!
- from directives in Directives.AsNullable().OptionalOrDefault()
- from values in EnumValuesDefinition!.AsNullable().OptionalOrDefault()
- select new EnumTypeDefinitionSyntax(name!, desc, directives, values,
- SyntaxLocation.FromMany(desc, @enum, name!, directives.GetLocation(), values.GetLocation())))
+ from @enum in Keyword("enum")!
+ from name in Name!
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from values in EnumValuesDefinition!.AsNullable().OptionalOrDefault()
+ select new EnumTypeDefinitionSyntax(name!, desc, directives, values,
+ SyntaxLocation.FromMany(desc, @enum, name!, directives.GetLocation(), values.GetLocation())))
.Named("enum type definition");
///
@@ -25,9 +25,9 @@ from directives in Directives.AsNullable().OptionalOrDefault()
///
private static TokenListParser EnumValuesDefinition { get; } =
(from lb in Parse.Ref(() => LeftBrace!)
- from values in EnumValueDefinition!.Many()
- from rb in RightBrace!
- select values)
+ from values in EnumValueDefinition!.Many()
+ from rb in RightBrace!
+ select values)
.Try()
.Named("enum values");
@@ -36,10 +36,10 @@ from rb in RightBrace!
///
private static TokenListParser EnumValueDefinition { get; } =
(from desc in Parse.Ref(() => Description!.AsNullable().OptionalOrDefault())
- from value in EnumValue!
- from directives in Directives.AsNullable().OptionalOrDefault()
- select new EnumValueDefinitionSyntax(value!, desc, directives,
- SyntaxLocation.FromMany(desc, value!, directives.GetLocation())))
+ from value in EnumValue!
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ select new EnumValueDefinitionSyntax(value!, desc, directives,
+ SyntaxLocation.FromMany(desc, value!, directives.GetLocation())))
.Try()
.Named("enum value");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeExtensionGrammar.cs
index a7c979cb3..fe79e0ef8 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeExtensionGrammar.cs
@@ -13,18 +13,18 @@ internal static partial class Grammar
///
private static TokenListParser EnumTypeExtension { get; } =
(from extend in Keyword("extend")
- from @enum in Keyword("enum")!
- from name in Name!
- from directives in Directives.AsNullable().OptionalOrDefault()
- from values in EnumValuesDefinition
- select new EnumTypeExtensionSyntax(name!, directives, values!,
- SyntaxLocation.FromMany(extend, name!, directives.GetLocation(), values!.GetLocation()))).Try()
+ from @enum in Keyword("enum")!
+ from name in Name!
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from values in EnumValuesDefinition
+ select new EnumTypeExtensionSyntax(name!, directives, values!,
+ SyntaxLocation.FromMany(extend, name!, directives.GetLocation(), values!.GetLocation()))).Try()
.Or((from extend in Keyword("extend")
- from @enum in Keyword("enum")!
- from name in Name!
- from directives in Directives
- select new EnumTypeExtensionSyntax(name!, directives!, null!,
- SyntaxLocation.FromMany(extend, name!, directives!.GetLocation()))).Try())
+ from @enum in Keyword("enum")!
+ from name in Name!
+ from directives in Directives
+ select new EnumTypeExtensionSyntax(name!, directives!, null!,
+ SyntaxLocation.FromMany(extend, name!, directives!.GetLocation()))).Try())
.Try()
.Named("enum type extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FieldGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FieldGrammar.cs
index 41013abe1..cef58952b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FieldGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FieldGrammar.cs
@@ -10,24 +10,24 @@ internal static partial class Grammar
{
internal static TokenListParser Field { get; } =
(from firstName in Parse.Ref(() => Name!.AsNullable().OptionalOrDefault())
- from aliasedName in (from colon in Colon
- from aliasedName in Name!
- select aliasedName).AsNullable().OptionalOrDefault()
- from arguments in Arguments!.AsNullable().OptionalOrDefault().Named("field arguments")
- from directives in Directives.AsNullable().OptionalOrDefault().Named("field directives")
- from selectionSet in SelectionSet!.AsNullable().OptionalOrDefault().Named("field selections")
- let alias = aliasedName != null ? firstName : null
- let name = aliasedName ?? firstName
- where firstName != null
- select new FieldSyntax(name!,
- alias,
- arguments,
- directives,
- selectionSet,
- SyntaxLocation.FromMany(alias!, name!, arguments?.GetLocation(),
- selectionSet,
- directives?.GetLocation()
- )))
+ from aliasedName in (from colon in Colon
+ from aliasedName in Name!
+ select aliasedName).AsNullable().OptionalOrDefault()
+ from arguments in Arguments!.AsNullable().OptionalOrDefault().Named("field arguments")
+ from directives in Directives.AsNullable().OptionalOrDefault().Named("field directives")
+ from selectionSet in SelectionSet!.AsNullable().OptionalOrDefault().Named("field selections")
+ let alias = aliasedName != null ? firstName : null
+ let name = aliasedName ?? firstName
+ where firstName != null
+ select new FieldSyntax(name!,
+ alias,
+ arguments,
+ directives,
+ selectionSet,
+ SyntaxLocation.FromMany(alias!, name!, arguments?.GetLocation(),
+ selectionSet,
+ directives?.GetLocation()
+ )))
.Try()
.Named("field");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FragmentGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FragmentGrammar.cs
index 7c663d199..5e744a27e 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FragmentGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FragmentGrammar.cs
@@ -10,43 +10,43 @@ internal static partial class Grammar
{
private static TokenListParser TypeCondition { get; } =
(from @on in Keyword("on")
- from type in NamedType!
- select type!)
+ from type in NamedType!
+ select type!)
.Try()
.Named("type condition");
private static TokenListParser FragmentName { get; } =
(from name in Parse.Ref(() => Name!)
- where !name.Value.Equals("on", StringComparison.OrdinalIgnoreCase)
- select name)
+ where !name.Value.Equals("on", StringComparison.OrdinalIgnoreCase)
+ select name)
.Try()
.Named("fragment name");
internal static TokenListParser FragmentSpread { get; } =
(from spread in Parse.Ref(() => Spread!)
- from name in FragmentName.AsNullable().OptionalOrDefault()
- from directives in Directives.AsNullable().OptionalOrDefault()
- where name != null
- select new FragmentSpreadSyntax(name, directives,
- SyntaxLocation.FromMany(spread, name, directives.GetLocation())))
+ from name in FragmentName.AsNullable().OptionalOrDefault()
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ where name != null
+ select new FragmentSpreadSyntax(name, directives,
+ SyntaxLocation.FromMany(spread, name, directives.GetLocation())))
.Try()
.Named("fragment spread");
internal static TokenListParser InlineFragment =>
(from spread in Spread
- from typeCondition in TypeCondition.AsNullable().OptionalOrDefault()
- from directives in Directives.AsNullable().OptionalOrDefault()
- from selectionSet in SelectionSet
- select new InlineFragmentSyntax(selectionSet!, typeCondition, directives,
- new SyntaxLocation(spread, selectionSet!))).Named("inline fragment");
+ from typeCondition in TypeCondition.AsNullable().OptionalOrDefault()
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from selectionSet in SelectionSet
+ select new InlineFragmentSyntax(selectionSet!, typeCondition, directives,
+ new SyntaxLocation(spread, selectionSet!))).Named("inline fragment");
internal static TokenListParser FragmentDefinition =>
(from fragment in Keyword("fragment")
- from fragmentName in FragmentName
- from type in TypeCondition.AsNullable().OptionalOrDefault()
- from directives in Directives.AsNullable().OptionalOrDefault()
- from selectionSet in SelectionSet
- select new FragmentDefinitionSyntax(fragmentName!, type, selectionSet!, directives,
- new SyntaxLocation(fragment, selectionSet!))).Named("fragment definition");
-}
\ No newline at end of file
+ from fragmentName in FragmentName
+ from type in TypeCondition.AsNullable().OptionalOrDefault()
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from selectionSet in SelectionSet
+ select new FragmentDefinitionSyntax(fragmentName!, type, selectionSet!, directives,
+ new SyntaxLocation(fragment, selectionSet!))).Named("fragment definition");
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/Grammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/Grammar.cs
index 2faf351d6..926808acd 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/Grammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/Grammar.cs
@@ -12,10 +12,10 @@ internal static partial class Grammar
///
internal static TokenListParser Argument { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from name in Parse.Ref(() => Name!.Named("argument name"))
- from colon in Colon!
- from value in Value!.Named("argument value")
- select new ArgumentSyntax(name!, desc, value, SyntaxLocation.FromMany(name!, value))).Try()
+ from name in Parse.Ref(() => Name!.Named("argument name"))
+ from colon in Colon!
+ from value in Value!.Named("argument value")
+ select new ArgumentSyntax(name!, desc, value, SyntaxLocation.FromMany(name!, value))).Try()
.Named("argument");
///
@@ -23,8 +23,8 @@ from colon in Colon!
///
internal static TokenListParser Arguments { get; } =
(from lp in Parse.Ref(() => LeftParen!)
- from args in Argument!.Many()
- from rp in RightParen!
- select args).Try()
+ from args in Argument!.Many()
+ from rp in RightParen!
+ select args).Try()
.Named("arguments");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeExtensionGrammar.cs
index 26ad667ff..30277cca7 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeExtensionGrammar.cs
@@ -12,19 +12,19 @@ internal static partial class Grammar
///
private static TokenListParser InputObjectTypeExtension { get; } =
(from extend in Keyword("extend")
- from input in Keyword("input")
- from name in Parse.Ref(() => Name!)
- from directives in Directives.AsNullable().OptionalOrDefault()
- from fields in InputFieldsDefinition!
- select new InputObjectTypeExtensionSyntax(name!, directives, fields!,
- SyntaxLocation.FromMany(extend, fields!.GetLocation())))
+ from input in Keyword("input")
+ from name in Parse.Ref(() => Name!)
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from fields in InputFieldsDefinition!
+ select new InputObjectTypeExtensionSyntax(name!, directives, fields!,
+ SyntaxLocation.FromMany(extend, fields!.GetLocation())))
.Try().Or
((from extend in Keyword("extend")
- from input in Keyword("input")
- from name in Parse.Ref(() => Name!)
- from directives in Directives
- select new InputObjectTypeExtensionSyntax(name!, directives!, null,
- SyntaxLocation.FromMany(extend, directives!.GetLocation())))
+ from input in Keyword("input")
+ from name in Parse.Ref(() => Name!)
+ from directives in Directives
+ select new InputObjectTypeExtensionSyntax(name!, directives!, null,
+ SyntaxLocation.FromMany(extend, directives!.GetLocation())))
.Try())
.Named("input object type extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeGrammar.cs
index 68edf053d..dc3f4f02e 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeGrammar.cs
@@ -12,12 +12,12 @@ internal static partial class Grammar
///
private static TokenListParser InputObjectTypeDefinition { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from input in Keyword("input")!
- from name in Name!
- from directives in Directives.AsNullable().OptionalOrDefault()
- from fields in InputFieldsDefinition!.AsNullable().OptionalOrDefault()
- select new InputObjectTypeDefinitionSyntax(name!, desc, directives, fields,
- SyntaxLocation.FromMany(desc, input, name!, directives.GetLocation(), fields.GetLocation())))
+ from input in Keyword("input")!
+ from name in Name!
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from fields in InputFieldsDefinition!.AsNullable().OptionalOrDefault()
+ select new InputObjectTypeDefinitionSyntax(name!, desc, directives, fields,
+ SyntaxLocation.FromMany(desc, input, name!, directives.GetLocation(), fields.GetLocation())))
.Named("input object type definition");
///
@@ -25,9 +25,9 @@ from directives in Directives.AsNullable().OptionalOrDefault()
///
private static TokenListParser InputFieldsDefinition { get; } =
(from lb in Parse.Ref(() => LeftBrace!)
- from values in InputValueDefinition!.Many()
- from rb in RightBrace!
- select values)
+ from values in InputValueDefinition!.Many()
+ from rb in RightBrace!
+ select values)
.Try()
.Named("input fields definition");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputTypeGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputTypeGrammar.cs
index 0eda021a1..9296a867a 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputTypeGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputTypeGrammar.cs
@@ -9,14 +9,14 @@ internal static partial class Grammar
{
private static TokenListParser NamedType { get; } =
(from name in Parse.Ref(() => Name!)
- select new NamedTypeSyntax(name, name.Location))
+ select new NamedTypeSyntax(name, name.Location))
.Named("named type");
private static TokenListParser ListType { get; } =
(from leftBracket in Parse.Ref(() => LeftBracket!)
- from type in Type!
- from rightBracket in RightBracket!
- select new ListTypeSyntax(type!, new SyntaxLocation(leftBracket, rightBracket)))
+ from type in Type!
+ from rightBracket in RightBracket!
+ select new ListTypeSyntax(type!, new SyntaxLocation(leftBracket, rightBracket)))
.Try()
.Named("list type");
@@ -24,10 +24,10 @@ from rightBracket in RightBracket!
(from type in ListType
.Select(n => (NullableTypeSyntax)n)
.Or(NamedType.Select(n => (NullableTypeSyntax)n))
- from bang in Bang!.AsNullable().OptionalOrDefault()
- select bang == null
- ? type!
- : new NonNullTypeSyntax(type!, SyntaxLocation.FromMany(type!, bang)) as TypeSyntax)
+ from bang in Bang!.AsNullable().OptionalOrDefault()
+ select bang == null
+ ? type!
+ : new NonNullTypeSyntax(type!, SyntaxLocation.FromMany(type!, bang)) as TypeSyntax)
.Try()
.Named("type");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputValuesGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputValuesGrammar.cs
index 1b54cbd30..d4d4ac6c9 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputValuesGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputValuesGrammar.cs
@@ -11,7 +11,7 @@ internal static partial class Grammar
{
private static TokenListParser NullValue { get; } =
(from @null in Keyword("null")
- select SyntaxFactory.NullValue())
+ select SyntaxFactory.NullValue())
.Try()
.Named("null value");
@@ -20,33 +20,33 @@ select SyntaxFactory.NullValue())
///
private static TokenListParser EnumValue { get; } =
(from name in Parse.Ref(() => Name!)
- where EnumValueSyntax.IsValidValue(name.Value)
- select new EnumValueSyntax(name))
+ where EnumValueSyntax.IsValidValue(name.Value)
+ select new EnumValueSyntax(name))
.Try()
.Named("enum value");
private static TokenListParser ListValue { get; } =
(from leftBracket in Parse.Ref(() => LeftBracket!)
- from values in Value!.Many()
- from rightBracket in RightBracket!
- select new ListValueSyntax(values!, new SyntaxLocation(leftBracket, rightBracket)))
+ from values in Value!.Many()
+ from rightBracket in RightBracket!
+ select new ListValueSyntax(values!, new SyntaxLocation(leftBracket, rightBracket)))
.Try()
.Named("list value");
private static TokenListParser ObjectField { get; } =
(from n in Parse.Ref(() => Name!)
- from c in Colon!
- from v in Value!
- select SyntaxFactory.ObjectField(n, v!))
+ from c in Colon!
+ from v in Value!
+ select SyntaxFactory.ObjectField(n, v!))
.Try()
.Named("object field");
private static TokenListParser ObjectValue { get; } =
(from lb in Parse.Ref(() => LeftBrace!)
- from fields in ObjectField!.Many()
- from rb in RightBrace!
- select new ObjectValueSyntax(fields!, new SyntaxLocation(lb, rb)))
+ from fields in ObjectField!.Many()
+ from rb in RightBrace!
+ select new ObjectValueSyntax(fields!, new SyntaxLocation(lb, rb)))
.Try().Named("object value");
private static TokenListParser IntValue { get; } =
@@ -94,4 +94,4 @@ from rb in RightBrace!
.Or(ListValue.Select(_ => (ValueSyntax)_))
.Or(ObjectValue.Select(_ => (ValueSyntax)_))
.Named("value");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeDefinitionGrammar.cs
index 41da4491c..9c62a5781 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeDefinitionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeDefinitionGrammar.cs
@@ -12,11 +12,11 @@ internal static partial class Grammar
///
private static TokenListParser InterfaceTypeDefinition { get; } =
(from desc in Parse.Ref(() => Description!.AsNullable().OptionalOrDefault())
- from @interface in Keyword("interface")
- from name in Name!
- from directives in Directives.AsNullable().OptionalOrDefault()
- from fields in FieldsDefinition!.AsNullable().OptionalOrDefault()
- select new InterfaceTypeDefinitionSyntax(name!, desc, directives, fields,
- SyntaxLocation.FromMany(desc, @interface, name!, directives.GetLocation(), fields.GetLocation())))
+ from @interface in Keyword("interface")
+ from name in Name!
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from fields in FieldsDefinition!.AsNullable().OptionalOrDefault()
+ select new InterfaceTypeDefinitionSyntax(name!, desc, directives, fields,
+ SyntaxLocation.FromMany(desc, @interface, name!, directives.GetLocation(), fields.GetLocation())))
.Named("interface");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeExtensionGrammar.cs
index d011e29f2..b24dbab2b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeExtensionGrammar.cs
@@ -12,12 +12,12 @@ internal static partial class Grammar
///
private static TokenListParser InterfaceTypeExtension { get; } =
(from extend in Keyword("extend")
- from iface in Keyword("interface")
- from name in Name!
- from directives in Directives.AsNullable().OptionalOrDefault()
- from fields in FieldsDefinition!
- select new InterfaceTypeExtensionSyntax(name!, directives, fields!,
- SyntaxLocation.FromMany(extend, fields!.GetLocation()))).Try().Or(
+ from iface in Keyword("interface")
+ from name in Name!
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from fields in FieldsDefinition!
+ select new InterfaceTypeExtensionSyntax(name!, directives, fields!,
+ SyntaxLocation.FromMany(extend, fields!.GetLocation()))).Try().Or(
from extend in Keyword("extend")
from iface in Keyword("interface")
from name in Name!
@@ -25,4 +25,4 @@ from directives in Directives
select new InterfaceTypeExtensionSyntax(name!, directives!, null,
SyntaxLocation.FromMany(extend, directives!.GetLocation()))
).Try().Named("interface type extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/LexicalTokens.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/LexicalTokens.cs
index 613cb5ed8..cfd8d5e46 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/LexicalTokens.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/LexicalTokens.cs
@@ -75,7 +75,10 @@ private static TokenListParser KeywordIn(IEnumerable(input);
@@ -88,4 +91,4 @@ private static TokenListParser Punctuator(TokenKind
.EqualTo(tokenKind)
.Select(t => new PunctuatorSyntax(t.Span.ToLocation()));
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeDefinitionGrammar.cs
index daaadc474..b2b7d1492 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeDefinitionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeDefinitionGrammar.cs
@@ -12,26 +12,26 @@ internal static partial class Grammar
///
private static TokenListParser ObjectTypeDefinition { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from type in Keyword("type")
- from typeName in Name
- from interfaces in ImplementsIntefaces!.AsNullable().OptionalOrDefault()
- from directives in Directives.AsNullable().OptionalOrDefault()
- from fields in FieldsDefinition!.AsNullable().OptionalOrDefault()
- select new ObjectTypeDefinitionSyntax(typeName!,
- desc,
- interfaces, directives, fields,
- SyntaxLocation.FromMany(desc, type, typeName!, interfaces?.GetLocation(),
- directives?.GetLocation(),
- fields?.GetLocation()))).Named("object type definition");
+ from type in Keyword("type")
+ from typeName in Name
+ from interfaces in ImplementsIntefaces!.AsNullable().OptionalOrDefault()
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from fields in FieldsDefinition!.AsNullable().OptionalOrDefault()
+ select new ObjectTypeDefinitionSyntax(typeName!,
+ desc,
+ interfaces, directives, fields,
+ SyntaxLocation.FromMany(desc, type, typeName!, interfaces?.GetLocation(),
+ directives?.GetLocation(),
+ fields?.GetLocation()))).Named("object type definition");
///
/// http://facebook.github.io/graphql/June2018/#ImplementsInterfaces
///
private static TokenListParser ImplementsIntefaces { get; } =
(from impl in Keyword("implements")
- from amp in Ampersand.Optional()
- from ifaces in NamedType.Select(nt => nt).ManyDelimitedBy(Ampersand.OptionalOrDefault())
- select ifaces!)
+ from amp in Ampersand.Optional()
+ from ifaces in NamedType.Select(nt => nt).ManyDelimitedBy(Ampersand.OptionalOrDefault())
+ select ifaces!)
.Named("implements interfaces");
///
@@ -39,9 +39,9 @@ from ifaces in NamedType.Select(nt => nt).ManyDelimitedBy(Ampersand.OptionalOrDe
///
private static TokenListParser FieldsDefinition { get; } =
(from lb in Parse.Ref(() => LeftBrace!)
- from defs in FieldDefinition!.Many()
- from rb in RightBrace
- select defs)
+ from defs in FieldDefinition!.Many()
+ from rb in RightBrace
+ select defs)
.Try()
.Named("fields definition");
@@ -51,35 +51,35 @@ from rb in RightBrace
///
private static TokenListParser FieldDefinition { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from name in Name
- from args in ArgumentsDefinition!.AsNullable().OptionalOrDefault()
- from c in Colon
- from type in Type
- from directives in Directives.AsNullable().OptionalOrDefault()
- select new FieldDefinitionSyntax(name!, type!, desc, args, directives,
- SyntaxLocation.FromMany(desc, name!, args?.GetLocation(), c, type!)))
+ from name in Name
+ from args in ArgumentsDefinition!.AsNullable().OptionalOrDefault()
+ from c in Colon
+ from type in Type
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ select new FieldDefinitionSyntax(name!, type!, desc, args, directives,
+ SyntaxLocation.FromMany(desc, name!, args?.GetLocation(), c, type!)))
.Try()
.Named("field definition");
private static TokenListParser ArgumentsDefinition { get; } =
(from lp in Parse.Ref(() => LeftParen!)
- from defs in InputValueDefinition!.Many()
- from rp in RightParen
- select defs)
+ from defs in InputValueDefinition!.Many()
+ from rp in RightParen
+ select defs)
.Try()
.Named("arguments definition");
private static TokenListParser InputValueDefinition { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from name in Name
- from c in Colon
- from type in Type
- from defaultValue in DefaultValue!.AsNullable().OptionalOrDefault()
- from directives in Directives.AsNullable().OptionalOrDefault()
- select new InputValueDefinitionSyntax(name!, type!, desc, defaultValue, directives,
- SyntaxLocation.FromMany(
- desc, name!, type!, defaultValue, directives?.GetLocation())))
+ from name in Name
+ from c in Colon
+ from type in Type
+ from defaultValue in DefaultValue!.AsNullable().OptionalOrDefault()
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ select new InputValueDefinitionSyntax(name!, type!, desc, defaultValue, directives,
+ SyntaxLocation.FromMany(
+ desc, name!, type!, defaultValue, directives?.GetLocation())))
.Try()
.Named("input value definition");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeExtensionGrammar.cs
index fc17ddcb2..b0a07549f 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeExtensionGrammar.cs
@@ -9,30 +9,30 @@ internal static partial class Grammar
{
private static TokenListParser ObjectTypeExtension { get; } =
(from extend in Keyword("extend")
- from type in Keyword("type")
- from name in Name
- from ifaces in ImplementsIntefaces.AsNullable().OptionalOrDefault()
- from directives in Directives.AsNullable().OptionalOrDefault()
- from fields in FieldsDefinition
- select new ObjectTypeExtensionSyntax(name!, ifaces, directives, fields!,
- SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation(), directives?.GetLocation(),
- fields?.GetLocation()))).Try()
+ from type in Keyword("type")
+ from name in Name
+ from ifaces in ImplementsIntefaces.AsNullable().OptionalOrDefault()
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from fields in FieldsDefinition
+ select new ObjectTypeExtensionSyntax(name!, ifaces, directives, fields!,
+ SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation(), directives?.GetLocation(),
+ fields?.GetLocation()))).Try()
.Or(
(from extend in Keyword("extend")
- from type in Keyword("type")
- from name in Name
- from ifaces in ImplementsIntefaces.AsNullable().OptionalOrDefault()
- from directives in Directives
- select new ObjectTypeExtensionSyntax(name!, ifaces, directives!, null,
- SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation(), directives?.GetLocation())))
+ from type in Keyword("type")
+ from name in Name
+ from ifaces in ImplementsIntefaces.AsNullable().OptionalOrDefault()
+ from directives in Directives
+ select new ObjectTypeExtensionSyntax(name!, ifaces, directives!, null,
+ SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation(), directives?.GetLocation())))
.Try()
).Or(
(from extend in Keyword("extend")
- from type in Keyword("type")
- from name in Name
- from ifaces in ImplementsIntefaces
- select new ObjectTypeExtensionSyntax(name!, ifaces!, null, null,
- SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation()))).Try()
+ from type in Keyword("type")
+ from name in Name
+ from ifaces in ImplementsIntefaces
+ select new ObjectTypeExtensionSyntax(name!, ifaces!, null, null,
+ SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation()))).Try()
)
.Named("object type extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/OperationDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/OperationDefinitionGrammar.cs
index cd3368f65..a97a0f1b3 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/OperationDefinitionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/OperationDefinitionGrammar.cs
@@ -24,22 +24,22 @@ from selectionSet in SelectionSet!
private static TokenListParser OperationType { get; }
=
(from name in Token.EqualTo(TokenKind.Name).Named("operation type")
- let nameValue = name.ToStringValue()
- let isQuery = nameValue?.Equals("query", StringComparison.OrdinalIgnoreCase) ?? false
- let isMutation = nameValue?.Equals("mutation", StringComparison.OrdinalIgnoreCase) ?? false
- let isSubscription = nameValue?.Equals("subscription", StringComparison.OrdinalIgnoreCase) ?? false
- where isQuery || isMutation || isSubscription
- let type = isQuery
- ? LanguageModel.OperationType.Query
- : isMutation
- ? LanguageModel.OperationType.Mutation
- : LanguageModel.OperationType.Subscription
- select (type, name.Span.ToLocation()))
+ let nameValue = name.ToStringValue()
+ let isQuery = nameValue?.Equals("query", StringComparison.OrdinalIgnoreCase) ?? false
+ let isMutation = nameValue?.Equals("mutation", StringComparison.OrdinalIgnoreCase) ?? false
+ let isSubscription = nameValue?.Equals("subscription", StringComparison.OrdinalIgnoreCase) ?? false
+ where isQuery || isMutation || isSubscription
+ let type = isQuery
+ ? LanguageModel.OperationType.Query
+ : isMutation
+ ? LanguageModel.OperationType.Mutation
+ : LanguageModel.OperationType.Subscription
+ select (type, name.Span.ToLocation()))
.Named("operation type");
private static TokenListParser QueryShorthandOpeartion { get; } =
(from selectionSet in Parse.Ref(() => SelectionSet!)
- select new OperationDefinitionSyntax(LanguageModel.OperationType.Query, selectionSet,
- location: selectionSet.Location))
+ select new OperationDefinitionSyntax(LanguageModel.OperationType.Query, selectionSet,
+ location: selectionSet.Location))
.Named("query shortand operation");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeExtensionGrammar.cs
index fe3ea9e96..b97e5cba1 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeExtensionGrammar.cs
@@ -12,11 +12,11 @@ internal static partial class Grammar
///
private static TokenListParser ScalarTypeExtension { get; } =
(from extend in Keyword("extend")
- from scalar in Keyword("scalar")
- from name in Parse.Ref(() => Name!)
- from directives in Directives
- select new ScalarTypeExtensionSyntax(name!, directives!,
- SyntaxLocation.FromMany(extend, directives!.GetLocation())))
+ from scalar in Keyword("scalar")
+ from name in Parse.Ref(() => Name!)
+ from directives in Directives
+ select new ScalarTypeExtensionSyntax(name!, directives!,
+ SyntaxLocation.FromMany(extend, directives!.GetLocation())))
.Try()
.Named("scalar type extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeGrammar.cs
index 4c659e977..4e6bb4e5c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeGrammar.cs
@@ -9,11 +9,11 @@ internal static partial class Grammar
{
private static TokenListParser ScalarTypeDefinitionSyntax { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from scalar in Keyword("scalar")
- from name in Name
- from directives in Directives.AsNullable().OptionalOrDefault()
- select new ScalarTypeDefinitionSyntax(name!, desc, directives,
- SyntaxLocation.FromMany(desc, scalar, name!, directives.GetLocation())))
+ from scalar in Keyword("scalar")
+ from name in Name
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ select new ScalarTypeDefinitionSyntax(name!, desc, directives,
+ SyntaxLocation.FromMany(desc, scalar, name!, directives.GetLocation())))
.Try()
.Named("scalar type");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaExtensionGrammar.cs
index ea22e109c..6425a79d5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaExtensionGrammar.cs
@@ -12,16 +12,16 @@ internal static partial class Grammar
///
private static TokenListParser SchemaExtension { get; } =
(from extend in Keyword("extend")
- from schema in Keyword("schema")
- from directives in Directives.AsNullable().OptionalOrDefault()
- from lb in Parse.Ref(() => LeftBrace!)
- from defs in OperationTypeDefinition!.Many()
- from rb in RightBrace
- select new SchemaExtensionSyntax(directives, defs!, SyntaxLocation.FromMany(extend, rb))).Try().Or(
+ from schema in Keyword("schema")
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from lb in Parse.Ref(() => LeftBrace!)
+ from defs in OperationTypeDefinition!.Many()
+ from rb in RightBrace
+ select new SchemaExtensionSyntax(directives, defs!, SyntaxLocation.FromMany(extend, rb))).Try().Or(
from extend in Keyword("extend")
from schema in Keyword("schema")
from directives in Directives
select new SchemaExtensionSyntax(directives!, null,
SyntaxLocation.FromMany(extend, directives!.GetLocation()))
).Try().Named("schema extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaGrammar.cs
index a59ee1003..4b691b840 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaGrammar.cs
@@ -9,20 +9,20 @@ internal static partial class Grammar
{
private static TokenListParser SchemaDefinition { get; } =
(from schema in Keyword("schema")
- from directives in Directives.AsNullable().OptionalOrDefault()
- from leftBrace in Parse.Ref(() => LeftBrace!)
- from operationTypeDefinitionNodes in OperationTypeDefinition!.Many()
- from rightBrace in RightBrace
- select new SchemaDefinitionSyntax(operationTypeDefinitionNodes!, directives,
- SyntaxLocation.FromMany(schema, rightBrace))).Try().Named("schema definition");
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from leftBrace in Parse.Ref(() => LeftBrace!)
+ from operationTypeDefinitionNodes in OperationTypeDefinition!.Many()
+ from rightBrace in RightBrace
+ select new SchemaDefinitionSyntax(operationTypeDefinitionNodes!, directives,
+ SyntaxLocation.FromMany(schema, rightBrace))).Try().Named("schema definition");
private static TokenListParser OperationTypeDefinition { get; } =
(from opType in Parse.Ref(() => OperationType!)
- from colon in Colon
- from type in NamedType
- select new OperationTypeDefinitionSyntax(opType.type,
- type!,
- SyntaxLocation.FromMany(opType.location, type!.Location)))
+ from colon in Colon
+ from type in NamedType
+ select new OperationTypeDefinitionSyntax(opType.type,
+ type!,
+ SyntaxLocation.FromMany(opType.location, type!.Location)))
.Try()
.Named("operation type definition");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SelectionSetGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SelectionSetGrammar.cs
index aa9873454..c4b2f5714 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SelectionSetGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SelectionSetGrammar.cs
@@ -12,10 +12,10 @@ internal static partial class Grammar
///
internal static TokenListParser SelectionSet { get; } =
(from lb in Parse.Ref(() => LeftBrace!)
- from selections in Selection!
- .AtLeastOnce()
- from rb in RightBrace
- select new SelectionSetSyntax(selections, new SyntaxLocation(lb, rb)))
+ from selections in Selection!
+ .AtLeastOnce()
+ from rb in RightBrace
+ select new SelectionSetSyntax(selections, new SyntaxLocation(lb, rb)))
.Named("selection set");
@@ -23,4 +23,4 @@ from rb in RightBrace
Parse.Ref(() => Field!).Select(_ => (SelectionSyntax)_)
.Or(Parse.Ref(() => FragmentSpread!.Select(_ => (SelectionSyntax)_)))
.Or(InlineFragment!.Select(_ => (SelectionSyntax)_)).Named("selection");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeExtensionGrammar.cs
index 969512a13..c12ec7598 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeExtensionGrammar.cs
@@ -15,4 +15,4 @@ internal static partial class Grammar
.Or(Parse.Ref(() => EnumTypeExtension!).Select(_ => (TypeExtensionSyntax)_))
.Or(Parse.Ref(() => InputObjectTypeExtension!).Select(_ => (TypeExtensionSyntax)_))
.Named("type extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemDefinitionGrammar.cs
index 7a9cc3c1a..12d541629 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemDefinitionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemDefinitionGrammar.cs
@@ -21,4 +21,4 @@ internal static partial class Grammar
.Or(Parse.Ref(() => EnumTypeDefinition!).Select(_ => (TypeDefinitionSyntax)_).Try())
.Or(Parse.Ref(() => InputObjectTypeDefinition!).Select(_ => (TypeDefinitionSyntax)_).Try())
.Named("type definition");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemExtensionGrammar.cs
index 5340bd45e..e2b310c60 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemExtensionGrammar.cs
@@ -11,4 +11,4 @@ internal static partial class Grammar
Parse.Ref(() => SchemaExtension!).Select(_ => (TypeSystemExtensionSyntax)_)
.Or(Parse.Ref(() => TypeExtension!).Select(_ => (TypeSystemExtensionSyntax)_))
.Named("type system extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeDefinitionGrammar.cs
index fa109b3a0..b924a401f 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeDefinitionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeDefinitionGrammar.cs
@@ -9,12 +9,12 @@ internal static partial class Grammar
{
private static TokenListParser UnionTypeDefinition { get; } =
(from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault()
- from union in Keyword("union")
- from name in Name
- from directives in Directives.AsNullable().OptionalOrDefault()
- from types in UnionMemberTypes!.AsNullable().OptionalOrDefault()
- select new UnionTypeDefinitionSyntax(name!, desc, directives, types,
- SyntaxLocation.FromMany(desc, union, name!, directives?.GetLocation(), types?.GetLocation())))
+ from union in Keyword("union")
+ from name in Name
+ from directives in Directives.AsNullable().OptionalOrDefault()
+ from types in UnionMemberTypes!.AsNullable().OptionalOrDefault()
+ select new UnionTypeDefinitionSyntax(name!, desc, directives, types,
+ SyntaxLocation.FromMany(desc, union, name!, directives?.GetLocation(), types?.GetLocation())))
.Named("union type definition");
///
@@ -28,4 +28,4 @@ from types in NamedType.AtLeastOnceDelimitedBy(Pipe)
select types!)
.Try()
.Named("union member types");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeExtensionGrammar.cs
index 2e0adc1f4..9de0e0b6b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeExtensionGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeExtensionGrammar.cs
@@ -12,11 +12,11 @@ internal static partial class Grammar
///
private static TokenListParser UnionTypeExtension { get; } =
(from extend in Keyword("extend")
- from union in Keyword("union")
- from name in Parse.Ref(() => Name!)
- from directives in Directives
- select new UnionTypeExtensionSyntax(name!, directives!, null,
- SyntaxLocation.FromMany(extend, directives!.GetLocation())))
+ from union in Keyword("union")
+ from name in Parse.Ref(() => Name!)
+ from directives in Directives
+ select new UnionTypeExtensionSyntax(name!, directives!, null,
+ SyntaxLocation.FromMany(extend, directives!.GetLocation())))
.Select(_ => { return _; })
.Try()
.Or(from extend in Keyword("extend")
@@ -27,4 +27,4 @@ from types in UnionMemberTypes
select new UnionTypeExtensionSyntax(name!, directives, types!,
SyntaxLocation.FromMany(extend, types!.GetLocation()))).Try()
.Named("union type extension");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/VariablesGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/VariablesGrammar.cs
index 30e0b5f50..a3bf9cd14 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/VariablesGrammar.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/VariablesGrammar.cs
@@ -12,9 +12,9 @@ internal static partial class Grammar
///
private static TokenListParser VariableDefinitions { get; } =
(from lp in Parse.Ref(() => LeftParen!)
- from variableDefinitionNodes in VariableDefinition!.Many()
- from rp in RightParen
- select variableDefinitionNodes)
+ from variableDefinitionNodes in VariableDefinition!.Many()
+ from rp in RightParen
+ select variableDefinitionNodes)
.Named("variable definitions");
///
@@ -22,10 +22,10 @@ from rp in RightParen
///
internal static TokenListParser VariableDefinition { get; } =
(from v in Parse.Ref(() => Variable!)
- from c in Colon
- from t in Type
- from defaultValue in DefaultValue!.AsNullable().OptionalOrDefault()
- select new VariableDefinitionSyntax(v, t!, defaultValue, SyntaxLocation.FromMany(v, c, t!, defaultValue)))
+ from c in Colon
+ from t in Type
+ from defaultValue in DefaultValue!.AsNullable().OptionalOrDefault()
+ select new VariableDefinitionSyntax(v, t!, defaultValue, SyntaxLocation.FromMany(v, c, t!, defaultValue)))
.Named("variable definition");
///
@@ -33,8 +33,8 @@ from t in Type
///
internal static TokenListParser Variable { get; } =
(from d in Parse.Ref(() => DollarSign!)
- from n in Name!.Named("variable name")
- select new VariableSyntax(n, new SyntaxLocation(d, n)))
+ from n in Name!.Named("variable name")
+ select new VariableSyntax(n, new SyntaxLocation(d, n)))
.Named("variable");
///
@@ -42,7 +42,7 @@ from t in Type
///
private static TokenListParser DefaultValue { get; } =
(from assignment in Parse.Ref(() => Assignment!).Named("assignment")
- from value in Value!.Named("default value")
- select value!)
+ from value in Value!.Named("default value")
+ select value!)
.Named("default value");
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageHelpers.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageHelpers.cs
index 817bb531b..33282df24 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageHelpers.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageHelpers.cs
@@ -17,8 +17,10 @@ public static string ThrowIfInvalidGraphQLName(this string name)
{
Check.NotNull(name, nameof(name));
if (!name.IsValidGraphQLName())
+ {
throw new Exception(
$"'{name}' is not a valid GraphQL name. Names are limited to underscores and alpha-numeric ASCII characters.");
+ }
return name;
}
@@ -43,18 +45,26 @@ public static string BlockStringValue(string rawString)
if (indent < line.Length && (commonIndent == null || indent < commonIndent.Value))
{
commonIndent = indent;
- if (commonIndent == 0) break;
+ if (commonIndent == 0)
+ {
+ break;
+ }
}
}
if (commonIndent.HasValue)
+ {
for (var i = 1; i < lines.Count; i++)
{
var line = lines[i];
Debug.Assert(line != null, nameof(line) + " != null");
- if (line.Length > commonIndent.Value) lines[i] = line.Substring(commonIndent.Value);
+ if (line.Length > commonIndent.Value)
+ {
+ lines[i] = line.Substring(commonIndent.Value);
+ }
}
+ }
while (lines.Count > 0 && string.IsNullOrWhiteSpace(lines[0]))
{
@@ -82,17 +92,25 @@ public static string BlockStringValueOld(string rawString)
if (indent < line.Length && (commonIndent == null || indent < commonIndent))
{
commonIndent = indent;
- if (commonIndent == 0) break;
+ if (commonIndent == 0)
+ {
+ break;
+ }
}
}
if (commonIndent.HasValue)
+ {
for (var i = 1; i < lines.Count; i++)
{
var line = lines[i];
Debug.Assert(line != null, nameof(line) + " != null");
- if (line.Length > commonIndent.Value) lines[i] = line.Substring(commonIndent.Value);
+ if (line.Length > commonIndent.Value)
+ {
+ lines[i] = line.Substring(commonIndent.Value);
+ }
}
+ }
while (lines.Count > 0 && string.IsNullOrWhiteSpace(lines[0]))
{
@@ -119,4 +137,4 @@ private static int GetIndent(this string str)
return i;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageModelClrTypeExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageModelClrTypeExtensions.cs
index 0099f9673..78259cd2b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageModelClrTypeExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageModelClrTypeExtensions.cs
@@ -23,7 +23,10 @@ public static string GetGraphQLName(this Type clrType, object? source = null)
{
if (clrType.TryGetGraphQLNameWithoutValidation(out var maybeInvalidName, source))
{
- if (maybeInvalidName.IsValidGraphQLName()) return maybeInvalidName;
+ if (maybeInvalidName.IsValidGraphQLName())
+ {
+ return maybeInvalidName;
+ }
throw new Exception(
$"Failed to get a valid GraphQL name for CLR type '{clrType}' because it was invalid. The invalid name was '{maybeInvalidName}'.");
@@ -38,7 +41,10 @@ private static bool TryGetGraphQLNameWithoutValidation(this Type clrType, [NotNu
Check.NotNull(clrType, nameof(clrType));
name = null;
- if (clrType.TryGetGraphQLNameFromDataAnnotation(out name)) return true;
+ if (clrType.TryGetGraphQLNameFromDataAnnotation(out name))
+ {
+ return true;
+ }
if (source != null)
{
@@ -72,4 +78,4 @@ public static bool TryGetGraphQLNameFromDataAnnotation(this Type clrType, [NotNu
.SingleOrDefault()?.Name;
return name != null;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/NodeExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/NodeExtensions.cs
index aab9a5d24..005bfe937 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/NodeExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/NodeExtensions.cs
@@ -40,7 +40,10 @@ internal static bool NodesEqual(
IEnumerable otherNodes) where T : SyntaxNode
{
var sequenceEquals = nodes.SequenceEqual(otherNodes);
- if (sequenceEquals) return true;
+ if (sequenceEquals)
+ {
+ return true;
+ }
return false;
}
@@ -51,4 +54,4 @@ private struct LocationContainer : ISyntaxNodeLocation
public SyntaxLocation? Location { get; }
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Parser.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Parser.cs
index 5e3a96ff6..2e975f9c7 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Parser.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Parser.cs
@@ -15,4 +15,4 @@ public static class Parser
public static TypeSyntax ParseType(string text) => Instance.ParseType(text);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs
index c67ca4552..60c392e31 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs
@@ -13,4 +13,4 @@ internal static class ParserNullabilityExtensions
internal static TokenListParser AsNullable(this TokenListParser parser)
where T : class =>
parser!;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Printer.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Printer.cs
index 3c6882251..0f53eb8d3 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Printer.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Printer.cs
@@ -24,7 +24,10 @@ public string Print(SyntaxNode node)
private void PrintNode(SyntaxNode? node)
{
- if (node == null) return;
+ if (node == null)
+ {
+ return;
+ }
switch (node)
{
@@ -49,7 +52,10 @@ private void PrintNode(SyntaxNode? node)
// Operation type and name
Wrap($"{def.OperationType.ToString().ToLower()} ", def.Name);
// Variable definitions
- if (def.VariableDefinitions.Any()) Wrap("(", () => Join(def.VariableDefinitions, ", "), ")");
+ if (def.VariableDefinitions.Any())
+ {
+ Wrap("(", () => Join(def.VariableDefinitions, ", "), ")");
+ }
// Directives
Append(' ');
@@ -62,7 +68,10 @@ private void PrintNode(SyntaxNode? node)
Block(set.Selections);
break;
case FieldSyntax field:
- if (field.Alias != null) Wrap("", field.Alias, ": ");
+ if (field.Alias != null)
+ {
+ Wrap("", field.Alias, ": ");
+ }
PrintNode(field.Name);
PrintArguments(field.Arguments);
@@ -78,7 +87,10 @@ private void PrintNode(SyntaxNode? node)
PrintNode(varDef.Variable);
Append(": ");
PrintNode(varDef.VariableType);
- if (varDef.DefaultValue != null) Wrap(" = ", varDef.DefaultValue);
+ if (varDef.DefaultValue != null)
+ {
+ Wrap(" = ", varDef.DefaultValue);
+ }
break;
case FragmentSpreadSyntax fragmentSpread:
@@ -87,7 +99,10 @@ private void PrintNode(SyntaxNode? node)
break;
case InlineFragmentSyntax inlineFragment:
Append("... ");
- if (inlineFragment.TypeCondition != null) Wrap("on ", inlineFragment.TypeCondition, " ");
+ if (inlineFragment.TypeCondition != null)
+ {
+ Wrap("on ", inlineFragment.TypeCondition, " ");
+ }
PrintDirectives(inlineFragment.Directives);
PrintNode(inlineFragment.SelectionSet);
@@ -158,10 +173,16 @@ private void PrintNode(SyntaxNode? node)
PrintDescription(objectDef);
Append("type ");
PrintNode(objectDef.Name);
- if (objectDef.Interfaces.Any()) Wrap(" implements ", () => Join(objectDef.Interfaces, " & "));
+ if (objectDef.Interfaces.Any())
+ {
+ Wrap(" implements ", () => Join(objectDef.Interfaces, " & "));
+ }
PrintDirectives(objectDef.Directives);
- if (objectDef.Fields.Any()) Append(" ");
+ if (objectDef.Fields.Any())
+ {
+ Append(" ");
+ }
Block(objectDef.Fields);
break;
@@ -188,7 +209,10 @@ private void PrintNode(SyntaxNode? node)
PrintDescription(interfaceDef);
Wrap("interface ", interfaceDef.Name);
PrintDirectives(interfaceDef.Directives);
- if (interfaceDef.Fields.Any()) Append(" ");
+ if (interfaceDef.Fields.Any())
+ {
+ Append(" ");
+ }
Block(interfaceDef.Fields);
break;
@@ -207,7 +231,10 @@ private void PrintNode(SyntaxNode? node)
PrintDescription(enumType);
Wrap("enum ", enumType.Name);
PrintDirectives(enumType.Directives);
- if (enumType.Values.Any()) Append(" ");
+ if (enumType.Values.Any())
+ {
+ Append(" ");
+ }
Block(enumType.Values);
break;
@@ -215,7 +242,10 @@ private void PrintNode(SyntaxNode? node)
PrintDescription(inputObjectDef);
Wrap("input ", inputObjectDef.Name);
PrintDirectives(inputObjectDef.Directives);
- if (inputObjectDef.Fields.Any()) Append(" ");
+ if (inputObjectDef.Fields.Any())
+ {
+ Append(" ");
+ }
Block(inputObjectDef.Fields);
break;
@@ -234,14 +264,20 @@ private void PrintNode(SyntaxNode? node)
case EnumTypeExtensionSyntax enumExtension:
Wrap("extend enum ", enumExtension.Name);
PrintDirectives(enumExtension.Directives);
- if (enumExtension.Values.Any()) Append(" ");
+ if (enumExtension.Values.Any())
+ {
+ Append(" ");
+ }
Block(enumExtension.Values);
break;
case InterfaceTypeExtensionSyntax ifaceExt:
Wrap("extend interface ", ifaceExt.Name);
PrintDirectives(ifaceExt.Directives);
- if (ifaceExt.Fields.Any()) Append(" ");
+ if (ifaceExt.Fields.Any())
+ {
+ Append(" ");
+ }
Block(ifaceExt.Fields);
break;
@@ -252,10 +288,16 @@ private void PrintNode(SyntaxNode? node)
case ObjectTypeExtensionSyntax objectExt:
Wrap("extend type ", objectExt.Name);
- if (objectExt.Interfaces.Any()) Wrap(" implements ", () => Join(objectExt.Interfaces, " & "));
+ if (objectExt.Interfaces.Any())
+ {
+ Wrap(" implements ", () => Join(objectExt.Interfaces, " & "));
+ }
PrintDirectives(objectExt.Directives);
- if (objectExt.Fields.Any()) Append(" ");
+ if (objectExt.Fields.Any())
+ {
+ Append(" ");
+ }
Block(objectExt.Fields);
break;
@@ -263,7 +305,10 @@ private void PrintNode(SyntaxNode? node)
case SchemaExtensionSyntax schemaExt:
Append("extend schema");
PrintDirectives(schemaExt.Directives);
- if (schemaExt.OperationTypes.Any()) Append(" ");
+ if (schemaExt.OperationTypes.Any())
+ {
+ Append(" ");
+ }
Block(schemaExt.OperationTypes);
break;
@@ -280,7 +325,10 @@ private void PrintNode(SyntaxNode? node)
case InputObjectTypeExtensionSyntax inputExt:
Wrap("extend input ", inputExt.Name);
PrintDirectives(inputExt.Directives);
- if (inputExt.Fields.Any()) Append(" ");
+ if (inputExt.Fields.Any())
+ {
+ Append(" ");
+ }
Block(inputExt.Fields);
break;
@@ -382,7 +430,10 @@ private void PrintArguments(IReadOnlyList arguments)
private void PrintArguments(IReadOnlyList arguments)
{
- if (arguments.Any()) Wrap("(", () => { Join(arguments, ", "); }, ")");
+ if (arguments.Any())
+ {
+ Wrap("(", () => { Join(arguments, ", "); }, ")");
+ }
}
@@ -457,7 +508,10 @@ public void Join(IReadOnlyList nodes, Action? seperatorAction = null
{
PrintNode(node);
var isLastElement = i == nodes.Count;
- if (hasSeperator && !isLastElement) seperatorAction!();
+ if (hasSeperator && !isLastElement)
+ {
+ seperatorAction!();
+ }
i++;
}
@@ -465,8 +519,9 @@ public void Join(IReadOnlyList nodes, Action? seperatorAction = null
private void Join(IReadOnlyList nodes, string? seperator = null)
{
- Join(nodes, seperator != null ? () => { Append(seperator); } : null);
+ Join(nodes, seperator != null ? () => { Append(seperator); }
+ : null);
}
#endregion
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/SpecScalarSyntaxNodes.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/SpecScalarSyntaxNodes.cs
index 67fe2e77b..190326aea 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/SpecScalarSyntaxNodes.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/SpecScalarSyntaxNodes.cs
@@ -36,4 +36,4 @@ internal static class SpecScalarSyntaxNodes
public static ImmutableArray All { get; } =
ImmutableArray.Create(String, ID, Int, Float, Boolean);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperPowerTokenizer.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperPowerTokenizer.cs
index 647306fa8..fdf9b8a08 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperPowerTokenizer.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperPowerTokenizer.cs
@@ -34,7 +34,10 @@ public static TextParser BlockStringToken
{
Debug.Assert(delimmiter != null, nameof(delimmiter) + " != null");
var begin = delimmiter(i);
- if (!begin.HasValue) return begin;
+ if (!begin.HasValue)
+ {
+ return begin;
+ }
var content = begin.Remainder;
@@ -43,7 +46,10 @@ public static TextParser BlockStringToken
// ReSharper disable once PossibleNullReferenceException
content = Span.EqualTo("\\\"\"\"").Value(Unit.Value).Try()(content).Remainder;
var end = delimmiter(content);
- if (end.HasValue) return end;
+ if (end.HasValue)
+ {
+ return end;
+ }
content = content.ConsumeChar().Remainder;
}
@@ -78,4 +84,4 @@ public static TextParser BlockStringToken
.Match(Character.EqualTo('}'), TokenKind.RightBrace)
.Match(Span.EqualTo("..."), TokenKind.Spread)
.Build();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperpowerParser.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperpowerParser.cs
index 663ab46b1..d81c3ce5c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperpowerParser.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperpowerParser.cs
@@ -35,4 +35,4 @@ private static T Parse(string text, TokenListParser parser)
Debug.Assert(result.Value != null);
return result.Value;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/TextSpanExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/TextSpanExtensions.cs
index 23d8752aa..6e106a33c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/TextSpanExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/TextSpanExtensions.cs
@@ -13,4 +13,4 @@ internal static SyntaxLocation ToLocation(this TextSpan span)
var end = start + span.Length;
return new SyntaxLocation(start, end, span.Position.Line, span.Position.Column, new Source(span.Source!));
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/TokenKind.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/TokenKind.cs
index 25958edd9..7aae7f7af 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Internal/TokenKind.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/TokenKind.cs
@@ -69,4 +69,4 @@ internal enum TokenKind
[Token(Category = "token", Description = "ampersand", Example = "&")]
Ampersand
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/ParallelSyntaxWalker.cs b/src/GraphZen.LanguageModel/LanguageModel/ParallelSyntaxWalker.cs
index b6f9878d3..955978068 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/ParallelSyntaxWalker.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/ParallelSyntaxWalker.cs
@@ -23,22 +23,34 @@ private bool IsValidVisitor(GraphQLSyntaxVisitor visitor) =>
public override void OnEnter(SyntaxNode node)
{
if (node != null)
+ {
foreach (var visitor in Visitors)
{
if (IsValidVisitor(visitor))
+ {
HandleResult(node.VisitEnter(visitor), visitor, node);
+ }
}
+ }
}
public override void OnLeave(SyntaxNode node)
{
if (node != null)
+ {
foreach (var visitor in Visitors)
{
- if (IsValidVisitor(visitor)) HandleResult(node.VisitLeave(visitor), visitor, node);
+ if (IsValidVisitor(visitor))
+ {
+ HandleResult(node.VisitLeave(visitor), visitor, node);
+ }
- if (Skips.TryGetValue(visitor, out var n) && n == node) Skips.Remove(visitor);
+ if (Skips.TryGetValue(visitor, out var n) && n == node)
+ {
+ Skips.Remove(visitor);
+ }
}
+ }
}
private void HandleResult(VisitAction result, GraphQLSyntaxVisitor visitor,
@@ -54,4 +66,4 @@ private void HandleResult(VisitAction result, GraphQLSyntaxVisitor
break;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Skip.cs b/src/GraphZen.LanguageModel/LanguageModel/Skip.cs
index e5a5fe262..53e0e80af 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Skip.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Skip.cs
@@ -5,4 +5,4 @@ namespace GraphZen.LanguageModel;
public sealed class Skip : VisitAction
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Source.cs b/src/GraphZen.LanguageModel/LanguageModel/Source.cs
index a0e83385f..d2cd7aa00 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Source.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Source.cs
@@ -18,11 +18,20 @@ public class Source
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
- if (obj.GetType() != GetType()) return false;
+ if (obj.GetType() != GetType())
+ {
+ return false;
+ }
return Equals((Source)obj);
}
@@ -38,7 +47,10 @@ public SourceLocation GetLocation(int position)
for (var i = 0; i < matches.Count; i++)
{
var match = matches[i];
- if (match.Index >= position) break;
+ if (match.Index >= position)
+ {
+ break;
+ }
line += 1;
column = position + 1 - (match.Index + match.Length);
@@ -46,4 +58,4 @@ public SourceLocation GetLocation(int position)
return new SourceLocation(line, column);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/SourceLocation.cs b/src/GraphZen.LanguageModel/LanguageModel/SourceLocation.cs
index 7c052395a..eabdfa77e 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/SourceLocation.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/SourceLocation.cs
@@ -29,4 +29,4 @@ public override int GetHashCode()
public static bool operator ==(SourceLocation left, SourceLocation right) => left.Equals(right);
public static bool operator !=(SourceLocation left, SourceLocation right) => !left.Equals(right);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntax.cs
index 148f335dd..fb1932dc2 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntax.cs
@@ -57,9 +57,15 @@ public override IEnumerable Children
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ArgumentSyntax && Equals((ArgumentSyntax)obj);
}
@@ -71,4 +77,4 @@ public override int GetHashCode()
return (Name.GetHashCode() * 397) ^ Value.GetHashCode();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntaxExtensions.cs
index 23aab1d55..a92c71435 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class ArgumentSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntax.cs
index b18997024..1d2cb7ad1 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntax.cs
@@ -29,12 +29,18 @@ public partial class BooleanValueSyntax : ValueSyntax
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is BooleanValueSyntax && Equals((BooleanValueSyntax)obj);
}
public override int GetHashCode() => Value.GetHashCode();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntaxExtensions.cs
index 6a854b56b..0b88a4fec 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class BooleanValueSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DefinitionSyntax.cs
index 2cbcc4bc6..11ccaa7ad 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DefinitionSyntax.cs
@@ -12,4 +12,4 @@ public abstract class DefinitionSyntax : SyntaxNode
protected DefinitionSyntax(SyntaxLocation? location) : base(location)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntax.cs
index 70378ecf9..808a75c9e 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntax.cs
@@ -53,9 +53,15 @@ private bool Equals(DirectiveDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is DirectiveDefinitionSyntax && Equals((DirectiveDefinitionSyntax)obj);
}
@@ -71,4 +77,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntaxExtensions.cs
index 8f9224506..be4b2aeca 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class DirectiveDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntax.cs
index 27a924179..4e037d3c3 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntax.cs
@@ -36,9 +36,15 @@ private bool Equals(DirectiveSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is DirectiveSyntax && Equals((DirectiveSyntax)obj);
}
@@ -50,4 +56,4 @@ public override int GetHashCode()
return (Name.GetHashCode() * 397) ^ Arguments.GetHashCode();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntaxExtensions.cs
index 2659f94d1..ee8360617 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class DirectiveSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntax.cs
index c1d26cd75..dfcdf3607 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntax.cs
@@ -53,20 +53,28 @@ public DocumentSyntax(IReadOnlyList definitions,
var implementations = new Dictionary>();
foreach (var objectType in GetObjectTypeMap().Values)
- foreach (var iface in objectType.Interfaces)
{
- if (implementations.TryGetValue(iface.Name.Value, out
- var impls))
- ((HashSet)impls).Add(objectType);
- else
- implementations[iface.Name.Value] =
- new HashSet { objectType };
+ foreach (var iface in objectType.Interfaces)
+ {
+ if (implementations.TryGetValue(iface.Name.Value, out
+ var impls))
+ {
+ ((HashSet)impls).Add(objectType);
+ }
+ else
+ {
+ implementations[iface.Name.Value] =
+ new HashSet { objectType };
+ }
+ }
}
foreach (var abstractType in GetAbstractTypeMap().Values)
{
if (!implementations.ContainsKey(abstractType.Name.Value))
+ {
implementations[abstractType.Name.Value] = new HashSet();
+ }
}
return new ReadOnlyDictionary>(
@@ -100,28 +108,40 @@ public bool IsTypeSubTypeOf(TypeSyntax maybeSubType, TypeSyntax superType)
{
Check.NotNull(maybeSubType, nameof(maybeSubType));
Check.NotNull(superType, nameof(superType));
- if (maybeSubType.Equals(superType)) return true;
+ if (maybeSubType.Equals(superType))
+ {
+ return true;
+ }
if (superType is NonNullTypeSyntax nnSuper)
{
if (maybeSubType is NonNullTypeSyntax nnMaybeSub)
+ {
return IsTypeSubTypeOf(nnMaybeSub.OfType, nnSuper.OfType);
+ }
return false;
}
if (maybeSubType is NonNullTypeSyntax nnMaybeSubType)
+ {
return IsTypeSubTypeOf(nnMaybeSubType.OfType, superType);
+ }
if (superType is ListTypeSyntax listSuper)
{
if (maybeSubType is ListTypeSyntax listMaybeSub)
+ {
return IsTypeSubTypeOf(listMaybeSub.OfType, listSuper.OfType);
+ }
return false;
}
- if (maybeSubType is ListTypeSyntax) return false;
+ if (maybeSubType is ListTypeSyntax)
+ {
+ return false;
+ }
if (
// Is super type abstract type?
@@ -130,7 +150,9 @@ public bool IsTypeSubTypeOf(TypeSyntax maybeSubType, TypeSyntax superType)
&& GetObjectTypeMap().TryGetValue(((NamedTypeSyntax)maybeSubType).Name.Value,
out var maybeSubTypeObjectType)
&& IsPossibleType(abstractSuperType, maybeSubTypeObjectType))
+ {
return true;
+ }
return false;
}
@@ -140,10 +162,12 @@ private IReadOnlyCollection GetPossibleTypes(
TypeDefinitionSyntax abstractType)
{
if (abstractType is UnionTypeDefinitionSyntax unionType)
+ {
return unionType.MemberTypes.Select(_ =>
// ReSharper disable once PossibleNullReferenceException
GetObjectTypeMap().TryGetValue(_.Name.Value, out var outputType) ? outputType : null)
.Where(_ => _ != null).ToReadOnlyList()!;
+ }
return GetImplementationMap().TryGetValue(abstractType.Name.Value, out var possibleTypes)
? possibleTypes
@@ -154,8 +178,10 @@ private bool IsPossibleType(TypeDefinitionSyntax abstractType,
ObjectTypeDefinitionSyntax possibleType)
{
if (!_possibleTypeMap.ContainsKey(abstractType.Name.Value))
+ {
_possibleTypeMap[abstractType.Name.Value] =
GetPossibleTypes(abstractType).ToDictionary(_ => _.Name.Value, _ => true);
+ }
return _possibleTypeMap.TryGetValue(abstractType.Name.Value, out var possibleTypesMap) &&
possibleTypesMap.ContainsKey(possibleType.Name.Value);
@@ -173,12 +199,18 @@ public DocumentSyntax WithFilteredDefinitions(Func predi
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is DocumentSyntax syntax && Equals(syntax);
}
public override int GetHashCode() => Definitions.GetHashCode();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntaxExtensions.cs
index b34fc8964..f7ac632af 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntaxExtensions.cs
@@ -124,4 +124,4 @@ public static DocumentSyntax WithSortedChildren(this DocumentSyntax document)
return new DocumentSyntax(sorted.ToReadOnlyList());
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntax.cs
index 5b378c397..9837b172c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntax.cs
@@ -55,9 +55,15 @@ private bool Equals(EnumTypeDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is EnumTypeDefinitionSyntax && Equals((EnumTypeDefinitionSyntax)obj);
}
@@ -73,4 +79,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntaxExtensions.cs
index 5297c29fc..fdf8f5436 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class EnumTypeDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntax.cs
index fb583c1a5..80352e4b0 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntax.cs
@@ -44,9 +44,15 @@ private bool Equals(EnumTypeExtensionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is EnumTypeExtensionSyntax && Equals((EnumTypeExtensionSyntax)obj);
}
@@ -61,4 +67,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntaxExtensions.cs
index a4e0ec5e9..8b80a8f92 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class EnumTypeExtensionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntax.cs
index 25001561b..3e7b7d112 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntax.cs
@@ -42,9 +42,15 @@ private bool Equals(EnumValueDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is EnumValueDefinitionSyntax && Equals((EnumValueDefinitionSyntax)obj);
}
@@ -61,4 +67,4 @@ public override int GetHashCode()
}
public override string ToString() => Value.ToString();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntaxExtensions.cs
index 8dfc3ced6..135eaa652 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class EnumValueDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntax.cs
index 8bb0df73f..3eb7d14c5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntax.cs
@@ -14,9 +14,11 @@ public EnumValueSyntax(NameSyntax value) : base(Check.NotNull(value, nameof(valu
Value = value.Value;
if (!IsValidValue(value.Value))
+ {
throw new ArgumentException(
$"Enum values cannot be 'true', 'false', or 'null'. Supplied value was: '{value.Value}'",
nameof(value));
+ }
}
@@ -42,9 +44,15 @@ internal static bool IsValidValue(string value)
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is EnumValueSyntax && Equals((EnumValueSyntax)obj);
}
@@ -54,4 +62,4 @@ public override bool Equals(object? obj)
public override object GetValue() => Value;
public override string ToString() => Value;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntaxExtensions.cs
index 7380e734c..4a3354859 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class EnumValueSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ExecutableDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ExecutableDefinitionSyntax.cs
index 284071cc9..7c9a3c445 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ExecutableDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ExecutableDefinitionSyntax.cs
@@ -12,4 +12,4 @@ public abstract class ExecutableDefinitionSyntax : DefinitionSyntax
protected ExecutableDefinitionSyntax(SyntaxLocation? location) : base(location)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntax.cs
index 9479c6a9e..906aa03bd 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntax.cs
@@ -59,9 +59,15 @@ private bool Equals(FieldDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is FieldDefinitionSyntax && Equals((FieldDefinitionSyntax)obj);
}
@@ -80,4 +86,4 @@ public override int GetHashCode()
}
public override string ToString() => Name.ToString();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntaxExtensions.cs
index 06ee55797..25ba2d088 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class FieldDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntax.cs
index 5fc958bd3..8c5f17642 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntax.cs
@@ -73,9 +73,15 @@ private bool Equals(FieldSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is FieldSyntax && Equals((FieldSyntax)obj);
}
@@ -92,4 +98,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntaxExtensions.cs
index 158d054bd..5b15c6f43 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class FieldSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntax.cs
index e69128be2..561ad899d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntax.cs
@@ -27,9 +27,15 @@ public FloatValueSyntax(string value, SyntaxLocation? location = null) : base(lo
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is FloatValueSyntax && Equals((FloatValueSyntax)obj);
}
@@ -37,4 +43,4 @@ public override bool Equals(object? obj)
public override int GetHashCode() => Value.GetHashCode();
public override object GetValue() => Value;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntaxExtensions.cs
index 3ee98e233..1a6a673b6 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class FloatValueSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntax.cs
index 571302cea..47e4aa244 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntax.cs
@@ -56,9 +56,15 @@ private bool Equals(FragmentDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is FragmentDefinitionSyntax && Equals((FragmentDefinitionSyntax)obj);
}
@@ -74,4 +80,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntaxExtensions.cs
index dbb6f39e1..7dff5d7d5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class FragmentDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntax.cs
index 4a8ba3057..dbf6db7ba 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntax.cs
@@ -15,7 +15,9 @@ public FragmentSpreadSyntax(NameSyntax name,
{
Name = Check.NotNull(name, nameof(name));
if (Name.Value.Equals("on", StringComparison.CurrentCultureIgnoreCase))
+ {
throw new ArgumentException("Fragment spreads cannot use the name 'on'.");
+ }
Directives = directives ?? DirectiveSyntax.EmptyList;
}
@@ -41,9 +43,15 @@ private bool Equals(FragmentSpreadSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is FragmentSpreadSyntax && Equals((FragmentSpreadSyntax)obj);
}
@@ -55,4 +63,4 @@ public override int GetHashCode()
return (Name.GetHashCode() * 397) ^ Directives.GetHashCode();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntaxExtensions.cs
index 20f055540..4803e1783 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class FragmentSpreadSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IArgumentsNode.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IArgumentsNode.cs
index d2ce9ba2f..1c96535a8 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IArgumentsNode.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IArgumentsNode.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
public interface IArgumentsNode
{
IReadOnlyList Arguments { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDescribedSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDescribedSyntax.cs
index 331d8c67d..e9245b21d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDescribedSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDescribedSyntax.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
public interface IDescribedSyntax
{
StringValueSyntax? Description { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDirectivesSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDirectivesSyntax.cs
index c1311c9e8..42c9eef0a 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDirectivesSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDirectivesSyntax.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
public interface IDirectivesSyntax
{
IReadOnlyList Directives { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFieldsNode.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFieldsNode.cs
index 8506b3a75..7450cb078 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFieldsNode.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFieldsNode.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
public interface IFieldsNode : INamedSyntax
{
IReadOnlyList Fields { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFragmentTypeConditionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFragmentTypeConditionSyntax.cs
index ec36e5427..b5be58f9f 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFragmentTypeConditionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFragmentTypeConditionSyntax.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
public interface IFragmentTypeConditionSyntax
{
NamedTypeSyntax? TypeCondition { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/INamedSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/INamedSyntax.cs
index 91b8653cb..fab015735 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/INamedSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/INamedSyntax.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
public interface INamedSyntax
{
NameSyntax Name { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ISyntaxNodeLocation.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ISyntaxNodeLocation.cs
index 4589cfc99..0d30b22d8 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ISyntaxNodeLocation.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ISyntaxNodeLocation.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
public interface ISyntaxNodeLocation
{
SyntaxLocation? Location { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntax.cs
index a38551eec..f4636ff37 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntax.cs
@@ -42,9 +42,15 @@ private bool Equals(InlineFragmentSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is InlineFragmentSyntax && Equals((InlineFragmentSyntax)obj);
}
@@ -59,4 +65,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntaxExtensions.cs
index f7a71db6b..980dc73c5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class InlineFragmentSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntax.cs
index 6592f3f00..a9716532b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntax.cs
@@ -43,9 +43,15 @@ private bool Equals(InputObjectTypeDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is InputObjectTypeDefinitionSyntax && Equals((InputObjectTypeDefinitionSyntax)obj);
}
@@ -61,4 +67,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntaxExtensions.cs
index 57bd995e2..fd12ff313 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class InputObjectTypeDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntax.cs
index f6e1e64c2..53b80dfef 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntax.cs
@@ -34,9 +34,15 @@ private bool Equals(InputObjectTypeExtensionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is InputObjectTypeExtensionSyntax && Equals((InputObjectTypeExtensionSyntax)obj);
}
@@ -51,4 +57,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntaxExtensions.cs
index 1b83a8255..5b7de14b5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class InputObjectTypeExtensionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntax.cs
index 05758c296..ca0dd0c97 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntax.cs
@@ -63,9 +63,15 @@ private bool Equals(InputValueDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is InputValueDefinitionSyntax && Equals((InputValueDefinitionSyntax)obj);
}
@@ -84,4 +90,4 @@ public override int GetHashCode()
}
public override string ToString() => Name.ToString();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntaxExtensions.cs
index 71973dade..cbe2b0bb5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntaxExtensions.cs
@@ -8,4 +8,4 @@ public static class InputValueDefinitionSyntaxExtensions
{
public static bool IsRequiredArgument(this InputValueDefinitionSyntax arg) =>
arg.Type is NonNullTypeSyntax && arg.DefaultValue == null;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntax.cs
index 32ea49c02..0853d5641 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntax.cs
@@ -24,9 +24,15 @@ public partial class IntValueSyntax : ValueSyntax
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is IntValueSyntax && Equals((IntValueSyntax)obj);
}
@@ -35,4 +41,4 @@ public override bool Equals(object? obj)
public override object GetValue() => Value;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntaxExtensions.cs
index 0d2374a21..8699cc2bc 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class IntValueSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntax.cs
index da3dd07af..1101d64da 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntax.cs
@@ -51,9 +51,15 @@ private bool Equals(InterfaceTypeDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is InterfaceTypeDefinitionSyntax && Equals((InterfaceTypeDefinitionSyntax)obj);
}
@@ -69,4 +75,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExensions.cs
index 1b56fb161..932ecfc73 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExensions.cs
@@ -13,4 +13,4 @@ public static InterfaceTypeDefinitionSyntax WithSortedChildren(this InterfaceTyp
interfaceNode.Fields.OrderByName().ToReadOnlyList(),
interfaceNode.Location);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExtensions.cs
index 5f4680869..1f7360ad3 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class InterfaceTypeDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntax.cs
index 416ab460f..1bd473456 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntax.cs
@@ -32,9 +32,15 @@ private bool Equals(InterfaceTypeExtensionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is InterfaceTypeExtensionSyntax && Equals((InterfaceTypeExtensionSyntax)obj);
}
@@ -49,4 +55,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntaxExtensions.cs
index 7a48333b4..6c62c31df 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class InterfaceTypeExtensionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntax.cs
index b31afbddd..685ca8ad0 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntax.cs
@@ -27,9 +27,15 @@ public override IEnumerable Children
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ListTypeSyntax && Equals((ListTypeSyntax)obj);
}
@@ -38,4 +44,4 @@ public override bool Equals(object? obj)
public override string ToString() => ToSyntaxString();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntaxExtensions.cs
index 864f8c3c7..a72321cbd 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class ListTypeSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntax.cs
index 0bee2c730..d5a246874 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntax.cs
@@ -25,9 +25,15 @@ public ListValueSyntax(IReadOnlyList values, SyntaxLocation? locati
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ListValueSyntax && Equals((ListValueSyntax)obj);
}
@@ -35,4 +41,4 @@ public override bool Equals(object? obj)
public override int GetHashCode() => Values.GetHashCode();
public override object GetValue() => Values;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntaxExtensions.cs
index 08ab17b46..789bb49f4 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class ListValueSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntax.cs
index 4f8773dd4..40a2f5f6a 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntax.cs
@@ -15,8 +15,10 @@ public NameSyntax(string value, SyntaxLocation? location = null) : base(location
{
Value = Check.NotNull(value, nameof(value));
if (!value.IsValidGraphQLName())
+ {
throw new ArgumentException(
$"Error creating name '{value}': Names are limited to underscores and alpha-numeric ASCII characters.");
+ }
}
///
@@ -36,9 +38,15 @@ public NameSyntax(string value, SyntaxLocation? location = null) : base(location
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is NameSyntax syntax && Equals(syntax);
}
@@ -46,4 +54,4 @@ public override bool Equals(object? obj)
public override int GetHashCode() => Value.GetHashCode();
public override string ToString() => Value;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntaxExtensions.cs
index c559d65d5..fb2489388 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class NameSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedSyntaxExtensions.cs
index cccd4c125..c4fcff769 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedSyntaxExtensions.cs
@@ -28,4 +28,4 @@ public static bool TryFindByName(
result = source.SingleOrDefault(_ => _.Name.Value == name);
return result != null;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntax.cs
index 976ad8d9a..f91ca6eb6 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntax.cs
@@ -28,9 +28,15 @@ public override IEnumerable Children
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is NamedTypeSyntax && Equals((NamedTypeSyntax)obj);
}
@@ -38,4 +44,4 @@ public override bool Equals(object? obj)
public override int GetHashCode() => Name.GetHashCode();
public override string ToString() => Name.ToString();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntaxExtensions.cs
index 83effd7a7..d3a9c62cb 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class NamedTypeSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntax.cs
index a3142e602..ef97ef318 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntax.cs
@@ -27,9 +27,15 @@ public override IEnumerable Children
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is NonNullTypeSyntax && Equals((NonNullTypeSyntax)obj);
}
@@ -37,4 +43,4 @@ public override bool Equals(object? obj)
public override int GetHashCode() => OfType.GetHashCode();
public override string ToString() => $"{OfType}!";
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntaxExtensions.cs
index 526facf49..97225c892 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class NonNullTypeSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntax.cs
index 292d049ee..561909438 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntax.cs
@@ -19,9 +19,15 @@ public NullValueSyntax(SyntaxLocation? location = null) : base(location)
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is NullValueSyntax;
}
@@ -30,4 +36,4 @@ public override bool Equals(object? obj)
public override object? GetValue() => null;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntaxExtensions.cs
index da6037bb7..bc513e7f8 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class NullValueSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullableTypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullableTypeSyntax.cs
index b4e033ba4..5f44f1b8c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullableTypeSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullableTypeSyntax.cs
@@ -11,4 +11,4 @@ public abstract class NullableTypeSyntax : TypeSyntax
protected NullableTypeSyntax(SyntaxLocation? location) : base(location)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntax.cs
index cdcbacfeb..1339ae727 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntax.cs
@@ -45,9 +45,15 @@ public override IEnumerable Children
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ObjectFieldSyntax && Equals((ObjectFieldSyntax)obj);
}
@@ -59,4 +65,4 @@ public override int GetHashCode()
return (Name.GetHashCode() * 397) ^ Value.GetHashCode();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntaxExtensions.cs
index 802164535..e16e9a90d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class ObjectFieldSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntax.cs
index 49cb27d6a..78d14f252 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntax.cs
@@ -62,9 +62,15 @@ private bool Equals(ObjectTypeDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ObjectTypeDefinitionSyntax && Equals((ObjectTypeDefinitionSyntax)obj);
}
@@ -83,4 +89,4 @@ public override int GetHashCode()
}
public override string ToString() => Name.ToString();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntaxExtensions.cs
index 2aea3d0ce..8c3cfcd7c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntaxExtensions.cs
@@ -15,4 +15,4 @@ public static ObjectTypeDefinitionSyntax WithSortedChildren(this ObjectTypeDefin
objectNode.Fields.OrderByName()
.ToReadOnlyList(), objectNode.Location);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntax.cs
index 00a7e6f31..2b5b597ef 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntax.cs
@@ -39,9 +39,15 @@ private bool Equals(ObjectTypeExtensionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ObjectTypeExtensionSyntax && Equals((ObjectTypeExtensionSyntax)obj);
}
@@ -57,4 +63,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntaxExtensions.cs
index f68614e25..ce1ab8a03 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class ObjectTypeExtensionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntax.cs
index fee716b9f..fdd90942f 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntax.cs
@@ -26,9 +26,15 @@ public ObjectValueSyntax(IReadOnlyList fields, SyntaxLocation
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ObjectValueSyntax && Equals((ObjectValueSyntax)obj);
}
@@ -37,4 +43,4 @@ public override bool Equals(object? obj)
public override object GetValue() => Fields;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntaxExtensions.cs
index ec12dabac..66aecf06b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class ObjectValueSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntax.cs
index 313bafc01..91ab24ea3 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntax.cs
@@ -65,9 +65,15 @@ private bool Equals(OperationDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is OperationDefinitionSyntax && Equals((OperationDefinitionSyntax)obj);
}
@@ -84,4 +90,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntaxExtensions.cs
index 368faf71d..531eab72d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class OperationDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationType.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationType.cs
index c1743a7ca..c0e66789f 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationType.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationType.cs
@@ -23,4 +23,4 @@ public enum OperationType
/// A long-lived request that fetches data in response to source events.
///
Subscription = 30
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntax.cs
index ed2dc0cc6..90d14817c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntax.cs
@@ -37,9 +37,15 @@ private bool Equals(OperationTypeDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is OperationTypeDefinitionSyntax && Equals((OperationTypeDefinitionSyntax)obj);
}
@@ -51,4 +57,4 @@ public override int GetHashCode()
return ((int)OperationType * 397) ^ Type.GetHashCode();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntaxExtensions.cs
index 1228e3a42..ef7640e7b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class OperationTypeDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntax.cs
index e8f6ccde8..a473c221e 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntax.cs
@@ -10,4 +10,4 @@ public PunctuatorSyntax(SyntaxLocation? location) : base(location)
}
public override IEnumerable Children => Enumerable.Empty();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntaxExtensions.cs
index 2b5190f2f..f7e7e228f 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class PunctuatorSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntax.cs
index b737d1701..120901517 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntax.cs
@@ -47,9 +47,15 @@ private bool Equals(ScalarTypeDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ScalarTypeDefinitionSyntax && Equals((ScalarTypeDefinitionSyntax)obj);
}
@@ -64,4 +70,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntaxExtensions.cs
index a1973d178..ea8a3a8a5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class ScalarTypeDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntax.cs
index 9be3a6eb0..f120f200b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntax.cs
@@ -27,9 +27,15 @@ private bool Equals(ScalarTypeExtensionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is ScalarTypeExtensionSyntax && Equals((ScalarTypeExtensionSyntax)obj);
}
@@ -41,4 +47,4 @@ public override int GetHashCode()
return (Name.GetHashCode() * 397) ^ Directives.GetHashCode();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntaxExtensions.cs
index 7203365e8..a5ae5e7e5 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class ScalarTypeExtensionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntax.cs
index d14637f92..934b4f43a 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntax.cs
@@ -49,9 +49,15 @@ public SchemaDefinitionSyntax WithRootOperation(OperationTypeDefinitionSyntax de
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is SchemaDefinitionSyntax && Equals((SchemaDefinitionSyntax)obj);
}
@@ -63,4 +69,4 @@ public override int GetHashCode()
return (RootOperationTypes.GetHashCode() * 397) ^ Directives.GetHashCode();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntaxExtensions.cs
index a0417b276..b106519b2 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class SchemaDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntax.cs
index 0c56d5945..60b0b4ed9 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntax.cs
@@ -37,9 +37,15 @@ private bool Equals(SchemaExtensionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is SchemaExtensionSyntax && Equals((SchemaExtensionSyntax)obj);
}
@@ -51,4 +57,4 @@ public override int GetHashCode()
return (OperationTypes.GetHashCode() * 397) ^ Directives.GetHashCode();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntaxExtensions.cs
index 0468f1bda..3889f09e1 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class SchemaExtensionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntax.cs
index 6a2a08e7c..6c9f021ec 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntax.cs
@@ -30,12 +30,18 @@ public SelectionSetSyntax(IReadOnlyList selections,
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is SelectionSetSyntax && Equals((SelectionSetSyntax)obj);
}
public override int GetHashCode() => Selections.GetHashCode();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntaxExtensions.cs
index 24b93a26b..f6be513e7 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class SelectionSetSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSyntax.cs
index 3c6487e02..a4bdac5e1 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSyntax.cs
@@ -14,4 +14,4 @@ protected SelectionSyntax(SyntaxLocation? location) : base(location)
}
public abstract IReadOnlyList Directives { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntax.cs
index 00b406942..68052fe6b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntax.cs
@@ -34,9 +34,15 @@ private bool Equals(StringValueSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is StringValueSyntax && Equals((StringValueSyntax)obj);
}
@@ -54,4 +60,4 @@ public override int GetHashCode()
public override object GetValue() => Value;
public override string ToString() => $"\"{Value}\"";
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntaxExtensions.cs
index 61635e09d..53d3204d7 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class StringValueSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxFactory.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxFactory.cs
index 031bac75e..8d328233b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxFactory.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxFactory.cs
@@ -185,4 +185,4 @@ public static ScalarTypeDefinitionSyntax ScalarTypeDefinition(NameSyntax name,
[DebuggerStepThrough]
public static SelectionSetSyntax SelectionSet(params SelectionSyntax[] selections) =>
new(selections);
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxLocation.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxLocation.cs
index 1b04c3687..4f170cb90 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxLocation.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxLocation.cs
@@ -25,9 +25,15 @@ public SyntaxLocation(SyntaxLocation start, SyntaxLocation end) :
public SyntaxLocation(int start, int end, int line, int column, Source source)
{
- if (start < 0) throw new ArgumentException($"Location start index ({start}) must be greater than 0.");
+ if (start < 0)
+ {
+ throw new ArgumentException($"Location start index ({start}) must be greater than 0.");
+ }
- if (end < start) throw new ArgumentException($"Location start (${start}) must precede end (${end}).");
+ if (end < start)
+ {
+ throw new ArgumentException($"Location start (${start}) must precede end (${end}).");
+ }
Start = start;
End = end;
@@ -48,11 +54,20 @@ public SyntaxLocation(int start, int end, int line, int column, Source source)
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
- if (obj.GetType() != GetType()) return false;
+ if (obj.GetType() != GetType())
+ {
+ return false;
+ }
return Equals((SyntaxLocation)obj);
}
@@ -77,7 +92,10 @@ public override int GetHashCode()
Check.NotNull(locations, nameof(locations));
var locs = locations.Where(l => l != null).OrderBy(_ => _!.Start).ToArray();
- if (locs.Length == 0) return null;
+ if (locs.Length == 0)
+ {
+ return null;
+ }
var min = locs[0];
var max = locs[locs.Length - 1];
@@ -86,4 +104,4 @@ public override int GetHashCode()
Debug.Assert(max != null, nameof(max) + " != null");
return new SyntaxLocation(min.Start, max.End, min.Line, min.Column, min.Source);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNode.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNode.cs
index 5d2cf8cdb..da866cdee 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNode.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNode.cs
@@ -44,4 +44,4 @@ public IEnumerable DescendantNodes()
public string ToSyntaxString() => _printed.Value;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNodeExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNodeExtensions.cs
index c39c53af4..7e27cebb3 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNodeExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNodeExtensions.cs
@@ -38,4 +38,4 @@ public static bool IsSchemaOfCommonNames(this SchemaDefinitionSyntax schemaDefin
Check.NotNull(schemaDefinitionNode, nameof(schemaDefinitionNode));
return schemaDefinitionNode.RootOperationTypes.All(ot => ot.Type.Name.Value == ot.OperationType.ToString());
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeDefinitionSyntax.cs
index b6253b8f8..a2d8d6aa1 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeDefinitionSyntax.cs
@@ -20,4 +20,4 @@ protected TypeDefinitionSyntax(SyntaxLocation? location) : base(location)
public abstract NameSyntax Name { get; }
public string GetDisplayValue() => Name.Value;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeExtensionSyntax.cs
index 8da493eff..7a320dbb3 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeExtensionSyntax.cs
@@ -14,4 +14,4 @@ protected TypeExtensionSyntax(SyntaxLocation? location) : base(location)
}
public abstract NameSyntax Name { get; }
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSyntax.cs
index 04eb4cc46..3be5b6054 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSyntax.cs
@@ -34,4 +34,4 @@ TypeSyntax FindNamedType(TypeSyntax node)
return (NamedTypeSyntax)FindNamedType(this);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemDefinitionSyntax.cs
index bed4e7b0c..b45cfb0b3 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemDefinitionSyntax.cs
@@ -12,4 +12,4 @@ public abstract class TypeSystemDefinitionSyntax : DefinitionSyntax
protected TypeSystemDefinitionSyntax(SyntaxLocation? location) : base(location)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemExtensionSyntax.cs
index 115a155c2..ff4c980c6 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemExtensionSyntax.cs
@@ -12,4 +12,4 @@ public abstract class TypeSystemExtensionSyntax : DefinitionSyntax
protected TypeSystemExtensionSyntax(SyntaxLocation? location) : base(location)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitionSyntax.cs
index fcde02419..080088cd7 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitionSyntax.cs
@@ -48,9 +48,15 @@ private bool Equals(UnionTypeDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is UnionTypeDefinitionSyntax && Equals((UnionTypeDefinitionSyntax)obj);
}
@@ -66,4 +72,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitonSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitonSyntaxExtensions.cs
index 4c425b823..2964ee379 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitonSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitonSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class UnionTypeDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntax.cs
index b1412ac20..4bdbf5af9 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntax.cs
@@ -34,9 +34,15 @@ private bool Equals(UnionTypeExtensionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is UnionTypeExtensionSyntax && Equals((UnionTypeExtensionSyntax)obj);
}
@@ -51,4 +57,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntaxExtensions.cs
index 55bc332fd..79b0a1412 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class UnionTypeExtensionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ValueSyntax.cs
index a4e99fc67..3ccee97c4 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ValueSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ValueSyntax.cs
@@ -19,4 +19,4 @@ protected ValueSyntax(SyntaxLocation? location) : base(location)
public abstract object? GetValue();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntax.cs
index 45930d41d..fb7936ed9 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntax.cs
@@ -41,7 +41,10 @@ public override IEnumerable Children
{
yield return Variable;
yield return VariableType;
- if (DefaultValue != null) yield return DefaultValue;
+ if (DefaultValue != null)
+ {
+ yield return DefaultValue;
+ }
}
}
@@ -53,9 +56,15 @@ private bool Equals(VariableDefinitionSyntax other) =>
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is VariableDefinitionSyntax && Equals((VariableDefinitionSyntax)obj);
}
@@ -70,4 +79,4 @@ public override int GetHashCode()
return hashCode;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntaxExtensions.cs
index ba718bad6..737d4cd84 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class VariableDefinitionSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntax.cs
index 3e9c23b0f..956129aac 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntax.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntax.cs
@@ -31,9 +31,15 @@ public override IEnumerable Children
public override bool Equals(object? obj)
{
- if (ReferenceEquals(null, obj)) return false;
+ if (obj is null)
+ {
+ return false;
+ }
- if (ReferenceEquals(this, obj)) return true;
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
return obj is VariableSyntax && Equals((VariableSyntax)obj);
}
@@ -43,4 +49,4 @@ public override bool Equals(object? obj)
public override object GetValue() => $"${Name.Value}";
public override string ToString() => $"${Name}";
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntaxExtensions.cs
index 6e83a2b96..5706250ba 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntaxExtensions.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntaxExtensions.cs
@@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel;
[UsedImplicitly]
public static class VariableSyntaxExtensions
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationContext.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationContext.cs
index ca5aa57d1..54035e650 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationContext.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationContext.cs
@@ -16,4 +16,4 @@ public DocumentValidationContext(DocumentSyntax schema, DocumentSyntax? initialS
public DocumentSyntax Schema => AST;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRuleVisitor.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRuleVisitor.cs
index 72df28bbc..58e5ec6c1 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRuleVisitor.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRuleVisitor.cs
@@ -8,4 +8,4 @@ public abstract class DocumentValidationRuleVisitor : ValidationRuleVisitor
protected DocumentValidationRuleVisitor(DocumentValidationContext context) : base(context)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRules.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRules.cs
index 66a44afa5..37ffe7b4b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRules.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRules.cs
@@ -90,4 +90,4 @@ public static class DocumentValidationRules
ObjectsMustHaveFields,
InputObjectFieldsMustHaveInputTypes
}).ToList();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/ParallelValidationVisitor.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/ParallelValidationVisitor.cs
index f7e11daf4..fd49d857c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/ParallelValidationVisitor.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/ParallelValidationVisitor.cs
@@ -22,4 +22,4 @@ public override void OnLeave(SyntaxNode node)
base.OnLeave(node);
_validationContext.Leave(node);
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/EnumTypesMustBeWellDefined.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/EnumTypesMustBeWellDefined.cs
index 6fa4eabbd..b279f5b6d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/EnumTypesMustBeWellDefined.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/EnumTypesMustBeWellDefined.cs
@@ -58,4 +58,4 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgsMustBeProperlynamed.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgsMustBeProperlynamed.cs
index 0b82001b3..9386a4d7e 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgsMustBeProperlynamed.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgsMustBeProperlynamed.cs
@@ -8,4 +8,4 @@ public class FieldArgsMustBeProperlyNamed : DocumentValidationRuleVisitor
public FieldArgsMustBeProperlyNamed(DocumentValidationContext context) : base(context)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgumentsMustHaveInputTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgumentsMustHaveInputTypes.cs
index 95a69b898..237b7ceea 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgumentsMustHaveInputTypes.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgumentsMustHaveInputTypes.cs
@@ -27,12 +27,14 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
var argNamedType = arg.Type.GetNamedType();
var inputType = inputTypes.FirstOrDefault(_ => _.Name.Equals(argNamedType.Name));
if (inputType == null)
+ {
ReportError(
$"The type of {typeName}.{field}({arg}:) must be Input Type but got: {arg.Type}.",
arg);
+ }
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectFieldsMustHaveInputTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectFieldsMustHaveInputTypes.cs
index 323f6cf72..c4ef617fd 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectFieldsMustHaveInputTypes.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectFieldsMustHaveInputTypes.cs
@@ -21,10 +21,12 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
var fieldNamedType = field.Type.GetNamedType();
var inputFieldType = inputTypes.FirstOrDefault(_ => _.Name.Equals(fieldNamedType.Name));
if (inputFieldType == null)
+ {
ReportError($"The type of {inputObject}.{field} must be Input Type but got: {field.Type}.",
field.Type);
+ }
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectsMustHaveFields.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectsMustHaveFields.cs
index a7a4fc67e..0415a7a0a 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectsMustHaveFields.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectsMustHaveFields.cs
@@ -43,21 +43,25 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
.Concat(inputExts.SelectMany(_ => _.Fields))
.ToArray();
if (!inputFields.Any())
+ {
ReportError($"Input Object type {input.Key} must define one or more fields.",
// ReSharper disable twice PossibleNullReferenceException
input.Value.Select(_ => _.Name).Concat(inputExts.Select(_ => _.Name)).ToArray());
+ }
foreach (var inputField in inputFields)
{
var inputFieldNamedType = inputField.Type.GetNamedType();
var inputType = inputTypes.FirstOrDefault(_ => _.Name.Value == inputFieldNamedType.Name.Value);
if (inputType == null)
+ {
ReportError(
$"The type of {input.Key}.{inputField} must be Input Type but got: {inputField.Type}.",
inputField.Type);
+ }
}
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceExtensionsShouldBeValid.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceExtensionsShouldBeValid.cs
index 50f90ba0b..50532ec47 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceExtensionsShouldBeValid.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceExtensionsShouldBeValid.cs
@@ -45,9 +45,11 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
{
// TODO: check if implemented field type is a subtype of expected field type
if (!implementedField.FieldType.Equals(expectedField.FieldType))
+ {
ReportError(
$"Interface field {implementedInterface}.{expectedField} expects type {expectedField.FieldType} but {objectType}.{implementedField} is type {implementedField.FieldType}.",
expectedField.FieldType, implementedField.FieldType);
+ }
foreach (var expectedArg in expectedField.Arguments)
{
@@ -55,9 +57,11 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
// ReSharper disable once PossibleNullReferenceException
_.Name.Value == expectedArg.Name.Value && _.Type.Equals(expectedArg.Type));
if (implementedArg == null)
+ {
ReportError(
$"Interface field argument {implementedInterface}.{expectedField}({expectedArg.Name}:) expected but {objectType}.{implementedField} does not provide it.",
expectedArg, implementedField);
+ }
}
}
}
@@ -66,4 +70,4 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceFieldsMustHaveOutputTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceFieldsMustHaveOutputTypes.cs
index 62b7111be..3cba0b22d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceFieldsMustHaveOutputTypes.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceFieldsMustHaveOutputTypes.cs
@@ -28,11 +28,13 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
var outputType = outputTypes.FirstOrDefault(_ => _.Name.Equals(fieldNamedType.Name));
if (outputType == null)
+ {
ReportError(
$"The type of {typeName}.{field} must be Output Type but got: {field.FieldType}.",
field.FieldType);
+ }
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/LoneSchemaDefinition.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/LoneSchemaDefinition.cs
index 9b2afa061..db4cd6386 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/LoneSchemaDefinition.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/LoneSchemaDefinition.cs
@@ -8,4 +8,4 @@ public class LoneSchemaDefinition : DocumentValidationRuleVisitor
public LoneSchemaDefinition(DocumentValidationContext context) : base(context)
{
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectFieldsMustHaveOutputTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectFieldsMustHaveOutputTypes.cs
index bebc810ba..e5950e823 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectFieldsMustHaveOutputTypes.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectFieldsMustHaveOutputTypes.cs
@@ -13,16 +13,20 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
{
var outputTypes = node.GetOutputTypeDefinitions();
foreach (var objectType in outputTypes.OfType())
- foreach (var field in objectType.Fields)
{
- var innerFieldType = field.FieldType.GetNamedType();
- var isOutputType = outputTypes.Any(_ => _.Name.Value == innerFieldType.Name.Value);
- if (!isOutputType)
- ReportError(
- $"The type of {objectType}.{field} must be Output Type but got: {field.FieldType}.",
- field.FieldType);
+ foreach (var field in objectType.Fields)
+ {
+ var innerFieldType = field.FieldType.GetNamedType();
+ var isOutputType = outputTypes.Any(_ => _.Name.Value == innerFieldType.Name.Value);
+ if (!isOutputType)
+ {
+ ReportError(
+ $"The type of {objectType}.{field} must be Output Type but got: {field.FieldType}.",
+ field.FieldType);
+ }
+ }
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfaces.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfaces.cs
index b10d28c0f..f7ed9008c 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfaces.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfaces.cs
@@ -30,15 +30,19 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
// ReSharper disable once PossibleNullReferenceException
var interfaceName = @interface.Name.Value;
if (!interfaces.Contains(interfaceName))
+ {
ReportError(
$"Type {objectName} must only implement Interface types, it cannot implement {interfaceName}.",
@interface);
+ }
if (interfacesByName.Count > 1)
+ {
ReportError($"Type {objectName} can only implement {interfaceName} once.", interfacesByName);
+ }
}
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplement.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplement.cs
index 9c6a5969e..cf46c8984 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplement.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplement.cs
@@ -37,27 +37,34 @@ public override VisitAction LeaveDocument(DocumentSyntax schema)
foreach (var @interface in interfaces)
{
if (interfaceFieldMap.TryGetValue(@interface, out var interfaceFields))
+ {
foreach (var interfaceField in interfaceFields)
{
if (fieldMap.TryGetValue(interfaceField.Name, out var objectField))
{
if (!schema.IsTypeSubTypeOf(objectField.FieldType, interfaceField.FieldType))
+ {
ReportError(
$"Interface field {@interface}.{interfaceField} expects type {interfaceField.FieldType} but {objectType}.{objectField} is type {objectField.FieldType}.",
objectField.FieldType, interfaceField.FieldType);
+ }
foreach (var interfaceArg in interfaceField.Arguments)
{
var objectArg =
objectField.Arguments.FirstOrDefault(_ => _.Name.Equals(interfaceArg.Name));
if (objectArg == null)
+ {
ReportError(
$"Interface field argument {@interface}.{interfaceField}({interfaceArg}:) expected but {objectType}.{objectField} does not provide it.",
interfaceArg, objectField);
+ }
else if (!objectArg.Type.Equals(interfaceArg.Type))
+ {
ReportError(
$"Interface field argument {@interface}.{interfaceField}({interfaceArg}:) expects type {interfaceArg.Type} but {objectType}.{objectField}({objectArg}:) is type {objectArg.Type}.",
interfaceArg.Type, objectArg.Type);
+ }
}
foreach (var objectArg in objectField.Arguments)
@@ -65,9 +72,11 @@ public override VisitAction LeaveDocument(DocumentSyntax schema)
var interfaceArg =
interfaceField.Arguments.FirstOrDefault(_ => _.Name.Equals(objectArg.Name));
if (interfaceArg == null && objectArg.IsRequiredArgument())
+ {
ReportError(
$"Object field {objectType}.{objectField} includes required argument {objectArg} that is missing from the Interface field {@interface}.{interfaceField}.",
objectArg, interfaceField);
+ }
}
}
else
@@ -77,6 +86,7 @@ public override VisitAction LeaveDocument(DocumentSyntax schema)
interfaceField, objectType.Name);
}
}
+ }
}
// Validate object impelments interfaces
@@ -85,4 +95,4 @@ public override VisitAction LeaveDocument(DocumentSyntax schema)
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustHaveFields.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustHaveFields.cs
index 221e2c3af..f778b8c5d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustHaveFields.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustHaveFields.cs
@@ -56,4 +56,4 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/SchemaMustHaveRootObjectTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/SchemaMustHaveRootObjectTypes.cs
index a30f3cff2..9eec46983 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/SchemaMustHaveRootObjectTypes.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/SchemaMustHaveRootObjectTypes.cs
@@ -27,10 +27,14 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
.FirstOrDefault(_ => _.Name.Value == queryTypeName);
var queryRootOperationType = (SyntaxNode?)queryRootOpeartionTypeDef?.Type ?? queryType;
if (queryType == null)
+ {
ReportError("Query root type must be provided.", _schema!);
+ }
else if (!(queryType is ObjectTypeDefinitionSyntax))
+ {
ReportError($"Query root type must be Object type, it cannot be {queryType.Name.Value}.",
queryRootOperationType!);
+ }
var mutationRootOpeartionTypeDef =
_schema?.RootOperationTypes.FirstOrDefault(_ => _.OperationType == OperationType.Mutation);
@@ -39,9 +43,11 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
.FirstOrDefault(_ => _.Name.Value == mutationTypeName);
var mutationRootOperationType = (SyntaxNode?)mutationRootOpeartionTypeDef?.Type ?? mutationType;
if (mutationType != null && !(mutationType is ObjectTypeDefinitionSyntax))
+ {
ReportError(
$"Mutation root type must be Object type if provided, it cannot be {mutationType.Name.Value}.",
mutationRootOperationType!);
+ }
var subscriptionRootOpeartionTypeDef =
_schema?.RootOperationTypes.FirstOrDefault(_ => _.OperationType == OperationType.Subscription);
@@ -51,10 +57,12 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
var subscriptionRootOperationType = (SyntaxNode?)subscriptionRootOpeartionTypeDef?.Type ?? subscriptionType;
if (subscriptionType != null && !(subscriptionType is ObjectTypeDefinitionSyntax))
+ {
ReportError(
$"Subscription root type must be Object type if provided, it cannot be {subscriptionType.Name.Value}.",
subscriptionRootOperationType!);
+ }
return true;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/UnionTypesMustBeValid.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/UnionTypesMustBeValid.cs
index 910aff007..d9bd8f944 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/UnionTypesMustBeValid.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/UnionTypesMustBeValid.cs
@@ -44,7 +44,9 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
// ReSharper disable once PossibleNullReferenceException
var types = union.MemberTypes.Concat(unionExtensions.SelectMany(_ => _.Types)).ToList();
if (!types.Any())
+ {
ReportError($"Union type {unionTypeName} must define one or more member types.", nodes);
+ }
// ReSharper disable once PossibleNullReferenceException
foreach (var duplicateTypes in types
@@ -64,12 +66,14 @@ public override VisitAction LeaveDocument(DocumentSyntax node)
return _.Name.Value == type.Name.Value;
});
if (objectType == null)
+ {
ReportError(
$"Union type {unionTypeName} can only include Object types, it cannot include {type.Name.Value}.",
type);
+ }
}
}
return false;
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationContext.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationContext.cs
index 08fd866fd..fd27b72e0 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationContext.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationContext.cs
@@ -39,4 +39,4 @@ public void ReportError(GraphQLServerError error)
public IReadOnlyCollection GetErrors() => Errors.AsReadOnly();
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRule.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRule.cs
index 997bbc0f8..48ee43dc0 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRule.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRule.cs
@@ -3,4 +3,4 @@
namespace GraphZen.LanguageModel.Validation;
-public delegate ValidationRuleVisitor ValidationRule(ValidationContext context);
\ No newline at end of file
+public delegate ValidationRuleVisitor ValidationRule(ValidationContext context);
diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRuleVisitor.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRuleVisitor.cs
index 363d6ff06..12228bdf7 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRuleVisitor.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRuleVisitor.cs
@@ -24,4 +24,4 @@ public void ReportError(string message, IReadOnlyList nodes)
{
ReportError(new GraphQLServerError(message, nodes));
}
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/VisitAction.cs b/src/GraphZen.LanguageModel/LanguageModel/VisitAction.cs
index e27bd7677..d1903dc9b 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/VisitAction.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/VisitAction.cs
@@ -10,4 +10,4 @@ public abstract class VisitAction
public static VisitAction Skip { get; } = new Skip();
public static implicit operator VisitAction(bool value) => value ? Continue : Skip;
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.LanguageModel/LanguageModel/VistitorContext.cs b/src/GraphZen.LanguageModel/LanguageModel/VistitorContext.cs
index 5b0d5530e..81d60db3d 100644
--- a/src/GraphZen.LanguageModel/LanguageModel/VistitorContext.cs
+++ b/src/GraphZen.LanguageModel/LanguageModel/VistitorContext.cs
@@ -5,4 +5,4 @@ namespace GraphZen.LanguageModel;
public class VistitorContext
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.QueryEngine/AssemblyAttributes.cs b/src/GraphZen.QueryEngine/AssemblyAttributes.cs
index 5dc084b98..a6907dfd6 100644
--- a/src/GraphZen.QueryEngine/AssemblyAttributes.cs
+++ b/src/GraphZen.QueryEngine/AssemblyAttributes.cs
@@ -3,4 +3,4 @@
using System.Runtime.CompilerServices;
-[assembly: InternalsVisibleTo("GraphZen.Tests")]
\ No newline at end of file
+[assembly: InternalsVisibleTo("GraphZen.Tests")]
diff --git a/src/GraphZen.QueryEngine/GlobalUsings.cs b/src/GraphZen.QueryEngine/GlobalUsings.cs
index b455400ef..43a56dcd6 100644
--- a/src/GraphZen.QueryEngine/GlobalUsings.cs
+++ b/src/GraphZen.QueryEngine/GlobalUsings.cs
@@ -4,4 +4,4 @@
global using GraphZen.Infrastructure;
global using GraphZen.LanguageModel;
global using GraphZen.TypeSystem;
-global using GraphZen.TypeSystem.Taxonomy;
\ No newline at end of file
+global using GraphZen.TypeSystem.Taxonomy;
diff --git a/src/GraphZen.QueryEngine/QueryEngine/Execute.cs b/src/GraphZen.QueryEngine/QueryEngine/Execute.cs
index fca950ce9..ca630b2cf 100644
--- a/src/GraphZen.QueryEngine/QueryEngine/Execute.cs
+++ b/src/GraphZen.QueryEngine/QueryEngine/Execute.cs
@@ -5,4 +5,4 @@ namespace GraphZen.QueryEngine;
internal static class Execute
{
-}
\ No newline at end of file
+}
diff --git a/src/GraphZen.QueryEngine/QueryEngine/ExecutionContext.cs b/src/GraphZen.QueryEngine/QueryEngine/ExecutionContext.cs
index 23b6cd170..639fb7adf 100644
--- a/src/GraphZen.QueryEngine/QueryEngine/ExecutionContext.cs
+++ b/src/GraphZen.QueryEngine/QueryEngine/ExecutionContext.cs
@@ -62,7 +62,10 @@ private static Maybe