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

Simplify auto properties

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