14 with dotnetCorePackages;
26 # need sdk on runtime as well
27 dotnet-runtime = dotnetCorePackages.sdk_9_0;
28 rid = dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system;
30 project = "Microsoft.CodeAnalysis.LanguageServer";
32 buildDotnetModule rec {
33 inherit pname dotnet-sdk dotnet-runtime;
35 vsVersion = "2.62.18";
36 src = fetchFromGitHub {
39 rev = "VSCode-CSharp-${vsVersion}";
40 hash = "sha256-oy1xYM6Kd/8uAQQdvsxLNkycs9OOs7SEe+dzYc4RMeM=";
43 # versioned independently from vscode-csharp
45 # https://github.com/dotnet/vscode-csharp/blob/main/package.json
46 version = "4.14.0-1.25060.2";
47 projectFile = "src/LanguageServer/${project}/${project}.csproj";
48 useDotnetFromEnv = true;
49 nugetDeps = ./deps.json;
51 nativeBuildInputs = [ jq ];
54 # until upstream updates net6.0 here:
55 # https://github.com/dotnet/roslyn/blob/6cc106c0eaa9b0ae070dba3138a23aeab9b50c13/eng/targets/TargetFrameworks.props#L20
57 # until made configurable/and or different location
58 # https://github.com/dotnet/roslyn/issues/76892
59 ./cachedirectory.patch
63 # Upstream uses rollForward = latestPatch, which pins to an *exact* .NET SDK version.
64 jq '.sdk.rollForward = "latestMinor"' < global.json > global.json.tmp
65 mv global.json.tmp global.json
70 # this removes the Microsoft.WindowsDesktop.App.Ref dependency
71 "-p:EnableWindowsTargeting=false"
74 # two problems solved here:
75 # 1. --no-build removed -> BuildHost project within roslyn is running Build target during publish
76 # 2. missing crossgen2 7.* in local nuget directory when PublishReadyToRun=true
77 # the latter should be fixable here but unsure how
81 env dotnet publish $dotnetProjectFiles \
82 -p:ContinuousIntegrationBuild=true \
83 -p:Deterministic=true \
84 -p:InformationalVersion=$version \
86 -p:PublishTrimmed=false \
87 -p:PublishReadyToRun=false \
88 --configuration Release \
90 --output "$out/lib/$pname" \
93 ''${dotnetInstallFlags[@]} \
100 tests.version = testers.testVersion { package = roslyn-ls; };
101 updateScript = ./update.sh;
105 homepage = "https://github.com/dotnet/vscode-csharp";
106 description = "Language server behind C# Dev Kit for Visual Studio Code";
107 changelog = "https://github.com/dotnet/vscode-csharp/releases/tag/v${vsVersion}";
108 license = lib.licenses.mit;
109 maintainers = with lib.maintainers; [ konradmalik ];
110 mainProgram = "Microsoft.CodeAnalysis.LanguageServer";