From 866fa5ef362c28dca31ad320294b122a861697f8 Mon Sep 17 00:00:00 2001 From: Scott Vanderbeek <52388100+ScottAwesome@users.noreply.github.com> Date: Mon, 20 Sep 2021 15:35:53 -0700 Subject: [PATCH 1/2] Update to Phpstorm support I've added clarifying information that Phpstorm supports psalm out of the box since 2020.3 release, and removed the LSP information. --- docs/running_psalm/language_server.md | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/docs/running_psalm/language_server.md b/docs/running_psalm/language_server.md index f4b09b052..c872e7012 100644 --- a/docs/running_psalm/language_server.md +++ b/docs/running_psalm/language_server.md @@ -29,21 +29,7 @@ This is the config I used: ## PhpStorm -I've got it working with `gtache/intellij-lsp` plugin ([Jetbrains-approved version](https://plugins.jetbrains.com/plugin/10209-lsp-support), [latest version](https://github.com/gtache/intellij-lsp/releases/tag/v1.6.0)). - -Setup is done via a GUI. - -When you install the plugin, you should see a "Language Server Protocol" section under the "Languages & Frameworks" tab. - -In the "Server definitions" tab you should add a definition for Psalm: - - - Select `Executable` - - Extension: `php` - - Path: `` e.g. `/usr/local/bin/php` or `C:\php\php.exe` - - this should be an absolute path, not just `php` - - Args: `vendor/bin/psalm-language-server` (on Windows use `vendor/vimeo/psalm/psalm-language-server`, or for a 'global' install '%APPDATA%' + `\Composer\vendor\vimeo\psalm\psalm-language-server`, where the '%APPDATA%' environment variable is probably something like `C:\Users\\AppData\Roaming\`) - -In the "Timeouts" tab you can adjust the initialization timeout. This is important if you have a large project. You should set the "Init" value to the number of milliseconds you allow Psalm to scan your entire project and your project's dependencies. For opening a couple of projects that use large PHP frameworks, on a high end business laptop, try `240000` milliseconds for Init. +As of PhpStorm 2020.3 support for psalm is supported and on by default, you can read more about that [here](https://www.jetbrains.com/help/phpstorm/using-psalm.html) ## Sublime Text From a5af5bde23cdd7cd17c7e1b3250be06e7dbb4887 Mon Sep 17 00:00:00 2001 From: Scott Vanderbeek <52388100+ScottAwesome@users.noreply.github.com> Date: Tue, 21 Sep 2021 08:15:06 -0700 Subject: [PATCH 2/2] Update language_server.md --- docs/running_psalm/language_server.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/running_psalm/language_server.md b/docs/running_psalm/language_server.md index c872e7012..cfeefb51d 100644 --- a/docs/running_psalm/language_server.md +++ b/docs/running_psalm/language_server.md @@ -29,8 +29,28 @@ This is the config I used: ## PhpStorm +### Native Support + As of PhpStorm 2020.3 support for psalm is supported and on by default, you can read more about that [here](https://www.jetbrains.com/help/phpstorm/using-psalm.html) +### With LSP + +Alternatively, psalm works with `gtache/intellij-lsp` plugin ([Jetbrains-approved version](https://plugins.jetbrains.com/plugin/10209-lsp-support), [latest version](https://github.com/gtache/intellij-lsp/releases/tag/v1.6.0)). + +Setup is done via a GUI. + +When you install the plugin, you should see a "Language Server Protocol" section under the "Languages & Frameworks" tab. + +In the "Server definitions" tab you should add a definition for Psalm: + + - Select `Executable` + - Extension: `php` + - Path: `` e.g. `/usr/local/bin/php` or `C:\php\php.exe` + - this should be an absolute path, not just `php` + - Args: `vendor/bin/psalm-language-server` (on Windows use `vendor/vimeo/psalm/psalm-language-server`, or for a 'global' install '%APPDATA%' + `\Composer\vendor\vimeo\psalm\psalm-language-server`, where the '%APPDATA%' environment variable is probably something like `C:\Users\\AppData\Roaming\`) + +In the "Timeouts" tab you can adjust the initialization timeout. This is important if you have a large project. You should set the "Init" value to the number of milliseconds you allow Psalm to scan your entire project and your project's dependencies. For opening a couple of projects that use large PHP frameworks, on a high end business laptop, try `240000` milliseconds for Init. + ## Sublime Text I use the excellent Sublime [LSP plugin](https://github.com/tomv564/LSP) with the following config(Package Settings > LSP > Settings):