What is the idiomatic way to check if we are in RD mode?

Hello :waving_hand:

I wonder - what is the proper way to check if a plugin is run in an IDE in RD mode?

I found:

AppMode.isRemoteDevHost()

but it refers to an internal API.

I found:

ClientSessionsManager.getAppSession(ClientId.current)?.isRemote

but it refers to an experimental API.

Are there any alternatives???

Kind regards,
Mikołaj Kondratek

1 Like

There is only an internal API to get this information, indeed.

For a backend/host process, the correct method is AppMode.isRemoteDevHost().
Alternatively, if you want to get an application/project client session, there are internal extension properties: Application.currentSession and Project.currentSession.

For a frontend/client process, the correct method is PlatformUtils.isJetBrainsClient().

Could you please tell us more about tasks you want to solve using these APIs? It would help us a lot to organize it better

I am working on a plugin that provides inline completions. AFAIK there are two approaches available - completion provider API and inlays. Inlay seem to provide more flexibility and allow more advanced solutions but they do not work in RD mode.

The other thing is that some UI components (dialogs, popups) seem to work less stable in RD mode.