Search code examples
intellij-ideawebstormjetbrains-ideintellij-plugin

JetBrains IDEs internal web server API stopped working as expected (on latest 2022.3.1 WebStorm)


IntelliJ based IDEs running built-in web server, usually running on port 63342.

The supposedly supported API can be found here:

 * @apiExample {curl} Absolute path
 * curl http://localhost:63342/api/file//absolute/path/to/file.kt
 *
 * @apiExample {curl} Relative path
 * curl http://localhost:63342/api/file/relative/to/module/root/path/to/file.kt
 *
 * @apiExample {curl} With line and column
 * curl http://localhost:63342/api/file/relative/to/module/root/path/to/file.kt:100:34
 *
 * @apiExample {curl} Query parameters
 * curl http://localhost:63342/api/file?file=path/to/file.kt&line=100&column=34

or pretty printed here.

This API worked perfectly fine on WebStorm 2020.3 (I installed it just to check):

enter image description here

However it stopped working as expected on 2022.1 (or maybe before):

enter image description here

As a result, any extension based on this API (such this one I'm using) stopped working.

If the API of the built-in web server has changed, I can't find where it is documented (and chatGPT doesn't know it because it's too new 😆).

The latest indication I could find that the API was working as expected as described above, is here from 2020/3/16.

Note, this is not a duplicate: this thread is old and not relevant, this issue is not related to the security update that required checking 'Allow unsigned requests' in the settings.


Solution

  • In 2022.3 /api/file/ was moved to IDE Remote Control plugin, it's now required for the API to work