I have a Macbook with touchbar and wanted to set touchbar to always show FN keys for JetBrains apps. I have done it in preferences, same as for other apps. FN keys shows as default in those apps when they are in focus but not in the JetBrains apps.
If you are using ToolBox App to install your JetBrains products then please have a look at the comments in IDEA-167332 ticket -- you will have to locate your apps in ~/Library/Application Support/JetBrains/Toolbox/apps/
folder.
Downside -- you need to repeat this to every new build of such app that you will install as the path to actual app will be different every time.
UPDATE: the aforementioned ticket has been marked as fixed for 2018.2.x version version. You now have an option on Preferences | Keymap
screen.