How to select Visual Studio code Profile when editing a Script

Hi.
I’ve created in Visual Studio Code a new Unity profile, containing only the extension that I need for it.
The profile works, but it’s not the default profile.
When I double-click on a script in Unity Editor, Visual Studio Code is opened and the script appears, but the profile is the default one.
It’s possible to select the profile in the command line writing something like code.exe --profile "Unity" myFile.cs, and this works. So how can I set the --profile option in Unity?
I went to the preferences, and if I select “Visual Studio Code” as External Script Editor I cannot set the options, while if I set “Open by file extension” even if I write --profile "Unity" $(File) in the “External Script Editor Args”, it opens VSC with the default profile.
Is there a way to pass the command line option to Visual Studio Code when opening it?

I managed to get it to work by:

  1. Remove “Visual Studio Editor” from your project via Package Manager
  2. Edit->Preferences->External Tools
    External Script Editor: Visual Studio Code (Internal)
    External Script Editor Args: --profile "Unity" $(ProjectPath) $(File)
1 Like