提交 4c50abd9 编写于 作者: J Jason Malinowski

Remove some gratuitious uses of GetOpenTextContainer()

The only remaining uses now are ones actually testing the core workspace.
上级 5cd40392
......@@ -131,7 +131,6 @@ public void TestExtractMethodCommandHandlerErrorMessage()
using var workspace = TestWorkspace.CreateCSharp(markupCode);
var testDocument = workspace.Documents.Single();
var container = testDocument.GetOpenTextContainer();
var view = testDocument.GetTextView();
view.Selection.Select(new SnapshotSpan(
......
......@@ -5,6 +5,7 @@
using System.Collections.Immutable;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.UnitTests;
......@@ -192,7 +193,7 @@ private protected static RunCodeActionParams CreateRunCodeActionParams(string co
foreach (var document in workspace.Documents)
{
var text = document.GetOpenTextContainer().CurrentText;
var text = solution.GetDocument(document.Id).GetTextSynchronously(CancellationToken.None);
foreach (var kvp in document.AnnotatedSpans)
{
locations.GetOrAdd(kvp.Key, CreateLocation)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册