Skip to content

Commit 89219d1

Browse files
authored
Revert "Remove dependency on EditorFeatures from codelens layer (dotnet#78045)" (dotnet#78162)
This reverts commit 4bd2f81, reversing changes made to 7708789.
1 parent 4f8f5e6 commit 89219d1

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/LanguageServer/Protocol/Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,17 @@
7171
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests" />
7272
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.VisualBasic.LanguageServer.Protocol" />
7373
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices" />
74-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CodeLens" />
75-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
76-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
77-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests" />
7874
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Implementation" />
75+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
76+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
7977
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.LiveShare" />
8078
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests" />
81-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Test.Utilities2" />
82-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.UnitTests" />
83-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
79+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
80+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests" />
8481
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
8582
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Xaml" />
83+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Test.Utilities2" />
84+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.UnitTests" />
8685
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Workspaces.Test.Utilities" />
8786
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Workspaces.UnitTests" />
8887
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.New.IntegrationTests" />

src/VisualStudio/CodeLens/Microsoft.VisualStudio.LanguageServices.CodeLens.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
1313
<ProjectReference Include="..\..\Workspaces\Core\Portable\Microsoft.CodeAnalysis.Workspaces.csproj" />
1414
<ProjectReference Include="..\..\Features\Core\Portable\Microsoft.CodeAnalysis.Features.csproj" />
15-
<ProjectReference Include="..\..\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj" />
15+
<ProjectReference Include="..\..\EditorFeatures\Core\Microsoft.CodeAnalysis.EditorFeatures.csproj" />
1616
<ProjectReference Include="..\..\EditorFeatures\Text\Microsoft.CodeAnalysis.EditorFeatures.Text.csproj" />
1717
</ItemGroup>
1818
<ItemGroup Label="Package References">

src/VisualStudio/CodeLens/ReferenceCodeLensProvider.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
using Microsoft.CodeAnalysis;
1313
using Microsoft.CodeAnalysis.CodeLens;
1414
using Microsoft.CodeAnalysis.Editor;
15+
using Microsoft.CodeAnalysis.Editor.Wpf;
1516
using Microsoft.CodeAnalysis.Host.Mef;
16-
using Microsoft.CodeAnalysis.LanguageServer;
1717
using Microsoft.VisualStudio.Core.Imaging;
1818
using Microsoft.VisualStudio.Language.CodeLens;
1919
using Microsoft.VisualStudio.Language.CodeLens.Remoting;
@@ -104,7 +104,7 @@ private async Task PollForUpdatesAsync()
104104

105105
var projectVersions = await _lazyCodeLensCallbackService.Value.InvokeAsync<ImmutableDictionary<Guid, string>>(
106106
this,
107-
"GetProjectVersionsAsync",
107+
nameof(ICodeLensContext.GetProjectVersionsAsync),
108108
[keys],
109109
_cancellationTokenSource.Token).ConfigureAwait(false);
110110

@@ -200,7 +200,7 @@ public void Dispose()
200200
// raw data from Roslyn OOP such as razor find all reference results
201201
var referenceCountOpt = await _callbackService.InvokeAsync<ReferenceCount?>(
202202
_owner,
203-
"GetReferenceCountAsync",
203+
nameof(ICodeLensContext.GetReferenceCountAsync),
204204
[Descriptor, descriptorContext, _calculatedReferenceCount],
205205
cancellationToken).ConfigureAwait(false);
206206

@@ -243,7 +243,7 @@ public async Task<CodeLensDetailsDescriptor> GetDetailsAsync(CodeLensDescriptorC
243243
// raw data from Roslyn OOP such as razor find all reference results
244244
var referenceLocationDescriptors = await _callbackService.InvokeAsync<(string projectVersion, ImmutableArray<ReferenceLocationDescriptor> references)?>(
245245
_owner,
246-
"FindReferenceLocationsAsync",
246+
nameof(ICodeLensContext.FindReferenceLocationsAsync),
247247
[Descriptor, descriptorContext],
248248
cancellationToken).ConfigureAwait(false);
249249

@@ -263,8 +263,8 @@ public async Task<CodeLensDetailsDescriptor> GetDetailsAsync(CodeLensDescriptorC
263263
ImageId imageId = default;
264264
if (referenceLocationDescriptor.Glyph.HasValue)
265265
{
266-
var imageData = referenceLocationDescriptor.Glyph.Value.GetVsImageData();
267-
imageId = new ImageId(imageData.guid, imageData.id);
266+
var moniker = referenceLocationDescriptor.Glyph.Value.GetImageMoniker();
267+
imageId = new ImageId(moniker.Guid, moniker.Id);
268268
}
269269

270270
return new CodeLensDetailEntryDescriptor()

0 commit comments

Comments
 (0)