Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ out
.razorExtension/
.vscode-test/
.roslynCopilot/
.testDiscovery/
msbuild/signing/signJs/*.log
msbuild/signing/signVsix/*.log
dist/
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"roslyn": "5.9.0-1.26303.15",
"omniSharp": "1.39.14",
"razorOmnisharp": "7.0.0-preview.23363.1",
"xamlTools": "18.9.11909.33"
"xamlTools": "18.9.11909.33",
"testDiscovery": "0.1.0-dev"
},
"main": "./dist/extension",
"l10n": "./l10n",
Expand Down Expand Up @@ -1479,6 +1480,10 @@
"roslynCopilot": {
"description": "%configuration.dotnet.server.componentPaths.roslynCopilot%",
"type": "string"
},
"testDiscovery": {
"description": "%configuration.dotnet.server.componentPaths.testDiscovery%",
"type": "string"
}
},
"default": {}
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"configuration.dotnet.server.componentPaths.roslynDevKit": "Overrides the folder path for the .roslynDevKit component of the language server",
"configuration.dotnet.server.componentPaths.xamlTools": "Overrides the folder path for the .xamlTools component of the language server",
"configuration.dotnet.server.componentPaths.roslynCopilot": "Overrides the folder path for the .roslynCopilot component of the language server",
"configuration.dotnet.server.componentPaths.testDiscovery": "Overrides the folder path for the .testDiscovery component of the language server",
"configuration.dotnet.server.componentPaths.razorExtension": "Overrides the folder path for the Razor extension component of the language server",
"configuration.dotnet.server.startTimeout": "Specifies a timeout (in ms) for the client to successfully start and connect to the language server.",
"configuration.dotnet.server.waitForDebugger": "Passes the --debug flag when launching the server to allow a debugger to be attached. (Requires extension restart)",
Expand Down
6 changes: 6 additions & 0 deletions src/lsptoolshost/extensions/builtInComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export const componentInfo: { [key: string]: ComponentInfo } = {
componentDllPaths: ['Microsoft.VisualStudio.Copilot.Roslyn.LanguageServer.dll'],
isOptional: true,
},
testDiscovery: {
defaultFolderName: '.testDiscovery',
optionName: 'testDiscovery',
componentDllPaths: ['Microsoft.VisualStudio.CSharpDevKit.SourceTestDiscovery.dll'],
isOptional: true,
},
};

export function getComponentPaths(
Expand Down
10 changes: 10 additions & 0 deletions src/lsptoolshost/server/roslynLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,16 @@ export class RoslynLanguageServer {
);
}

// Also include the C# Dev Kit source-based test discovery extension, if present. The component
// is built by C# Dev Kit (vs-green), published as a NuGet package, and restored into this
// extension at build time (see allNugetPackages in offlinePackagingTasks.ts), using the same
// mechanism as the Xaml tools and roslynDevKit components above. It is optional: builds
// that don't restore the package won't have the folder, in which case getComponentPaths returns
// an empty array and we skip it. The consumer of the discovery service is the C# Dev Kit server.
getComponentPaths('testDiscovery', languageServerOptions, channel).forEach((path) =>
additionalExtensionPaths.push(path)
);

return args;
}

Expand Down
7 changes: 7 additions & 0 deletions tasks/packaging/offlinePackagingTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
rootPath,
devKitDependenciesDirectory,
xamlToolsDirectory,
testDiscoveryDirectory,
} from '../projectPaths';
import { getPackageJSON } from '../packageJson';
import { createPackageAsync, generateVsixManifest } from './vsceTasks';
Expand Down Expand Up @@ -91,6 +92,12 @@ export const allNugetPackages: { [key: string]: NugetPackageInfo } = {
getPackageContentPath: (_platformInfo) => 'content',
vsixOutputPath: xamlToolsDirectory,
},
testDiscovery: {
getPackageName: (_platformInfo) => 'Microsoft.VisualStudio.CSharpDevKit.SourceTestDiscovery',
packageJsonName: 'testDiscovery',
getPackageContentPath: (_platformInfo) => 'content',
vsixOutputPath: testDiscoveryDirectory,
},
};

interface PlatformEntry {
Expand Down
1 change: 1 addition & 0 deletions tasks/projectPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const nugetTempPath = path.join(rootPath, 'out', '.nuget');
export const languageServerDirectory = path.join(rootPath, '.roslyn');
export const devKitDependenciesDirectory = path.join(rootPath, componentInfo.roslynDevKit.defaultFolderName);
export const xamlToolsDirectory = path.join(rootPath, componentInfo.xamlTools.defaultFolderName);
export const testDiscoveryDirectory = path.join(rootPath, componentInfo.testDiscovery.defaultFolderName);

export const codeExtensionPath = commandLineOptions.codeExtensionPath || rootPath;

Expand Down
Loading