godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.44k stars 21.07k forks source link

[3.5.1.rc1] Error messages in the wrong place and wrong file management (language server) #66426

Open git2013vb opened 2 years ago

git2013vb commented 2 years ago

Godot version

v3.5.1.rc1.official [293c3844b]

System information

Debian 11

Issue description

As you can see from the terminal log I started my 'SERVER' and I receive my Client errors.

My idea is in a multi godot instces opened the language server port is the same image

(1097797) 07:06:45.569 I: res://Main.gd (4) [_ready] ============================ SERVER START ======================
(1097797) 07:06:46.353 I: res://auto_load/hub_connection.gd (38) [_on_connection_succeeded] GameServer successful connected to HUB
(1097797) 07:07:09.495 I: res://auto_load/hub_connection.gd (53) [receive_login_token] 
ERROR: Condition "err" is true. Returned: err
   at: load_source_code (modules/gdscript/gdscript.cpp:807)
ERROR: Cannot load source code from file 'file:/home/vale/godot/DesertEdge/Client/auto_load/gateway.gd'.
   at: load (modules/gdscript/gdscript.cpp:2209)
ERROR: Failed loading resource: file:/home/vale/godot/DesertEdge/Client/auto_load/gateway.gd. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:270)
ERROR: Condition "err" is true. Returned: err
   at: load_source_code (modules/gdscript/gdscript.cpp:807)
ERROR: Cannot load source code from file 'file:/home/vale/godot/DesertEdge/Client/auto_load/gateway.gd'.
   at: load (modules/gdscript/gdscript.cpp:2209)
ERROR: Failed loading resource: file:/home/vale/godot/DesertEdge/Client/auto_load/gateway.gd. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:270)

Steps to reproduce

make two projects, enable external editor like vscode run them using the external editor set some classes into autoload (mine are in a linked directory but I believe its the same if they are in the project root) generate some syntax errors observe the terminal out put ( I have mine setup using nohup nohup /home/vale/Downloads/godot_normal/Godot_v3.5.1-rc1_x11.64 -e >/home/vale/Desktop/Godot Prj/DesertEdge/Server/server.log 2>&1 & but I think a normal output terminal in the same machine will be fine too)

Minimal reproduction project

NA.

ps.: I have tons of issue opened here and nobody fixed them since long time.. I'm currently out of hope that this issue will be taken in consideration.. You can see this issue as my last attempt to help.

Thanks

git2013vb commented 2 years ago

I noticed another problem more serious:

Assuming I have: two project opened (a,b) in each project I have one script in autoload (same name in both projects. example Global) one vscode instance for each project where I'm editing that script

Frome one editor I can open the other project script using ctrl + click on keyword Global that is the name given in autoload.

the opened script show the absolute path of it.

So I have both script opened.

One related to the project currently opened (with relative path) and the other from the other project (absolute path)

This confirm my idea. both project point to same language server.

The solution is obviously to have a different language server (its not like that atm?) for each project (with different port number).

I tried another thing in the meantime:

In case I have two projects opened the last one became the listener server. It I close it the other give me this error:

image

git2013vb commented 1 year ago

After some test I think the right solution for this issue will be to move the Language Server port settings in Project settings adding the capability to change its value if the current port is busy then update Godot Tools vs code extension accordingly.