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

Opening a folder in VS Code with multiple projects doesn't work #98

Open
neotrow opened this issue Oct 29, 2024 · 0 comments
Open

Opening a folder in VS Code with multiple projects doesn't work #98

neotrow opened this issue Oct 29, 2024 · 0 comments

Comments

@neotrow
Copy link

neotrow commented Oct 29, 2024

I created a git repo to better demonstrate the problem:
https://github.com/neotrow/dprint-issue

When opening a folder like this in VS code where there are multiple projects which each has their own version of dprint installed, the extension fails to find dprint:

[ERROR] Problem launching dprint. '"dprint"' is not recognized as an internal or external command,
operable program or batch file.

[ERROR] Error initializing dprint. Ensure it is globally installed on the path (see https://dprint.dev/install) or specify a "dprint.path" setting to the executable.
[ERROR] Problem launching dprint. '"dprint"' is not recognized as an internal or external command,
operable program or batch file.

[ERROR] Error initializing dprint. Ensure it is globally installed on the path (see https://dprint.dev/install) or specify a "dprint.path" setting to the executable.
[ERROR] Problem launching dprint. '"dprint"' is not recognized as an internal or external command,
operable program or batch file.

[ERROR] Error initializing dprint. Ensure it is globally installed on the path (see https://dprint.dev/install) or specify a "dprint.path" setting to the executable.
[INFO] Configuration file not found.
[INFO] Extension active!

When opening either project-a or project-b folder in VS code, everything works as expected.

A work around is to also install dprint with npm in the root folder but this isn't optimal.

Solution:
The extension should be able to find the dprint executable closest to the file being formatted. Especially when there is a .dprint.jsonc file in the project.

I'm happy to contribute, if i'm pointed in the right direction.

Thanks!

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