File tree Expand file tree Collapse file tree 6 files changed +131
-98
lines changed
tests/test-sources/plugins/by-name Expand file tree Collapse file tree 6 files changed +131
-98
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ lib ,
3
+ ...
4
+ } :
5
+ let
6
+ inherit ( lib ) types ;
7
+ inherit ( lib . nixvim ) defaultNullOpts ;
8
+
9
+ dapHelpers = import ../dap/dapHelpers.nix { inherit lib ; } ;
10
+ in
11
+ lib . nixvim . plugins . mkNeovimPlugin {
12
+ name = "dap-go" ;
13
+ package = "nvim-dap-go" ;
14
+
15
+ maintainers = [ lib . maintainers . khaneliman ] ;
16
+
17
+ settingsOptions = {
18
+ dap_configurations = lib . nixvim . mkNullOrOption ( types . listOf dapHelpers . configurationOption ) ''
19
+ Additional dap configurations.
20
+ See `:h dap-configuration` for more detail.
21
+ '' ;
22
+
23
+ delve = {
24
+ path = defaultNullOpts . mkStr "dlv" "The path to the executable dlv which will be used for debugging." ;
25
+
26
+ initialize_timeout_sec = defaultNullOpts . mkUnsignedInt 20 "Time to wait for delve to initialize the debug session." ;
27
+
28
+ port = defaultNullOpts . mkStr "$${port}" ''
29
+ A string that defines the port to start delve debugger.
30
+
31
+ Defaults to string "$${port}" which instructs dap
32
+ to start the process in a random available port.
33
+ '' ;
34
+
35
+ args = lib . nixvim . mkNullOrOption ( types . listOf types . str ) "Additional args to pass to dlv." ;
36
+
37
+ build_flags = defaultNullOpts . mkStr "" "Build flags to pass to dlv." ;
38
+ } ;
39
+ } ;
40
+
41
+ # Manually supplied to nvim-dap config module
42
+ callSetup = false ;
43
+ extraConfig = cfg : {
44
+ plugins . dap = {
45
+ enable = true ;
46
+ extensionConfigLua = ''
47
+ require("dap-go").setup(${ lib . nixvim . toLuaObject cfg . settings } )
48
+ '' ;
49
+ } ;
50
+ } ;
51
+ # NOTE: Renames added in https://github.com/nix-community/nixvim/pull/2897 (2025-01-26)
52
+ imports = [ ./deprecations.nix ] ;
53
+ }
Original file line number Diff line number Diff line change
1
+ { lib , ... } :
2
+ let
3
+ oldPluginBasePath = [
4
+ "plugins"
5
+ "dap"
6
+ "extensions"
7
+ "dap-go"
8
+ ] ;
9
+ newPluginBasePath = [
10
+ "plugins"
11
+ "dap-go"
12
+ ] ;
13
+
14
+ settingsPath = newPluginBasePath ++ [ "settings" ] ;
15
+
16
+ renamedOptions = [
17
+ "dapConfigurations"
18
+ [
19
+ "delve"
20
+ "path"
21
+ ]
22
+ [
23
+ "delve"
24
+ "initializeTimeoutSec"
25
+ ]
26
+ [
27
+ "delve"
28
+ "port"
29
+ ]
30
+ [
31
+ "delve"
32
+ "args"
33
+ ]
34
+ [
35
+ "delve"
36
+ "buildFlags"
37
+ ]
38
+ ] ;
39
+
40
+ renameWarnings =
41
+ lib . nixvim . mkSettingsRenamedOptionModules oldPluginBasePath settingsPath
42
+ renamedOptions ;
43
+ in
44
+ {
45
+ imports = renameWarnings ++ [
46
+ ( lib . mkRenamedOptionModule ( oldPluginBasePath ++ [ "enable" ] ) ( newPluginBasePath ++ [ "enable" ] ) )
47
+ ] ;
48
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 13
13
in
14
14
lib . nixvim . plugins . mkNeovimPlugin {
15
15
imports = [
16
- ./dap-go.nix
17
16
./dap-python.nix
18
17
./dap-ui.nix
19
18
./dap-virtual-text.nix
Original file line number Diff line number Diff line change
1
+ {
2
+ empty = {
3
+ plugins . dap-go . enable = true ;
4
+ } ;
5
+
6
+ default = {
7
+ plugins . dap-go = {
8
+ enable = true ;
9
+
10
+ settings = {
11
+ dap_configurations = [
12
+ {
13
+ # Must be "go" or it will be ignored by the plugin
14
+ type = "go" ;
15
+ name = "Attach remote" ;
16
+ mode = "remote" ;
17
+ request = "attach" ;
18
+ }
19
+ ] ;
20
+ delve = {
21
+ path = "dlv" ;
22
+ initialize_timeout_sec = 20 ;
23
+ port = "$\{ port}" ;
24
+ args = [ ] ;
25
+ build_flags = "-tags=unit" ;
26
+ } ;
27
+ } ;
28
+ } ;
29
+ } ;
30
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments