samuelpordeus / vscode-elixir-test

Visual Studio Code extension to interact with elixir tests
MIT License
37 stars 36 forks source link

Fix jump to tests for multi-workspace projects #71

Closed bengro closed 3 years ago

bengro commented 3 years ago

Problem When jumping to a test in a multi-workspace project, the extension currently can't find the test/implementation file.

The pop-up to "Create test file" shows up mistakenly. I have filed an issue for this here.

Reason: This is because asRelativePath includes the relative path from project root for multi-workspace settings.

See: https://code.visualstudio.com/api/references/vscode-api

asRelativePath(pathOrUri: string | Uri, includeWorkspaceFolder?: boolean): string

When true and when the given path is contained inside a workspace folder the name of the workspace is prepended. Defaults to true when there are multiple workspace folders and false otherwise.

Fix: Setting includeWorkspaceFolder to false does not change anything for single-workspace projects (as it defaults to false anyway, see above), but it fixes the bug for multi-workspace projects.

bengro commented 3 years ago

🙄 Anyone?

samuelpordeus commented 3 years ago

Hey, @bengro! Thanks for the PR! I intend to test, merge and publish it next week 😬