nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 vscode-utils,
5 callPackage,
6}:
7let
8 extVersion = "1.62.0";
9 rescript-editor-analysis = callPackage ./rescript-editor-analysis.nix { };
10
11 # Ensure the versions match
12 version =
13 if rescript-editor-analysis.version == extVersion then
14 rescript-editor-analysis.version
15 else
16 throw "analysis and extension versions must match";
17
18 arch =
19 if stdenv.hostPlatform.isLinux then
20 "linux"
21 else if stdenv.hostPlatform.isDarwin then
22 "darwin"
23 else
24 throw "Unsupported system: ${stdenv.system}";
25 analysisDir = "server/analysis_binaries/${arch}";
26in
27
28vscode-utils.buildVscodeMarketplaceExtension {
29 mktplcRef = {
30 name = "rescript-vscode";
31 publisher = "chenglou92";
32 inherit version;
33 hash = "sha256-yUAhysTM9FXo9ZAzrto+tnjnofIUEQAGBg3tjIainrY=";
34 };
35
36 # For rescript-language-server
37 passthru.rescript-editor-analysis = rescript-editor-analysis;
38
39 strictDeps = true;
40 postPatch = ''
41 rm -r ${analysisDir}
42 ln -s ${rescript-editor-analysis}/bin ${analysisDir}
43 '';
44
45 meta = {
46 description = "Official VSCode plugin for ReScript";
47 homepage = "https://github.com/rescript-lang/rescript-vscode";
48 maintainers = [
49 lib.maintainers.dlip
50 lib.maintainers.jayesh-bhoot
51 ];
52 platforms = lib.platforms.linux ++ lib.platforms.darwin;
53 license = lib.licenses.mit;
54 };
55}