Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project-root discovery doesn't work with multiple projects #221

Open
markhepburn opened this issue May 25, 2024 · 1 comment
Open

Project-root discovery doesn't work with multiple projects #221

markhepburn opened this issue May 25, 2024 · 1 comment

Comments

@markhepburn
Copy link

markhepburn commented May 25, 2024

Describe the bug
There seems to be a bug in lsp-dart-get-project-root, where it picks up the wrong default-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

flutter create proj_one
flutter create proj_two

Open proj_one/test/test_widget.dart (selecting proj_one as the project root). Confirm that tests can run, eg M-x lsp-dart-run-all-tests.

Open proj_two/test/test_widget.dart (selecting proj_two as the project root). Run tests again.

Notice that the tests executed are actually in proj_one! (This is more obvious if you run lsp-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

[LSP Dart] 1.24.3 at 2024.05.25 @ Emacs 30.0.50
[Dart SDK] Dart SDK version: 3.3.4 (stable) (Tue Apr 16 19:56:12 2024 +0000) on "linux_x64"
@markhepburn
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant