Skip to content

Commit

Permalink
Consume per-runtime language servers
Browse files Browse the repository at this point in the history
To keep our package size more manageable, we now create a separate
language server package per runtime.
  • Loading branch information
jasonmalinowski committed Aug 31, 2023
1 parent 77c8b39 commit 6bc81ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/ServerDownload.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PropertyGroup>

<ItemGroup>
<PackageDownload Include="Microsoft.CodeAnalysis.LanguageServer" version="[$(MicrosoftCodeAnalysisLanguageServerVersion)]" />
<PackageDownload Include="$(PackageName)" version="[$(PackageVersion)]" />
</ItemGroup>

</Project>
9 changes: 7 additions & 2 deletions tasks/offlinePackagingTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ gulp.task('installDependencies', async () => {
// Install Tasks
async function installRoslyn(packageJSON: any, platformInfo?: PlatformInformation) {
const roslynVersion = packageJSON.defaults.roslyn;
const packagePath = await acquireNugetPackage('Microsoft.CodeAnalysis.LanguageServer', roslynVersion);

// Find the matching server RID for the current platform.
let serverPlatform: string;
Expand All @@ -90,6 +89,11 @@ async function installRoslyn(packageJSON: any, platformInfo?: PlatformInformatio
)!.rid;
}

const packagePath = await acquireNugetPackage(
`Microsoft.CodeAnalysis.LanguageServer.${serverPlatform}`,
roslynVersion
);

// Get the directory containing the server executable for the current platform.
const serverExecutableDirectory = path.join(packagePath, 'content', 'LanguageServer', serverPlatform);
if (!fs.existsSync(serverExecutableDirectory)) {
Expand Down Expand Up @@ -150,7 +154,8 @@ async function acquireNugetPackage(packageName: string, packageVersion: string):
const dotnetArgs = [
'restore',
path.join(rootPath, 'server'),
`/p:MicrosoftCodeAnalysisLanguageServerVersion=${packageVersion}`,
`/p:PackageName=${packageName}`,
`/p:PackageVersion=${packageVersion}`,
];
if (argv.interactive) {
dotnetArgs.push('--interactive');
Expand Down

0 comments on commit 6bc81ae

Please sign in to comment.