@@ -207,15 +207,18 @@ the function needs to examine, starting with FILE."
207
207
(setcdr config-cell (plist-put config-plist :processId pid))
208
208
(dap-debug (cdr config-cell))))
209
209
210
- (defun dap-netcore-test-run (attach-buffer &optional args-string )
210
+ (defun dap-netcore-test-run (attach-buffer &optional args-string directory )
211
211
" Run .NET tests process to obtain PID to attach for debugging."
212
212
(with-environment-variables ((" VSTEST_HOST_DEBUG" " 1" ))
213
- (start-process " dap-netcore-attach-process"
214
- attach-buffer
215
- " dotnet"
216
- " test"
217
- " --verbosity=Quiet"
218
- (concat " " args-string))))
213
+ (let ((args-list (append (list " dotnet"
214
+ " test"
215
+ " --configuration=Debug"
216
+ " --verbosity=Quiet"
217
+ " --nologo" )
218
+ (split-string-shell-command args-string))))
219
+ (when directory
220
+ (push directory args-list))
221
+ (apply #'start-process " dap-netcore-attach-process" attach-buffer args-list))))
219
222
220
223
(defun dap-netcore-debug-tests-filter-pid (process output )
221
224
" Custom filter to extract PID from the process output in real-time."
@@ -241,14 +244,14 @@ the function needs to examine, starting with FILE."
241
244
; ; Remove the filter to avoid further checks
242
245
(set-process-filter process nil ))))))))
243
246
244
- (defun dap-netcore-debug-test-init (&optional args-string )
247
+ (defun dap-netcore-debug-test-init (&optional args-string directory )
245
248
" Prepare .NET process to attach its PID for debugging."
246
249
(let ((attach-buffer " *dap-netcore-attach*" ))
247
250
; ; Kill existing buffer if it exists
248
251
(when (get-buffer attach-buffer)
249
252
(kill-buffer attach-buffer))
250
253
; ; Run dotnet process
251
- (let ((dotnet-process (dap-netcore-test-run attach-buffer args-string)))
254
+ (let ((dotnet-process (dap-netcore-test-run attach-buffer args-string directory )))
252
255
(when dotnet-process
253
256
(set-process-filter dotnet-process #'dap-netcore-debug-tests-filter-pid )
254
257
; ; Set process finalization event
@@ -265,10 +268,9 @@ the function needs to examine, starting with FILE."
265
268
(let ((params '())
266
269
(filter (read-string " Filter: " )))
267
270
(unless (string-empty-p filter)
268
- (push (concat params " --filter=" filter) params))
269
- (when directory
270
- (push directory params))
271
- (dap-netcore-debug-test-init (string-join (reverse params) " " ))))
271
+ (push (concat " --filter=" filter) params))
272
+ (dap-netcore-debug-test-init (string-join params " " ) directory)))
273
+
272
274
273
275
(provide 'dap-netcore )
274
276
; ;; dap-netcore.el ends here
0 commit comments