/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/EditorFeatures/VisualBasic/EndConstructGeneration/AbstractEndConstructResult.vb
35 строк
2 KB
Manish Vasani
Fix CA1822 (Make static) violations with iterative FixAll application
08 июл 2020, 20:23
08 июл 2020, 20:23
d626be1
Код
Авторство
О чём код?
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.VisualStudio.Text Imports Microsoft.VisualStudio.Text.Editor Imports Microsoft.VisualStudio.Text.Operations Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.EndConstructGeneration Friend MustInherit Class AbstractEndConstructResult Public MustOverride Sub Apply(textView As ITextView, subjectBuffer As ITextBuffer, caretPosition As Integer, smartIndentationService As ISmartIndentationService, undoHistoryRegistry As ITextUndoHistoryRegistry, editorOperationsFactoryService As IEditorOperationsFactoryService) Protected Shared Sub SetIndentForFirstBlankLine(textView As ITextView, subjectBuffer As ITextBuffer, smartIndentationService As ISmartIndentationService, cursorLine As ITextSnapshotLine) For lineNumber = cursorLine.LineNumber To subjectBuffer.CurrentSnapshot.LineCount Dim line = subjectBuffer.CurrentSnapshot.GetLineFromLineNumber(lineNumber) If String.IsNullOrWhiteSpace(line.GetText()) Then Dim indent = textView.GetDesiredIndentation(smartIndentationService, line) If indent.HasValue Then textView.TryMoveCaretToAndEnsureVisible(New VirtualSnapshotPoint(line.Start, indent.Value)) Else textView.TryMoveCaretToAndEnsureVisible(New VirtualSnapshotPoint(line.Start, 0)) End If Return End If Next End Sub End Class End Namespace