godotengine / godotengine/godot-vscode-plugin

Could not find type in the current scope.

Open
#487 7 comments 4 reactions 0 assignees View on GitHub
bug confirmed language server
Dominant language
TypeScript
Stars
2.1k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

### Godot version

v4.1.1.stable.official [bd6af8e0e]

### VS Code version

1.81.1

### Godot Tools VS Code extension version

1.3.1

### System information

Windows 10

### Issue description

The VS Code extension shows an error that the type (class in this case) cannot be found if the class name is used in the type definition. The Godot Editor can resolve the class without issue.

VS Code:
![image](https://github.com/godotengine/godot-vscode-plugin/assets/2805598/a1ce12dd-c56f-49ff-b20b-1c78d1465c60)

Godot Editor:
![image](https://github.com/godotengine/godot-vscode-plugin/assets/2805598/ba38ddeb-3e34-4a95-a166-447bfdab6c26)

### Steps to reproduce

1. Create a script called `_entity.gd`.
2. Make it extend a class and give it a class name `class_name Entity`
3. Make a second script
4. in the second script, use the class name `Entity` in a type annotation of a function parameter.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.