summary refs log tree commit diff
path: root/pkgs/misc/vscode-extensions
diff options
context:
space:
mode:
authoroxalica <oxalicc@pm.me>2020-04-08 14:22:56 +0800
committeroxalica <oxalicc@pm.me>2020-04-08 14:22:56 +0800
commite33256ef246e05afea81bc77bc0a9d31f56a9f60 (patch)
tree805b1e44cf0188054f87bf07508493158c4436e9 /pkgs/misc/vscode-extensions
parentbde9289415bae0e62e67072e22f5666da4c3a9f5 (diff)
parent39247f8d04c04b3ee629a1f85aeedd582bf41cac (diff)
downloadnixpkgs-e33256ef246e05afea81bc77bc0a9d31f56a9f60.tar
nixpkgs-e33256ef246e05afea81bc77bc0a9d31f56a9f60.tar.gz
nixpkgs-e33256ef246e05afea81bc77bc0a9d31f56a9f60.tar.bz2
nixpkgs-e33256ef246e05afea81bc77bc0a9d31f56a9f60.tar.lz
nixpkgs-e33256ef246e05afea81bc77bc0a9d31f56a9f60.tar.xz
nixpkgs-e33256ef246e05afea81bc77bc0a9d31f56a9f60.tar.zst
nixpkgs-e33256ef246e05afea81bc77bc0a9d31f56a9f60.zip
Merge remote-tracking branch 'channels/nixos-unstable' into rust-analyzer
Diffstat (limited to 'pkgs/misc/vscode-extensions')
-rw-r--r--pkgs/misc/vscode-extensions/python/default.nix33
-rw-r--r--pkgs/misc/vscode-extensions/remote-ssh/default.nix6
-rw-r--r--pkgs/misc/vscode-extensions/vscode-utils.nix17
3 files changed, 31 insertions, 25 deletions
diff --git a/pkgs/misc/vscode-extensions/python/default.nix b/pkgs/misc/vscode-extensions/python/default.nix
index dec6bbbba10..604d0fa3ad9 100644
--- a/pkgs/misc/vscode-extensions/python/default.nix
+++ b/pkgs/misc/vscode-extensions/python/default.nix
@@ -1,18 +1,18 @@
 { lib, stdenv, fetchurl, vscode-utils, extractNuGet
 , icu, curl, openssl, lttng-ust, autoPatchelfHook
-, pythonUseFixed ? false, python  # When `true`, the python default setting will be fixed to specified.
-                                  # Use version from `PATH` for default setting otherwise.
-                                  # Defaults to `false` as we expect it to be project specific most of the time.
-, ctagsUseFixed ? true, ctags     # When `true`, the ctags default setting will be fixed to specified.
-                                  # Use version from `PATH` for default setting otherwise.
-                                  # Defaults to `true` as usually not defined on a per projet basis.
+, python3
+, pythonUseFixed ? false       # When `true`, the python default setting will be fixed to specified.
+                               # Use version from `PATH` for default setting otherwise.
+                               # Defaults to `false` as we expect it to be project specific most of the time.
+, ctagsUseFixed ? true, ctags  # When `true`, the ctags default setting will be fixed to specified.
+                               # Use version from `PATH` for default setting otherwise.
+                               # Defaults to `true` as usually not defined on a per projet basis.
 }:
 
-assert pythonUseFixed -> null != python;
 assert ctagsUseFixed -> null != ctags;
 
 let
-  pythonDefaultsTo = if pythonUseFixed then "${python}/bin/python" else "python";
+  pythonDefaultsTo = if pythonUseFixed then "${python3}/bin/python" else "python";
   ctagsDefaultsTo = if ctagsUseFixed then "${ctags}/bin/ctags" else "ctags";
 
   # The arch tag comes from 'PlatformName' defined here:
@@ -23,14 +23,14 @@ let
     else throw "Only x86_64 Linux and Darwin are supported.";
 
   languageServerSha256 = {
-    linux-x64 = "10qwi8lih5i6216d1vqsmviab73ha0d3zdvircrgrydkf0d4ancd";
-    osx-x64 = "08gjxs0bjhz5a9l35vvgwnvzshsyyqiqvb5hxv6w0k2ajgv5z7av";
+    linux-x64 = "1pmj5pb4xylx4gdx4zgmisn0si59qx51n2m1bh7clv29q6biw05n";
+    osx-x64 = "0ishiy1z9dghj4ryh95vy8rw0v7q4birdga2zdb4a8am31wmp94b";
   }.${arch};
 
   # version is languageServerVersion in the package.json
   languageServer = extractNuGet rec {
     name = "Python-Language-Server";
-    version = "0.4.127";
+    version = "0.5.30";
 
     src = fetchurl {
       url = "https://pvsc.azureedge.net/python-language-server-stable/${name}-${arch}.${version}.nupkg";
@@ -41,8 +41,8 @@ in vscode-utils.buildVscodeMarketplaceExtension {
   mktplcRef = {
     name = "python";
     publisher = "ms-python";
-    version = "2020.2.64397";
-    sha256 = "1kwyc5ycz1276i2zbw93mpq59y2py6kj71gvhzya8xvm184jk07a";
+    version = "2020.3.69010";
+    sha256 = "1dg8wfc3yl0msg6c9ccbvwc78f559109slsagi0lgnbc40v6v24b";
   };
 
   buildInputs = [
@@ -54,6 +54,11 @@ in vscode-utils.buildVscodeMarketplaceExtension {
 
   nativeBuildInputs = [
     autoPatchelfHook
+    python3.pkgs.wrapPython
+  ];
+
+  pythonPath = with python3.pkgs; [
+    setuptools
   ];
 
   postPatch = ''
@@ -70,6 +75,8 @@ in vscode-utils.buildVscodeMarketplaceExtension {
     mkdir -p "$out/$installPrefix/languageServer.${languageServer.version}"
     cp -R --no-preserve=ownership ${languageServer}/* "$out/$installPrefix/languageServer.${languageServer.version}"
     chmod -R +wx "$out/$installPrefix/languageServer.${languageServer.version}"
+
+    patchPythonScript "$out/$installPrefix/pythonFiles/lib/python/isort/main.py"
   '';
 
   meta = with lib; {
diff --git a/pkgs/misc/vscode-extensions/remote-ssh/default.nix b/pkgs/misc/vscode-extensions/remote-ssh/default.nix
index fe053dd7ea3..e58ea98a606 100644
--- a/pkgs/misc/vscode-extensions/remote-ssh/default.nix
+++ b/pkgs/misc/vscode-extensions/remote-ssh/default.nix
@@ -7,7 +7,7 @@
 
 let
   inherit (vscode-utils) buildVscodeMarketplaceExtension;
-  
+
   # patch runs on remote machine hence use of which
   # links to local node if version is 12
   patch = ''
@@ -36,8 +36,8 @@ in
     mktplcRef = {
       name = "remote-ssh";
       publisher = "ms-vscode-remote";
-      version = "0.48.0";
-      sha256 = "04q53gljqh5snkrdf5l69g0ahn1s5z35a4ipfcbf1rsjjmm85a19";
+      version = "0.50.0";
+      sha256 = "01pyd6759p5nkjhjy3iplrl748xblr54l1jphk2g02s1n5ds2qb9";
     };
 
     postPatch = ''
diff --git a/pkgs/misc/vscode-extensions/vscode-utils.nix b/pkgs/misc/vscode-extensions/vscode-utils.nix
index 2216e425897..5d446b025d7 100644
--- a/pkgs/misc/vscode-extensions/vscode-utils.nix
+++ b/pkgs/misc/vscode-extensions/vscode-utils.nix
@@ -1,9 +1,6 @@
-{ stdenv, lib, fetchurl, vscode, unzip }:
+{ stdenv, lib, fetchurl, unzip }:
 
 let
-  extendedPkgVersion = lib.getVersion vscode;
-  extendedPkgName = lib.removeSuffix "-${extendedPkgVersion}" vscode.name;
-
   mktplcExtRefToFetchArgs = ext: {
     url = "https://${ext.publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${ext.publisher}/extension/${ext.name}/${ext.version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage";
     sha256 = ext.sha256;
@@ -14,7 +11,6 @@ let
 
   buildVscodeExtension = a@{
     name,
-    namePrefix ? "${extendedPkgName}-extension-",
     src,
     # Same as "Unique Identifier" on the extension's web page.
     # For the moment, only serve as unique extension dir.
@@ -28,12 +24,12 @@ let
   }:
   stdenv.mkDerivation ((removeAttrs a [ "vscodeExtUniqueId" ]) //  {
 
-    name = namePrefix + name;
+    name = "vscode-extension-${name}";
 
     inherit vscodeExtUniqueId;
     inherit configurePhase buildPhase dontPatchELF dontStrip;
 
-    installPrefix = "share/${extendedPkgName}/extensions/${vscodeExtUniqueId}";
+    installPrefix = "${vscodeExtUniqueId}";
 
     buildInputs = [ unzip ] ++ buildInputs;
 
@@ -55,12 +51,15 @@ let
   buildVscodeMarketplaceExtension = a@{
     name ? "",
     src ? null,
+    vsix ? null,
     mktplcRef,
     ...
   }: assert "" == name; assert null == src;
-  buildVscodeExtension ((removeAttrs a [ "mktplcRef" ]) // {
+  buildVscodeExtension ((removeAttrs a [ "mktplcRef" "vsix" ]) // {
     name = "${mktplcRef.publisher}-${mktplcRef.name}-${mktplcRef.version}";
-    src = fetchVsixFromVscodeMarketplace mktplcRef;
+    src = if (vsix != null)
+      then vsix
+      else fetchVsixFromVscodeMarketplace mktplcRef;
     vscodeExtUniqueId = "${mktplcRef.publisher}.${mktplcRef.name}";
   });