Skip to content

Commit a6b4e7f

Browse files
authored
Add Copilot semantic search (#79673)
1 parent 160f268 commit a6b4e7f

File tree

9 files changed

+15
-9
lines changed

9 files changed

+15
-9
lines changed

eng/Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
<PackageVersion Include="Microsoft.VisualStudio.Search" Version="17.10.961-preview.2" />
7878
<PackageVersion Include="Microsoft.VisualStudio.WinForms.Interfaces" Version="17.0.0-previews-4-31709-430" />
7979
<PackageVersion Include="Microsoft.VisualStudio.Workspace.VSIntegration" Version="17.9.29-preview-0001" />
80+
<PackageVersion Include="Microsoft.VisualStudio.Copilot.Roslyn.SemanticSearch" Version="18.0.533-alpha" />
8081
<PackageVersion Include="VsWebSite.Interop" Version="8.0.50727" />
8182
<PackageVersion Include="NuGet.VisualStudio" Version="6.0.0-preview.0.15" />
8283
<PackageVersion Include="NuGet.VisualStudio.Contracts" Version="6.0.0-preview.0.15" />

src/Features/ExternalAccess/Copilot/Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<OutputType>Library</OutputType>
66
<RootNamespace>Microsoft.CodeAnalysis.ExternalAccess.Copilot</RootNamespace>
7-
<TargetFrameworks>$(NetVSShared);net472</TargetFrameworks>
7+
<TargetFrameworks>$(NetVSShared);netstandard2.0</TargetFrameworks>
88
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
99

1010
<!-- NuGet -->

src/NuGet/VS.ExternalAPIs.Roslyn.Package/VS.ExternalAPIs.Roslyn.Package.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
<ProjectReference Include="..\..\Features\Core\Portable\Microsoft.CodeAnalysis.Features.csproj" PrivateAssets="all" />
4343
<ProjectReference Include="..\..\Features\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.Features.csproj" PrivateAssets="all" />
4444
<ProjectReference Include="..\..\Features\ExternalAccess\AspNetCore\Microsoft.CodeAnalysis.ExternalAccess.AspNetCore.csproj" PrivateAssets="all" />
45-
<ProjectReference Include="..\..\Features\ExternalAccess\Copilot\Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj" PrivateAssets="all" />
4645
<ProjectReference Include="..\..\Features\VisualBasic\Portable\Microsoft.CodeAnalysis.VisualBasic.Features.vbproj" PrivateAssets="all" />
4746
<ProjectReference Include="..\..\Interactive\Host\Microsoft.CodeAnalysis.InteractiveHost.csproj" PrivateAssets="all" />
4847
<ProjectReference Include="..\..\LanguageServer\Protocol\Microsoft.CodeAnalysis.LanguageServer.Protocol.csproj" PrivateAssets="all" />
@@ -83,7 +82,6 @@
8382
<_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.EditorFeatures\$(Configuration)\net472\Microsoft.CodeAnalysis.EditorFeatures.dll" TargetDir="" />
8483
<_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.ExternalAccess.Apex\$(Configuration)\net472\Microsoft.CodeAnalysis.ExternalAccess.Apex.dll" TargetDir="" />
8584
<_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.ExternalAccess.AspNetCore\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.ExternalAccess.AspNetCore.dll" TargetDir="" />
86-
<_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.ExternalAccess.Copilot\$(Configuration)\net472\Microsoft.CodeAnalysis.ExternalAccess.Copilot.dll" TargetDir="" />
8785
<_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.ExternalAccess.Debugger\$(Configuration)\net472\Microsoft.CodeAnalysis.ExternalAccess.Debugger.dll" TargetDir="" />
8886
<_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.ExternalAccess.EditorConfigGenerator\$(Configuration)\net472\Microsoft.CodeAnalysis.ExternalAccess.EditorConfigGenerator.dll" TargetDir="" />
8987
<_File Include="$(ArtifactsBinDir)Microsoft.CodeAnalysis.ExternalAccess.Extensions\$(Configuration)\netstandard2.0\Microsoft.CodeAnalysis.ExternalAccess.Extensions.dll" TargetDir="" />

src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@
354354
<PackageReference Include="SQLitePCLRaw.bundle_green" ForceIncludeInVsix="true" PkgDefEntry="CodeBase" />
355355
<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" ForceIncludeInVsix="true" PkgDefEntry="CodeBase" />
356356
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" GeneratePathProperty="true" ExcludeAssets="all" PrivateAssets="all" />
357+
<PackageReference Include="Microsoft.VisualStudio.Copilot.Roslyn.SemanticSearch" ForceIncludeInVsix="true" />
357358
</ItemGroup>
358359
<ItemGroup>
359360
<Content Include="$(PkgSQLitePCLRaw_lib_e_sqlite3)\runtimes\win-x64\native\e_sqlite3.dll">

src/VisualStudio/Setup/source.extension.vsixmanifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.VisualStudio.LanguageServices.ExternalAccess.Copilot.dll" />
7171
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.CodeAnalysis.LanguageServer.Protocol.dll" />
7272
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.CommonLanguageServerProtocol.Framework.dll" />
73+
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.VisualStudio.Copilot.Roslyn.SemanticSearch.dll" />
7374
</Assets>
7475
<Prerequisites>
7576
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,19.0)" DisplayName="Visual Studio core editor" />

src/Workspaces/Remote/Core/ExportProviderBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private void ThrowOnUnexpectedErrors(CompositionConfiguration configuration, Com
198198
{
199199
// The ToString for the composition failed exception doesn't output a nice set of errors by default, so log it separately
200200
LogError($"Encountered errors in the MEF composition:{Environment.NewLine}{ex.ErrorsAsString}");
201-
throw;
201+
throw new CompositionFailedException(ex.Message + Environment.NewLine + ex.ErrorsAsString);
202202
}
203203
}
204204
}

src/Workspaces/Remote/ServiceHub.CoreComponents/CoreComponents.Shared.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"Microsoft.NETCore.App.Runtime.win-{arch}"
3636
"Microsoft.WindowsDesktop.App.Runtime.win-{arch}"
3737
-->
38-
<PackageReference Include="Microsoft.NETCore.App.crossgen2.win-x64" Condition="'$(GenerateReadyToRun)' == 'true'" ExcludeAssets="all" PrivateAssets="all" GeneratePathProperty="true" />
38+
<PackageReference Include="Microsoft.NETCore.App.crossgen2.win-x64" Condition="'$(GenerateReadyToRun)' == 'true'" ExcludeAssets="all" PrivateAssets="all" GeneratePathProperty="true" />
39+
<PackageReference Include="Microsoft.VisualStudio.Copilot.Roslyn.SemanticSearch" />
3940
</ItemGroup>
4041

4142
<Target Name="CalculateCrossgenInputs" DependsOnTargets="PublishItemsOutputGroup">
@@ -66,6 +67,7 @@
6667
<_R2RAssemblies Include="Microsoft.VisualStudio.Composition.dll" />
6768
<_R2RAssemblies Include="Microsoft.VisualStudio.Telemetry.dll" />
6869
<_R2RAssemblies Include="Microsoft.VisualStudio.Threading.dll" />
70+
<_R2RAssemblies Include="Microsoft.VisualStudio.Copilot.Roslyn.SemanticSearch.dll" />
6971
<_R2RAssemblies Include="MessagePack.dll" />
7072
<_R2RAssemblies Include="Nerdback.Streams.dll" />
7173
<_R2RAssemblies Include="Newtonsoft.Json.dll" />

src/Workspaces/Remote/ServiceHub/Host/RemoteExportProviderBuilder.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ internal sealed class RemoteExportProviderBuilder : ExportProviderBuilder
2222
{
2323
internal static readonly ImmutableArray<string> RemoteHostAssemblyNames =
2424
MefHostServices.DefaultAssemblyNames
25-
.Add("Microsoft.CodeAnalysis.ExternalAccess.AspNetCore")
2625
.Add("Microsoft.CodeAnalysis.Remote.ServiceHub")
27-
.Add("Microsoft.CodeAnalysis.ExternalAccess.Razor.Features")
2826
.Add("Microsoft.CodeAnalysis.Remote.Workspaces")
29-
.Add("Microsoft.CodeAnalysis.ExternalAccess.Extensions");
27+
.Add("Microsoft.CodeAnalysis.ExternalAccess.AspNetCore")
28+
.Add("Microsoft.CodeAnalysis.ExternalAccess.Razor.Features")
29+
.Add("Microsoft.CodeAnalysis.ExternalAccess.Extensions")
30+
.Add("Microsoft.CodeAnalysis.ExternalAccess.Copilot")
31+
.Add("Microsoft.VisualStudio.Copilot.Roslyn.SemanticSearch");
3032

3133
private static ExportProvider? s_instance;
3234
internal static ExportProvider ExportProvider
@@ -74,7 +76,7 @@ protected override void LogTrace(string message)
7476
protected override bool ContainsUnexpectedErrors(IEnumerable<string> erroredParts, ImmutableList<PartDiscoveryException> partDiscoveryExceptions)
7577
{
7678
// Verify that we have exactly the MEF errors that we expect. If we have less or more this needs to be updated to assert the expected behavior.
77-
var expectedErrorPartsSet = new HashSet<string>(["PythiaSignatureHelpProvider", "VSTypeScriptAnalyzerService", "CodeFixService"]);
79+
var expectedErrorPartsSet = new HashSet<string>(["PythiaSignatureHelpProvider", "VSTypeScriptAnalyzerService", "CodeFixService", "CSharpMapCodeService", "CopilotSemanticSearchQueryExecutor"]);
7880
var hasUnexpectedErroredParts = erroredParts.Any(part => !expectedErrorPartsSet.Contains(part));
7981

8082
if (hasUnexpectedErroredParts)

src/Workspaces/Remote/ServiceHub/Microsoft.CodeAnalysis.Remote.ServiceHub.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<ProjectReference Include="..\..\..\Tools\ExternalAccess\Extensions\Microsoft.CodeAnalysis.ExternalAccess.Extensions.csproj" />
1919
<ProjectReference Include="..\..\..\Tools\ExternalAccess\Razor\Features\Microsoft.CodeAnalysis.ExternalAccess.Razor.Features.csproj" />
2020
<ProjectReference Include="..\..\..\Tools\ExternalAccess\RazorCompiler\Microsoft.CodeAnalysis.ExternalAccess.RazorCompiler.csproj" />
21+
<ProjectReference Include="..\..\..\Features\ExternalAccess\Copilot\Microsoft.CodeAnalysis.ExternalAccess.Copilot.csproj" />
2122
<ProjectReference Include="..\..\..\Features\ExternalAccess\AspNetCore\Microsoft.CodeAnalysis.ExternalAccess.AspNetCore.csproj" />
2223
<ProjectReference Include="..\Core\Microsoft.CodeAnalysis.Remote.Workspaces.csproj" />
2324
</ItemGroup>

0 commit comments

Comments
 (0)