@@ -46,10 +46,15 @@ local function enrich_dap_config(config_, on_config)
46
46
assert (not err , err and (err .message or vim .inspect (err )))
47
47
48
48
if not config .projectName then
49
- for _ , entry in ipairs (mainclasses ) do
50
- if entry .mainClass == config .mainClass then
51
- config .projectName = entry .projectName
52
- break
49
+ if not mainclasses then
50
+ local msg = " Could not resolve classpaths. Project may have compile errors or unresolved dependencies"
51
+ vim .notify (msg , vim .log .levels .WARN )
52
+ else
53
+ for _ , entry in ipairs (mainclasses ) do
54
+ if entry .mainClass == config .mainClass then
55
+ config .projectName = entry .projectName
56
+ break
57
+ end
53
58
end
54
59
end
55
60
end
@@ -62,13 +67,17 @@ local function enrich_dap_config(config_, on_config)
62
67
}
63
68
util .execute_command (params , function (err1 , paths )
64
69
assert (not err1 , err1 and (err1 .message or vim .inspect (err1 )))
65
- config .modulePaths = config .modulePaths or paths [1 ]
66
- config .classPaths = config .classPaths or vim .tbl_filter (
67
- function (x )
68
- return vim .fn .isdirectory (x ) == 1 or vim .fn .filereadable (x ) == 1
69
- end ,
70
- paths [2 ]
71
- )
70
+ if paths then
71
+ config .modulePaths = config .modulePaths or paths [1 ]
72
+ config .classPaths = config .classPaths or vim .tbl_filter (
73
+ function (x )
74
+ return vim .fn .isdirectory (x ) == 1 or vim .fn .filereadable (x ) == 1
75
+ end ,
76
+ paths [2 ]
77
+ )
78
+ else
79
+ vim .notify (" Could not resolve classpaths. Project may have compile errors or unresolved dependencies" , vim .log .levels .WARN )
80
+ end
72
81
on_config (config )
73
82
end , bufnr )
74
83
end , bufnr )
0 commit comments