Beispiel #1
0
 private bool TryGetOptionForBuffer(ITextBuffer textBuffer, OptionKey option, out object?value)
 {
     if (option.Option == FormattingOptions.UseTabs)
     {
         value = !_indentationManagerService.UseSpacesForWhitespace(textBuffer, explicitFormat: false);
         return(true);
     }
     else if (option.Option == FormattingOptions.TabSize)
     {
         value = _indentationManagerService.GetTabSize(textBuffer, explicitFormat: false);
         return(true);
     }
     else if (option.Option == FormattingOptions.IndentationSize)
     {
         value = _indentationManagerService.GetIndentSize(textBuffer, explicitFormat: false);
         return(true);
     }
     else
     {
         value = null;
         return(false);
     }
 }
Beispiel #2
0
 public bool UseSpacesForWhitespace(SourceText text)
 => _indentationManagerService.UseSpacesForWhitespace(GetRequiredTextBuffer(text), explicitFormat: false);