提交 5ececa52 编写于 作者: P Paul Vick 提交者: GitHub

Merge pull request #14719 from panopticoncentral/fixremoterc

Fix JSON remoting for CodeLens
......@@ -120,12 +120,16 @@ private static async Task<ReferenceLocationDescriptor> GetDescriptorOfEnclosingS
var symbol = semanticModel.GetDeclaredSymbol(node);
var glyph = symbol?.GetGlyph();
var startLinePosition = location.GetLineSpan().StartLinePosition;
var documentId = solution.GetDocument(location.SourceTree)?.Id;
return new ReferenceLocationDescriptor(longName,
semanticModel.Language,
glyph,
location,
solution.GetDocument(location.SourceTree)?.Id,
startLinePosition.Line,
startLinePosition.Character,
documentId.ProjectId.Id,
documentId.Id,
line.TrimEnd(),
referenceSpan.Start,
referenceSpan.Length,
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace Microsoft.CodeAnalysis.CodeLens
{
/// <summary>
......@@ -11,7 +13,9 @@ internal sealed class ReferenceLocationDescriptor
public int ColumnNumber { get; }
public DocumentId DocumentId { get; }
public Guid ProjectGuid { get; }
public Guid DocumentGuid { get; }
/// <summary>
/// Language of the reference location
......@@ -63,26 +67,7 @@ internal sealed class ReferenceLocationDescriptor
/// </summary>
public string AfterReferenceText2 { get; }
public ReferenceLocationDescriptor(string longDescription, string language, Glyph? glyph, Location location, DocumentId documentId, string referenceLineText, int referenceStart, int referenceLength, string beforeReferenceText1, string beforeReferenceText2, string afterReferenceText1, string afterReferenceText2)
{
LongDescription = longDescription;
Language = language;
Glyph = glyph;
var sourceText = location.GetLineSpan().StartLinePosition;
LineNumber = sourceText.Line;
ColumnNumber = sourceText.Character;
// We want to keep track of the location's document if it comes from a file in your solution.
DocumentId = documentId;
ReferenceLineText = referenceLineText;
ReferenceStart = referenceStart;
ReferenceLength = referenceLength;
BeforeReferenceText1 = beforeReferenceText1;
BeforeReferenceText2 = beforeReferenceText2;
AfterReferenceText1 = afterReferenceText1;
AfterReferenceText2 = afterReferenceText2;
}
public ReferenceLocationDescriptor(string longDescription, string language, Glyph? glyph, int lineNumber, int columnNumber, DocumentId documentId, 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;
......@@ -90,7 +75,8 @@ public ReferenceLocationDescriptor(string longDescription, string language, Glyp
LineNumber = lineNumber;
ColumnNumber = columnNumber;
// We want to keep track of the location's document if it comes from a file in your solution.
DocumentId = documentId;
ProjectGuid = projectGuid;
DocumentGuid = documentGuid;
ReferenceLineText = referenceLineText;
ReferenceStart = referenceStart;
ReferenceLength = referenceLength;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册