Open lizelive opened 11 months ago
Please, check https://github.com/nix-community/nix-vscode-extensions/issues/41. I believe addressing the compatibility problem for all extensions is doomed. nix4vscode should solve this, but maintainers didn't have enough time to finish it and deprecate this repo (https://github.com/nix-community/nix-vscode-extensions/issues/47).
I saw #41 and am not a huge fan of having to generate lock file for extensions.
i use this script to figure out what version to pin to
with builtins; let
pkgs = import <nixpkgs> { };
inherit (pkgs) lib;
currentVersion = "1.84.2";
checkVersion = v: all (f: f v) [
(lib.versionAtLeast currentVersion)
(lib.versionOlder (lib.versions.major currentVersion))
];
file = ./data/cache/vscode-marketplace-latest.json;
json = lib.importJSON file;
packages = filter (p: lib.strings.hasPrefix "github" p.publisher) json;
getStripVersion = x: lib.strings.removePrefix "^" x.engineVersion;
byVersion = groupBy getStripVersion packages;
byMajor = groupBy lib.versions.major (attrNames byVersion);
compatableVersions = filter checkVersion (attrNames byVersion);
versionsThisMajor = byMajor.${(lib.versions.major currentVersion)};
tooOldFor = lib.subtractLists compatableVersions versionsThisMajor;
howBad = lib.flatten (lib.attrVals tooOldFor byVersion);
in
trace howBad (length howBad)
is it possible include latest extensions supported by code in nixpkgs-unstable by running through the git history of the cache?
it's not hard to program. i'm just wondering if the scrapper will stay up.
@lizelive, you may try, but AFAIR there were changes to the JSON file format, so the scrapper may not work sometimes.
gets the highest engineVersion