godotengine / godotengine/godot

Type errors only show in the currently open file.

Open
#91,180 1 comment 1 reaction 0 assignees View on GitHub
enhancement topic:editor topic:gdscript
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.2.1

### System information

Windows 11

### Issue description

Type errors only show on the currently open script in the editor window, even when untyped variables is set to give errors in project settings. Errors in other scripts are not found until that script is navigated to or the program crashes while running.

By opting into type safety you can find needles in a haystack before they crash your game. In projects of reasonable complexity where there are hundreds of individual script files from multiple people, the ability to know when changing code in one file breaks another anywhere else is essential and is a basic function of IDEs for typed languages.

A solution could be running the Language Server on every .gd file after a script is saved that way errors can be thrown.

### Steps to reproduce

In the example project, open Enums.gd and rename bar to Bar. Foo.gd has a variable bar typed as Enums.bar but the editor does not show an error until you navigate to it.

### Minimal reproduction project (MRP)

[Code Analyzer Test.zip](https://github.com/godotengine/godot/files/15121852/Code.Analyzer.Test.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached Code Analyzer Test.zip and reproduce the case by renaming bar to Bar in Enums.gd while Foo.gd references Enums.bar. Check whether the editor reports the error in Foo.gd without opening it. Done means errors in changed dependencies are surfaced without navigating to each script.

Written by the indexing model from the issue text.

Assessment

Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.