godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.52k stars 149 forks source link

The method "Vector2i" isn't declared in the current class. #514

Closed muhajirdev closed 10 months ago

muhajirdev commented 10 months ago

Godot version

4.1.1

VS Code version

1.82.3

Godot Tools VS Code extension version

1.3.1

System information

Mac OS

Issue description

I was playing around with tilemap

extends TileMap

var GridSize = 30   ;
var GridData = {}

# Called when the node enters the scene tree for the first time.
func _ready():
    for x in GridSize:
        for y in GridSize:
            set_cell(0, Vector2i(x,y), 0, Vector2i(0,0), 0)
            print(str(Vector2(x,y)))

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
    pass

It seems that Vector2i is not detected in vscode. But Vector2 is detected.

Steps to reproduce

Put this code in the code

extends TileMap

var GridSize = 30   ;
var GridData = {}

# Called when the node enters the scene tree for the first time.
func _ready():
    for x in GridSize:
        for y in GridSize:
            set_cell(0, Vector2i(x,y), 0, Vector2i(0,0), 0)
            print(str(Vector2(x,y)))

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
    pass

See the red underline below Vector2i

muhajirdev commented 10 months ago

For anyone facing this issue, check this https://github.com/godotengine/godot-vscode-plugin#gdscript_lsp_server_port

DaelonSuzuka commented 10 months ago

It sounds like you have Godot 3 open and the extension is connecting to that.