Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added implement type options #1672

Merged
merged 7 commits into from
Jan 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use pattern matching
  • Loading branch information
filipw committed Dec 28, 2019
commit 4eb2c05c4fe931f5bbc18a66f22ca46139df1b7f
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ public OptionSet Process(OptionSet currentOptionSet, OmniSharpOptions omniSharpO
{
if (omniSharpOptions.ImplementTypeOptions.InsertionBehavior != null)
{
var insertionBehaviorOptionValue = _implementTypeOptions.Value.GetField("InsertionBehavior", BindingFlags.Public | BindingFlags.Static)?.GetValue(null) as IOption;
if (insertionBehaviorOptionValue != null)
if (_implementTypeOptions.Value.GetField("InsertionBehavior", BindingFlags.Public | BindingFlags.Static)?.GetValue(null) is IOption insertionBehaviorOptionValue)
{
currentOptionSet = currentOptionSet.WithChangedOption(new OptionKey(insertionBehaviorOptionValue, LanguageNames.CSharp), (int)omniSharpOptions.ImplementTypeOptions.InsertionBehavior);
}
}

var propertyGenerationBehaviorOptionValue = _implementTypeOptions.Value.GetField("PropertyGenerationBehavior", BindingFlags.Public | BindingFlags.Static)?.GetValue(null) as IOption;
if (propertyGenerationBehaviorOptionValue != null)
if (omniSharpOptions.ImplementTypeOptions.PropertyGenerationBehavior != null)
{
currentOptionSet = currentOptionSet.WithChangedOption(new OptionKey(propertyGenerationBehaviorOptionValue, LanguageNames.CSharp), (int)omniSharpOptions.ImplementTypeOptions.PropertyGenerationBehavior);
if (_implementTypeOptions.Value.GetField("PropertyGenerationBehavior", BindingFlags.Public | BindingFlags.Static)?.GetValue(null) is IOption propertyGenerationBehaviorOptionValue)
{
currentOptionSet = currentOptionSet.WithChangedOption(new OptionKey(propertyGenerationBehaviorOptionValue, LanguageNames.CSharp), (int)omniSharpOptions.ImplementTypeOptions.PropertyGenerationBehavior);
}
}

return currentOptionSet;
Expand Down