提交 064c0c84 编写于 作者: S Sam Harwell

Only acquire IEditorOptionsFactoryService once for a contained document

Closes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1124280
上级 435891d8
......@@ -78,6 +78,7 @@ public static ContainedDocument TryGetContainedDocument(DocumentId id)
private readonly IComponentModel _componentModel;
private readonly Workspace _workspace;
private readonly ITextDifferencingSelectorService _differenceSelectorService;
private readonly IEditorOptionsFactoryService _editorOptionsFactoryService;
private readonly HostType _hostType;
private readonly ReiteratedVersionSnapshotTracker _snapshotTracker;
private readonly AbstractFormattingRule _vbHelperFormattingRule;
......@@ -113,6 +114,7 @@ public static ContainedDocument TryGetContainedDocument(DocumentId id)
BufferCoordinator = bufferCoordinator;
_differenceSelectorService = componentModel.GetService<ITextDifferencingSelectorService>();
_editorOptionsFactoryService = _componentModel.GetService<IEditorOptionsFactoryService>();
_snapshotTracker = new ReiteratedVersionSnapshotTracker(SubjectBuffer);
_vbHelperFormattingRule = vbHelperFormattingRule;
......@@ -870,8 +872,7 @@ private void GetVisibleAndTextSpan(SourceText text, List<TextSpan> spans, int sp
private int GetBaseIndentation(SyntaxNode root, SourceText text, TextSpan span)
{
// Is this right? We should probably get this from the IVsContainedLanguageHost instead.
var editorOptionsFactory = _componentModel.GetService<IEditorOptionsFactoryService>();
var editorOptions = editorOptionsFactory.GetOptions(DataBuffer);
var editorOptions = _editorOptionsFactoryService.GetOptions(DataBuffer);
var additionalIndentation = GetAdditionalIndentation(root, text, span);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册