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. This changes our download tasks
to adjust for this and updates to a new Roslyn version that has separate
packages.
  • Loading branch information
jasonmalinowski committed Sep 1, 2023
1 parent 77c8b39 commit 02b3b37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
},
"defaults": {
"roslyn": "4.8.0-2.23428.2",
"roslyn": "4.8.0-3.23451.2",
"omniSharp": "1.39.7",
"razor": "7.0.0-preview.23423.3",
"razorOmnisharp": "7.0.0-preview.23363.1"
Expand Down
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 02b3b37

Please sign in to comment.