コード例 #1
0
        private void FormatCode(SnapshotSpan span, bool selectResult)
        {
            var options = _pyService.GetCodeFormattingOptions();

            options.NewLineFormat = _textView.Options.GetNewLineCharacter();
            new CodeFormatter(_serviceProvider, _textView, options).FormatCode(span, selectResult);
        }
コード例 #2
0
ファイル: EditFilter.cs プロジェクト: leeohalloran/PTVS
        private async void FormatCode(SnapshotSpan span, bool selectResult) {
            var analysis = _textView.GetAnalysisEntry(span.Snapshot.TextBuffer, _serviceProvider);
            if (analysis != null) {
                var options = _pyService.GetCodeFormattingOptions();
                options.NewLineFormat = _textView.Options.GetNewLineCharacter();

                await analysis.Analyzer.FormatCodeAsync(span, _textView, options, selectResult);
            }
        }
コード例 #3
0
        private async void FormatCode(SnapshotSpan span, bool selectResult)
        {
            AnalysisEntry entry;

            if (_entryService == null || !_entryService.TryGetAnalysisEntry(_textView, span.Snapshot.TextBuffer, out entry))
            {
                return;
            }

            var options = _pyService.GetCodeFormattingOptions();

            options.NewLineFormat = _textView.Options.GetNewLineCharacter();

            await entry.Analyzer.FormatCodeAsync(span, _textView, options, selectResult);
        }