コード例 #1
0
    public static AddImportPlacementOptions GetAddImportPlacementOptions(this ITextBuffer textBuffer, EditorOptionsService optionsProvider, HostLanguageServices languageServices, bool allowInHiddenRegions)
    {
        var editorOptions   = optionsProvider.Factory.GetOptions(textBuffer);
        var configOptions   = new EditorAnalyzerConfigOptions(editorOptions);
        var fallbackOptions = optionsProvider.GlobalOptions.GetAddImportPlacementOptions(languageServices);

        return(configOptions.GetAddImportPlacementOptions(allowInHiddenRegions, fallbackOptions, languageServices));
    }
コード例 #2
0
    private static SyntaxFormattingOptions GetSyntaxFormattingOptionsImpl(ITextBuffer textBuffer, IEditorOptions editorOptions, IIndentationManagerService indentationManager, IGlobalOptionService globalOptions, HostLanguageServices languageServices, bool explicitFormat)
    {
        var configOptions         = new EditorAnalyzerConfigOptions(editorOptions);
        var fallbackOptions       = globalOptions.GetSyntaxFormattingOptions(languageServices);
        var options               = configOptions.GetSyntaxFormattingOptions(fallbackOptions, languageServices);
        var lineFormattingOptions = GetLineFormattingOptionsImpl(textBuffer, editorOptions, indentationManager, explicitFormat);

        return(options.With(lineFormattingOptions));
    }