mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
zed-editor: options to generate debug.json
Add `mutableUserDebug` and `userDebug` options to generate `debug.json` file. The options are heavily inspired by `mutableUserTasks` and `userTasks` options implementation. Closes #8091
This commit is contained in:
parent
95d65dddae
commit
1f34c2c855
5 changed files with 285 additions and 0 deletions
58
tests/modules/programs/zed-editor/debug-immutable.nix
Normal file
58
tests/modules/programs/zed-editor/debug-immutable.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# Test custom keymap functionality
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
programs.zed-editor = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
mutableUserDebug = false;
|
||||
userDebug = [
|
||||
{
|
||||
label = "PHP: Listen to Xdebug";
|
||||
adapter = "Xdebug";
|
||||
request = "launch";
|
||||
port = 9003;
|
||||
}
|
||||
{
|
||||
label = "PHP: Debug this test";
|
||||
adapter = "Xdebug";
|
||||
request = "launch";
|
||||
program = "vendor/bin/phpunit";
|
||||
args = [
|
||||
"--filter"
|
||||
"$ZED_SYMBOL"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
expectedContent = builtins.toFile "expected.json" ''
|
||||
[
|
||||
{
|
||||
"adapter": "Xdebug",
|
||||
"label": "PHP: Listen to Xdebug",
|
||||
"port": 9003,
|
||||
"request": "launch"
|
||||
},
|
||||
{
|
||||
"adapter": "Xdebug",
|
||||
"args": [
|
||||
"--filter",
|
||||
"$ZED_SYMBOL"
|
||||
],
|
||||
"label": "PHP: Debug this test",
|
||||
"program": "vendor/bin/phpunit",
|
||||
"request": "launch"
|
||||
}
|
||||
]
|
||||
'';
|
||||
|
||||
settingsPath = ".config/zed/debug.json";
|
||||
in
|
||||
''
|
||||
assertFileExists "home-files/${settingsPath}"
|
||||
assertFileContent "home-files/${settingsPath}" "${expectedContent}"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue