TextScene Inspector: Godot .tscn preview for VS Code
Shows a live 3D or 2D preview of a Godot .tscn file beside its text, without Godot. Works in desktop VS Code and in vscode.dev.
Open the preview
- Open the folder that holds
project.godot. The extension resolves res:// paths from there. For a scene with no project.godot above it, the extension resolves them from the scene's own folder.
- Open a
.tscn file.
- Run TextScene: Open Preview to the Side, or press Ctrl+K V (Cmd+K V on macOS).
Each .tscn file can have its own preview.
Use the preview
- The viewport uses Godot's editor controls. Press ? in the viewport for the full list.
- Click a node in the tree or the viewport to see its properties in the Inspector tab.
- Double-click a node in the tree to jump to its line in the source.
- Click Copy node path beside the Inspector's Path to copy the node's path from the scene root, as Godot's Copy Node Path writes it. The root copies as
..
- Use the 3D/2D switch for Control and Node2D scenes.
- A mesh whose texture is missing renders magenta. The Resources tab lists the missing path.
- Save the file, or a file it uses, and the preview updates. The camera stays where it is.
Editor features
- Problems panel: the linter checks each open
.tscn file. For a scene in a workspace folder, it also reports a .glb or .gltf file the scene uses that Godot's importer refuses. Godot fails to load the scene or resource when a sub-resource, a .tres [resource] body, a connection or the root node uses the glTF file. The report is then an error when the scene has a project.godot that enables no editor plugin, declares no autoload, and the project holds no .gdextension file. Otherwise it is a warning, because one of them can add support. Where only other nodes use the glTF file, the scene loads without it, and the report is always a warning.
- Problems panel (after a file change): when a glTF file or
.godot/extension_list.cfg changes on disk, the linter checks each open scene that reads it again. When someone creates or deletes a .gdextension file, a .gdignore or a project.godot, or changes project.godot, the linter checks the open scenes of that project again. When someone deletes or moves a folder, the linter checks again each open scene that read a file inside it, or whose project listed a .gdextension file inside it.
- Copy Node Path: run TextScene: Copy Node Path from the editor menu or the Command Palette. It copies the path of the
[node] section that holds the cursor, as Godot's Copy Node Path writes it.
- Outline: the scene tree of the file. Click an entry to jump to its line.
res:// links: Ctrl-click (Cmd-click on macOS) a path to open the file.
- Go to Definition on
SubResource("id") and ExtResource("id") goes to the heading that declares the id. On a node path in parent=, from= or to=, it goes to the [node] heading that the path names.
- Find All References on a
res:// path lists every place that names the same path in a .tscn or .tres file under the same res:// root. It matches the whole path in a heading, a value, a comment or prose, and it counts the unsaved text of an open file. It reads the path text only: an ext_resource whose uid= names the file but whose path= is stale is not found.
- Hover: shows a class's base chain and a link to its reference page. On a property, it shows the type, the declaring class and the accepted values. On a resource id, it shows the declaration.
- Completion: node and resource classes, property names, enum values, resource ids and
res:// paths. Completion marks a deprecated property name.
- Quick fixes: rename a deprecated property name, or repair a typo in a property name or a class name.
- Folding and document highlights: fold each node and resource body, and highlight every use of a resource id or of a node, including its
parent=, from= and to= paths.
- Agent tools: a coding agent in chat can lint a scene, read its node tree, open its preview, list its missing resources and, from VS Code 1.106, capture its preview as a PNG. The tools read an open scene's editor text, unsaved edits included. Turn them off with
textscene.agentTools.enabled.
To change the settings, search for textscene in the Settings editor.
The tscn-lsp language server gives Neovim, Helix, Zed and other editors the same language features.
More
| |