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

Psalm not able to use psalm.phpExecutablePath setting in VS Code, uses default php instead #231

Open
matlinski opened this issue Mar 6, 2023 · 4 comments
Assignees

Comments

@matlinski
Copy link

Hello, I never write git issues so forgive me if it's not well structured.

I have a WSL set up in my windows and there are multiple project inside. Most need PHP 7.4 and that's how default php is configured. There is one project where I need to run php8.1. In that project there is no way to set the alternative binary path for psalm. I tried introducing the following changes to workspace.code-workspace:

{
   "settings": {
		"php.validate.executablePath": "/usr/bin/php8.1",
		"psalm.phpExecutablePath": "/usr/bin/php8.1"
   }
}

the first path solved the issue for default VS code validation, the second path was added automatically by from VS code Psalm extension GUI (see the screenshot).
photo_2023-03-06_14-34-28

This should defitelly solve the problem but it didn't. Both VS code extension and composer extension are up to date.

@tm1000
Copy link
Collaborator

tm1000 commented Mar 7, 2023

This is working fine for me.

Note that I went and set: "psalm.phpExecutablePath": "/usr/bin/ppp" which is invalid and I got an error message that its not executable. I then set it to /dev/null which worked as well

@tm1000 tm1000 self-assigned this Mar 7, 2023
@limarkxx
Copy link
Contributor

I believe the desired effect is in a multi-root workspace, config settings which are relevant to Psalm should have a scope of resource or machine-overridable instead of window.

In other words, every member of workspace.workspaceFolders should spawn an individual LanguageServer.ts, run an individual vendor/bin/psalm process.

I have a sample implementation of how this might work in https://github.com/limarkxx/psalm-vscode-plugin/compare/integration-testing...limarkxx:psalm-vscode-plugin:folder-level-settings?diff=split

@tm1000
Copy link
Collaborator

tm1000 commented Jul 24, 2023

@limarkxx Would you be willing to push that as a PR

@limarkxx
Copy link
Contributor

@tm1000 I've set #268 as a draft PR

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

No branches or pull requests

3 participants