提交 b8622fe5 编写于 作者: H Heejae Chang

cleanup some code

renamed id to Id to match other variable names. and added readonly.
上级 49aec597
......@@ -165,7 +165,7 @@ public virtual async Task<object> GetPreviewAsync(CancellationToken cancellation
AssertIsForeground();
var preferredDocumentId = Workspace.GetDocumentIdInCurrentContext(SubjectBuffer.AsTextContainer());
var preferredProjectid = preferredDocumentId == null ? null : preferredDocumentId.ProjectId;
var preferredProjectId = preferredDocumentId?.ProjectId;
var extensionManager = this.Workspace.Services.GetService<IExtensionManager>();
var previewContent = await extensionManager.PerformFunctionAsync(Provider, async () =>
......@@ -181,7 +181,7 @@ public virtual async Task<object> GetPreviewAsync(CancellationToken cancellation
{
// TakeNextPreviewAsync() needs to run on UI thread.
AssertIsForeground();
return await previewResult.TakeNextPreviewAsync(preferredDocumentId, preferredProjectid, cancellationToken).ConfigureAwait(true);
return await previewResult.TakeNextPreviewAsync(preferredDocumentId, preferredProjectId, cancellationToken).ConfigureAwait(true);
}
// GetPreviewPane() below needs to run on UI thread. We use ConfigureAwait(true) to stay on the UI thread.
......@@ -200,7 +200,7 @@ public virtual async Task<object> GetPreviewAsync(CancellationToken cancellation
string language;
string projectType;
Workspace.GetLanguageAndProjectType(preferredProjectid, out language, out projectType);
Workspace.GetLanguageAndProjectType(preferredProjectId, out language, out projectType);
return previewPaneService.GetPreviewPane(GetDiagnostic(), language, projectType, previewContent);
}
......
......@@ -90,7 +90,7 @@ internal abstract partial class AbstractProject : IVisualStudioHostProject
/// <summary>
/// string (Guid) of the _hierarchy project type
/// </summary>
private string _projectType;
private readonly string _projectType;
// PERF: Create these event handlers once to be shared amongst all documents (the sender arg identifies which document and project)
private static readonly EventHandler<bool> s_documentOpenedEventHandler = OnDocumentOpened;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册