I’m a new FME user and trying to get into custom functionality via the PythonCaller transformer. I’m using VS Code as my primary code editor and I set it up in the FME Options menu.
My problem is, that VSCode keeps showing me the onboarding dialogs (Login to Github Copilot, Choose theme, ...) everytime I open the PythonCallers code in the external editor.
I did a little bit of digging and found out: VSCode is called by FME Form with a temporary directory. (Flag: --user-data-dir). In that directory information about how VSCode is setup is stored.
Is there anyway I can get rid of this behavior and it just points to the standard user-data-dir or the option is left out completely? I did not find any option to disable this behavior in the FMEOptions, so I’m asking here now.
Thanks for taking the time,
Johannes
Best answer by j.herbert
For anyone stumbling upon this post. The solution is creating a custom script, that removes the commandline parameters that FME Form starts VSCode with and using that script inside FME Form for opening VSCode.
Script:
@echo off setlocal rem Drops the --user-data-dir and --extensions-dir arguments FME passes so VS Code uses the normal profile. set "VSCODE=C:\Program Files\Microsoft VS Code\bin\code.cmd" :: replace with your vscode installation directory set "ARGS=" :next if "%~1"=="" goto run if /i "%~1"=="--user-data-dir" (shift & shift & goto next) if /i "%~1"=="--extensions-dir" (shift & shift & goto next) set ARGS=%ARGS% "%~1" shift goto next :run call "%VSCODE%" %ARGS%
Instructions:
Create a file named vscode.cmd inside your FME-Document directory, e.g. User\Documents\FME
Paste the script from above inside it
Update the directory of VSCode inside the script to point to your installation (Line 4)
Set the script as the vscode executable inside FME Form
Utilities → FME Options → Workbench → Text Editor Options
We appreciate you bringing up your concern about VSCode starts onboarding everytime when opening PythonCaller code.
We are aware of this hiccup in some users cases and have it on our radar. For reference: FMEFORM-38567. This should be fixed in the coming releases.
For convenience for now, since not many have replied to your thread about this hiccup, would you be able to create a support ticket with us? I’ll be able to give you the fix there.
For anyone stumbling upon this post. The solution is creating a custom script, that removes the commandline parameters that FME Form starts VSCode with and using that script inside FME Form for opening VSCode.
Script:
@echo off setlocal rem Drops the --user-data-dir and --extensions-dir arguments FME passes so VS Code uses the normal profile. set "VSCODE=C:\Program Files\Microsoft VS Code\bin\code.cmd" :: replace with your vscode installation directory set "ARGS=" :next if "%~1"=="" goto run if /i "%~1"=="--user-data-dir" (shift & shift & goto next) if /i "%~1"=="--extensions-dir" (shift & shift & goto next) set ARGS=%ARGS% "%~1" shift goto next :run call "%VSCODE%" %ARGS%
Instructions:
Create a file named vscode.cmd inside your FME-Document directory, e.g. User\Documents\FME
Paste the script from above inside it
Update the directory of VSCode inside the script to point to your installation (Line 4)
Set the script as the vscode executable inside FME Form
Utilities → FME Options → Workbench → Text Editor Options