提交 5cd1dc03 编写于 作者: H HeeJae Chang 提交者: Sam Harwell

Simplify auto properties

上级 be42b444
......@@ -9,14 +9,20 @@ namespace Microsoft.CodeAnalysis.CodeLens
/// </summary>
internal sealed class ReferenceLocationDescriptor
{
public int LineNumber { get; }
public int ColumnNumber { get; }
public Guid ProjectGuid { get; }
public Guid DocumentGuid { get; }
/// <summary>
/// Reference's line based on the document content
/// </summary>
public int LineNumber { get; }
/// <summary>
/// Reference's character based on the document content
/// </summary>
public int ColumnNumber { get; }
/// <summary>
/// Language of the reference location
/// </summary>
......@@ -67,7 +73,21 @@ internal sealed class ReferenceLocationDescriptor
/// </summary>
public string AfterReferenceText2 { get; }
public ReferenceLocationDescriptor(string longDescription, string language, Glyph? glyph, int lineNumber, int columnNumber, Guid projectGuid, Guid documentGuid, string referenceLineText, int referenceStart, int referenceLength, string beforeReferenceText1, string beforeReferenceText2, string afterReferenceText1, string afterReferenceText2)
public ReferenceLocationDescriptor(
string longDescription,
string language,
Glyph? glyph,
int lineNumber,
int columnNumber,
Guid projectGuid,
Guid documentGuid,
string referenceLineText,
int referenceStart,
int referenceLength,
string beforeReferenceText1,
string beforeReferenceText2,
string afterReferenceText1,
string afterReferenceText2)
{
LongDescription = longDescription;
Language = language;
......
......@@ -16,7 +16,6 @@ namespace Microsoft.CodeAnalysis
internal partial class TextDocumentState
{
protected readonly SolutionServices solutionServices;
private readonly DocumentInfo.DocumentAttributes attributes;
/// <summary>
/// A direct reference to our source text. This is only kept around in specialized scenarios.
......@@ -46,38 +45,36 @@ internal partial class TextDocumentState
ValueSource<DocumentStateChecksums> lazyChecksums)
{
this.solutionServices = solutionServices;
this.attributes = attributes;
this.sourceTextOpt = sourceTextOpt;
this.textAndVersionSource = textAndVersionSource;
Attributes = attributes;
// for now, let it re-calculate if anything changed.
// TODO: optimize this so that we only re-calcuate checksums that are actually changed
_lazyChecksums = new AsyncLazy<DocumentStateChecksums>(ComputeChecksumsAsync, cacheResult: true);
}
public DocumentInfo.DocumentAttributes Attributes { get; }
public DocumentId Id
{
get { return this.attributes.Id; }
get { return Attributes.Id; }
}
public string FilePath
{
get { return this.attributes.FilePath; }
}
public DocumentInfo.DocumentAttributes Attributes
{
get { return this.attributes; }
get { return Attributes.FilePath; }
}
public IReadOnlyList<string> Folders
{
get { return this.attributes.Folders; }
get { return Attributes.Folders; }
}
public string Name
{
get { return this.attributes.Name; }
get { return this.Attributes.Name; }
}
public static TextDocumentState Create(DocumentInfo info, SolutionServices services)
......@@ -323,7 +320,7 @@ public TextDocumentState UpdateText(TextAndVersion newTextAndVersion, Preservati
return new TextDocumentState(
this.solutionServices,
this.attributes,
this.Attributes,
sourceTextOpt: null,
textAndVersionSource: newTextSource,
lazyChecksums: null);
......@@ -357,7 +354,7 @@ public TextDocumentState UpdateText(TextLoader loader, PreservationMode mode)
return new TextDocumentState(
this.solutionServices,
this.attributes,
this.Attributes,
sourceTextOpt: null,
textAndVersionSource: newTextSource,
lazyChecksums: null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册