How to Get Project Path and File Path in a Remote Environment for a Plugin?

Hi, my team is developing a plugin for IntelliJ IDEA, and we want to add support for remote development.

The challenge we’re facing is that our plugin requires the project path on the remote machine to function correctly. In a regular local environment, we use project.getBasePath(), which works as expected. However, in a remote development setup, this method returns a path like:

/Caches/JetBrains/IntelliJIdea2024.3/frontend/per_process_config_1

Instead of the actual project path on the remote machine.

We’re looking for a reliable way to retrieve the correct remote project path. Any insights or suggestions would be greatly appreciated!

There is no such concept as root folder of a project. Do not use it, always analyze all content entries! There are popular cases where multiple roots / projects attached