@@ -40,35 +40,34 @@ internal static bool UpdateOptions(Workspace workspace, OmniSharpEditorConfigOpt
4040
4141 // add o# option values:
4242 var lineFormattingOptions = editorConfigOptions . LineFormattingOptions ;
43- AddOption ( FormattingOptions2 . UseTabs , lineFormattingOptions . UseTabs , builder ) ;
44- AddOption ( FormattingOptions2 . TabSize , lineFormattingOptions . TabSize , builder ) ;
45- AddOption ( FormattingOptions2 . IndentationSize , lineFormattingOptions . IndentationSize , builder ) ;
46- AddOption ( FormattingOptions2 . NewLine , lineFormattingOptions . NewLine , builder ) ;
43+ AddOption ( FormattingOptions2 . UseTabs , lineFormattingOptions . UseTabs ) ;
44+ AddOption ( FormattingOptions2 . TabSize , lineFormattingOptions . TabSize ) ;
45+ AddOption ( FormattingOptions2 . IndentationSize , lineFormattingOptions . IndentationSize ) ;
46+ AddOption ( FormattingOptions2 . NewLine , lineFormattingOptions . NewLine ) ;
4747
4848 var implementTypeOptions = editorConfigOptions . ImplementTypeOptions ;
49- AddOption ( ImplementTypeOptionsStorage . InsertionBehavior , ( ImplementTypeInsertionBehavior ) implementTypeOptions . InsertionBehavior , builder ) ;
50- AddOption ( ImplementTypeOptionsStorage . PropertyGenerationBehavior , ( ImplementTypePropertyGenerationBehavior ) implementTypeOptions . PropertyGenerationBehavior , builder ) ;
49+ AddOption ( ImplementTypeOptionsStorage . InsertionBehavior , ( ImplementTypeInsertionBehavior ) implementTypeOptions . InsertionBehavior ) ;
50+ AddOption ( ImplementTypeOptionsStorage . PropertyGenerationBehavior , ( ImplementTypePropertyGenerationBehavior ) implementTypeOptions . PropertyGenerationBehavior ) ;
5151
5252 var newFallbackOptions = oldFallbackOptions . SetItem (
5353 LanguageNames . CSharp ,
5454 StructuredAnalyzerConfigOptions . Create ( new DictionaryAnalyzerConfigOptions ( builder . ToImmutable ( ) ) ) ) ;
5555
5656 var newSolution = oldSolution . WithFallbackAnalyzerOptions ( newFallbackOptions ) ;
5757 return workspace . TryApplyChanges ( newSolution ) ;
58+
59+ void AddOption < T > (
60+ PerLanguageOption2 < T > option ,
61+ T value )
62+ {
63+ var configName = option . Definition . ConfigName ;
64+ var configValue = option . Definition . Serializer . Serialize ( value ) ;
65+ builder [ configName ] = configValue ;
66+ }
5867 }
5968 catch ( Exception e ) when ( FatalError . ReportAndPropagate ( e , ErrorSeverity . Diagnostic ) )
6069 {
6170 throw ExceptionUtilities . Unreachable ( ) ;
6271 }
63-
64- static void AddOption < T > (
65- PerLanguageOption2 < T > option ,
66- T value ,
67- ImmutableDictionary < string , string > . Builder builder )
68- {
69- var configName = option . Definition . ConfigName ;
70- var configValue = option . Definition . Serializer . Serialize ( value ) ;
71- builder . Add ( configName , configValue ) ;
72- }
7372 }
7473}
0 commit comments