vscode-extensions: make pname optional

Many code in the wild still use `vscode-utils.buildVscodeExtension`
with the `name` argument, so it would be better to make it optional.

For example, a github code search of `buildVscodeExtension` returns 100+
results, most of them uses the `name` argument:

  https://github.com/search?q=buildVscodeExtension+language%3ANix&type=code&l=Nix
This commit is contained in:
Bryan Lai
2024-12-02 18:45:25 +08:00
parent f40efe1ce9
commit 09801c985b
@@ -11,7 +11,7 @@
let
buildVscodeExtension =
a@{
pname,
pname ? null, # Only optional for backward compatibility.
src,
# Same as "Unique Identifier" on the extension's web page.
# For the moment, only serve as unique extension dir.
@@ -37,9 +37,10 @@ let
"vscodeExtUniqueId"
"pname"
])
// {
// (lib.optionalAttrs (pname != null) {
pname = "vscode-extension-${pname}";
})
// {
passthru = passthru // {
inherit vscodeExtPublisher vscodeExtName vscodeExtUniqueId;