2018-07-21 00:44:44 +00:00
|
|
|
{ lib, vscode-utils
|
2017-10-19 01:32:15 +00:00
|
|
|
|
2018-07-07 21:38:11 +00:00
|
|
|
, pythonUseFixed ? false, python # When `true`, the python default setting will be fixed to specified.
|
2017-10-19 01:32:15 +00:00
|
|
|
# Use version from `PATH` for default setting otherwise.
|
|
|
|
# Defaults to `false` as we expect it to be project specific most of the time.
|
2018-07-07 21:38:11 +00:00
|
|
|
, ctagsUseFixed ? true, ctags # When `true`, the ctags default setting will be fixed to specified.
|
2017-10-19 01:32:15 +00:00
|
|
|
# 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";
|
|
|
|
ctagsDefaultsTo = if ctagsUseFixed then "${ctags}/bin/ctags" else "ctags";
|
|
|
|
in
|
|
|
|
|
|
|
|
vscode-utils.buildVscodeMarketplaceExtension {
|
|
|
|
mktplcRef = {
|
|
|
|
name = "python";
|
|
|
|
publisher = "ms-python";
|
2018-10-01 05:50:07 +00:00
|
|
|
version = "2018.8.0";
|
|
|
|
sha256 = "1x1wkqbc0d6h5w2m5qczv6gd5j6yrzhwp0c6wk49bhg2l0ibvyx6";
|
2017-10-19 01:32:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Patch `packages.json` so that nix's *python* is used as default value for `python.pythonPath`.
|
|
|
|
substituteInPlace "./package.json" \
|
|
|
|
--replace "\"default\": \"python\"" "\"default\": \"${pythonDefaultsTo}\""
|
|
|
|
|
|
|
|
# Patch `packages.json` so that nix's *ctags* is used as default value for `python.workspaceSymbols.ctagsPath`.
|
|
|
|
substituteInPlace "./package.json" \
|
|
|
|
--replace "\"default\": \"ctags\"" "\"default\": \"${ctagsDefaultsTo}\""
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
license = licenses.mit;
|
2018-04-19 15:41:12 +00:00
|
|
|
maintainers = [ maintainers.jraygauthier ];
|
2017-10-19 01:32:15 +00:00
|
|
|
};
|
2018-04-19 15:41:12 +00:00
|
|
|
}
|