psalm / psalm-vscode-plugin

VS Code plugin for Psalm
MIT License
44 stars 14 forks source link

Psalm is not usable in windows #254

Closed Daijobou closed 1 year ago

Daijobou commented 1 year ago

Hey, I'm a little lost to get psalm running on windows 11 in vscode. Can anyone help me or make the description of the extension a little clearer?

I installed this vscode extension and after in command-line:

composer global require --dev vimeo/psalm
psalm --version
-> Psalm 5.12.0@f90118cdeacd0088e7215e64c0c99ceca819e176

I can't call psalm --init src

because I get a fatal error PHP Fatal error: Allowed memory size of 8589934592 bytes exhausted (tried to allocate 528384 bytes) in \AppData\Roaming\Composer\vendor\nikic\php-parser\lib\PhpParser\Lexer.php on line 88

So I created a psalm.xml in project folder:

<?xml version="1.0" encoding="UTF-8"?>
<psalm>
    <projectFiles>
        <directory name="src" />
        <file name="httpdocs\\index.php" />
        <ignoreFiles>
            <directory name="src\\vendors" />
        </ignoreFiles>
    </projectFiles>
</psalm>

I hope that right. But after restart vscode I get this "Psalm is not installed"

image

I click on settings and added for Psalm: PHP Executable Path = C:\php (Folder to my php.exe) Psalm: Psalm Script Path = C:\Users\ABC\AppData\Roaming\Composer\vendor\bin

But again... "Psalm is not installed" What am I doing wrong?

In command-line its working:

psalm
Target PHP version: 8.1 (inferred from current PHP version).
Scanning files...
tm1000 commented 1 year ago

Psalm Script Path needs to be the full path. Not a directory

Daijobou commented 1 year ago

Thanks, but this hint not help me C:\Users\ABC\AppData\Roaming\Composer\vendor\bin\psalm-language-server C:\Users\ABC\AppData\Roaming\Composer\vendor\bin\psalm-language-server.bat change \ to / does not help either and remove Paths the same problem. I shouldn't need the path information since I can start PHP and PSALM from anywhere in command-line.

tm1000 commented 1 year ago

Sorry I don't use windows so I can't be of any help here.

Daijobou commented 1 year ago

I close this. I seem to be the only one with the problem, so I'm sure the error is on my end. I have removed the extension in vscode.