Forece recompile from code after modifying scriptingDefines

I have an editor script which uses PlayerSettings.SetScriptingDefineSymbolsForGroup to set the scripting defines. After that I call AssetDatabase.Refresh(). But that doesn’t trigger recompilation. There are some part of my code which are active depending on what is in the scripting define symbols. If I don’t use the script, just write the values in player settings manually, it triggers a recompile and works fine. Any solution to that?

I think the recompile is triggered, but the VisualStudio is not reloading the solution.
I’m adding a DELETEME define symbol at the end, then enter PlayerSettingss and doubleclick/delete it → that forces a reload of the solution, but it’s manual. Let me know if you find a way to reload the solution from an Editor script

I’m also curious to know if there’s a way to force recompilation that takes the new scripting symbols into account.

Currently I manually minimize the editor and then maximize it again to trigger the refresh.