about summary refs log tree commit diff
path: root/pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/default.nix')
-rw-r--r--pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/default.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/default.nix b/pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/default.nix
new file mode 100644
index 0000000000000..1f92e600f40fd
--- /dev/null
+++ b/pkgs/applications/editors/vscode/extensions/chenglou92.rescript-vscode/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, vscode-utils, callPackage }:
+let
+  version = "1.8.1";
+  rescript-editor-analysis = callPackage ./rescript-editor-analysis.nix { inherit version; };
+  arch =
+    if stdenv.isLinux then "linux"
+    else if stdenv.isDarwin then "darwin"
+    else throw "Unsupported platform";
+  analysisDir = "server/analysis_binaries/${arch}";
+in
+vscode-utils.buildVscodeMarketplaceExtension rec {
+  mktplcRef = {
+    name = "rescript-vscode";
+    publisher = "chenglou92";
+    inherit version;
+    sha256 = "sha256-XZG0PRzc3wyAVq9tQeGDlaUZg5YAgkPxJ3NsrdUHoOk=";
+  };
+  postPatch = ''
+    rm -r ${analysisDir}
+    ln -s ${rescript-editor-analysis}/bin ${analysisDir}
+  '';
+
+  meta = with lib; {
+    description = "The official VSCode plugin for ReScript";
+    homepage = "https://github.com/rescript-lang/rescript-vscode";
+    maintainers = with maintainers; [ dlip jayesh-bhoot ];
+    license = licenses.mit;
+  };
+}