Godot GDScript @export variables disappear from inspector when saving in Cursor

Bug Description

When editing GDScript files in Cursor that contain @export variables, saving the file in Cursor causes these exported variables to disappear from Godot’s inspector panel. This requires manual reloading of the scene in Godot to restore the inspector values.

Steps to Reproduce

  1. Create a GDScript file in Godot
  2. Edit the script in Cursor with @export variables, e.g.:
    @export var non_aiming_color: Color
    @export var aiming_color: Color
    (Whether or not the default value is set)
  3. Set values for these variables in Godot’s inspector
  4. The variables disappear from Godot’s inspector

Expected Behavior

The @export variables should remain visible in Godot’s inspector after saving the file in Cursor.

Current Workaround

Currently need to:

  1. Save in Cursor
  2. Switch to Godot
  3. Reload the scene (F6)
  4. Re-set the inspector values
  5. Save in Godot

Environment

  • Cursor Version: 版本: 0.45.11
    提交: 1.96.2
    日期: f5f18731406b73244e0558ee7716d77c8096d150
    Electron: 2025-02-07T09:43:58.555Z
    ElectronBuildId: 32.2.6
    Chromium: undefined
    Node.js: 128.0.6613.186
    V8: 20.18.1
    OS: 12.8.374.38-electron.0
  • Godot Version: 4.2.2 stable
  • OS: Windows 11