[Deprecated] Godot UID Sync Extension for VS Code

Update (July 18, 2025):

After further testing, I discovered a major issue with this extension:
when renaming C# files in VS Code, the .uid file is renamed correctly, but the Godot editor does not update the script reference in .tscn files.
This can lead to broken script attachments without any warnings.

Because of this, I’ve decided to stop recommending the extension for now.

=====

Hi everyone,

I’m quite new to Godot — I’ve only been using it for about 4 days — but I ran into a minor inconvenience when working with Visual Studio Code, especially around how .uid files are handled.

So, I made a small VS Code extension to help solve this problem in a way that works for me.

You can get it on the Visual Studio Code Marketplace

https://marketplace.visualstudio.com/items?itemName=masatoko.godot-uid-sync

:thought_balloon: Background

While working in VS Code on Godot projects, I noticed some small annoyances with how .uid files behave — regardless of whether you’re using GDScript, C#, or another language.

:magnifying_glass_tilted_left: Existing Solution

I tried two common approaches to deal with .uid files:

  • Excluding .uid files with files.exclude

    • Hiding them via files.exclude seems like a simple solution.
    • But if you rename or move the original file, the .uid file gets left behind, breaking the reference in Godot.
  • File nesting behavior

    • When .uid files are nested under the original file, the little icon > on the left makes it hard to tell at a glance whether it’s a folder or a file.
    • When files with and without .uid files are listed together, the different indentation levels make the structure harder to follow.

:light_bulb: My Solution

I created a VS Code extension that solves this problem in the way I wanted:

  • As a preparation, add "**/*.uid": true to the files.exclude section in your VS Code settings. This will hide .uid files from the explorer to keep things clean.
"files.exclude": {
    "**/*.uid": true
}
  • When you rename or move a resource file (e.g. .tscn, .cs, etc.), the extension automatically renames/moves the corresponding .uid file as well.
  • This way, you can work without having to worry about the presence of .uid files.

Here’s a visual example of what it does:

:memo: Notes / Tips

  • When renaming or moving a file, make sure the corresponding .uid file was also renamed or moved by checking the popup message. If no popup appears, the operation likely failed.

  • If you want this extension to run only in Godot projects, set the following setting to true:

    {
      "godotUidSync.enabledOnlyInGodotProjects": true
    }
    

    (By default, it’s false.)

    You can set it to false to prevent the tab from popping up, but you should still keep an eye on whether .uid files are being renamed properly, since failures can happen silently.

:link: Links

This extension is still in early development, so feedback is very welcome.
Thanks for checking it out!

If there’s already a better or more standard solution to this problem that I missed, I apologize in advance.

2 Likes

See also Implement proper LSP file rename/delete (moves/deletes .uid/.import files) by Cretezy · Pull Request #105536 · godotengine/godot · GitHub which adds this moving and renaming logic as a language server feature. (Not sure if it would support C# though)

4 Likes

Thanks for the info!

I actually tried it in my environment, but the .uid files didn’t seem to move as expected — so I might have something misconfigured on my side. I’ll take another look just in case.

Appreciate you pointing me to that PR!

1 Like