Skip to content

Commit 788461b

Browse files
Reapply "Remove dependency on EditorFeatures from codelens layer (#78045)" (#78162) (#78263)
2 parents 61db35f + 04bac5b commit 788461b

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,18 @@
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.Implementation" />
74+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CodeLens" />
7575
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
76-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
77-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.LiveShare" />
78-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests" />
7976
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
8077
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests" />
81-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
82-
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Xaml" />
78+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Implementation" />
79+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.LiveShare" />
80+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests" />
8381
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Test.Utilities2" />
8482
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.UnitTests" />
83+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
84+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
85+
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Xaml" />
8586
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Workspaces.Test.Utilities" />
8687
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.Workspaces.UnitTests" />
8788
<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="..\..\EditorFeatures\Core\Microsoft.CodeAnalysis.EditorFeatures.csproj" />
15+
<ProjectReference Include="..\..\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.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;
1615
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-
nameof(ICodeLensContext.GetProjectVersionsAsync),
107+
"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-
nameof(ICodeLensContext.GetReferenceCountAsync),
203+
"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-
nameof(ICodeLensContext.FindReferenceLocationsAsync),
246+
"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 moniker = referenceLocationDescriptor.Glyph.Value.GetImageMoniker();
267-
imageId = new ImageId(moniker.Guid, moniker.Id);
266+
var imageData = referenceLocationDescriptor.Glyph.Value.GetVsImageData();
267+
imageId = new ImageId(imageData.guid, imageData.id);
268268
}
269269

270270
return new CodeLensDetailEntryDescriptor()

0 commit comments

Comments
 (0)