Open markhepburn opened 4 months ago
I first picked this up running file-tests from a project with multiple sub-packages (eg, a flutter app, with a few library projects in the packages/
directory. You wind up with some fairly convoluted paths such as projectroot/packages/lastlib/packages/currentlib/test/some_test.dart
)
I'm not entirely sure if that's not a separate issue, but the two-project scenario seemed to the simplest reproduction case for now.
Describe the bug There seems to be a bug in
lsp-dart-get-project-root
, where it picks up the wrongdefault-directory
from an existing test-process buffer (I'm speculating a little here)Note Before logging the bug please make sure that the issue is reproducible with latest melpa packages.
To Reproduce Create two flutter projects, eg
Open
proj_one/test/test_widget.dart
(selectingproj_one
as the project root). Confirm that tests can run, egM-x lsp-dart-run-all-tests
.Open
proj_two/test/test_widget.dart
(selectingproj_two
as the project root). Run tests again.Notice that the tests executed are actually in
proj_one
! (This is more obvious if you runlsp-dart-run-test-file
)If you first kill the
*LSP Dart - tests process*
buffer, the expected tests are run.Expected behavior The tests in
proj_two/test/test_widget.dart
are run.Screenshots If applicable, add screenshots to help explain your problem.
Version Include here the result of: M-x
lsp-dart-version