godotengine / godot

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

Editor tries to open files from totally unrelated project #92248

Open miv391 opened 5 months ago

miv391 commented 5 months ago

Tested versions

System information

Godot v4.3.dev6.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 31.0.15.5212) - Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz (4 Threads)

Issue description

When opening a project, I get Attempt to open script errors where Godot tries to open files from other project. The project I opened in Godot is not the c:/godot/mechtech project that is shown in the error messages.

kuva

Godot Engine v4.3.dev6.mono.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started ---
--- GDScript language server started on port 6005 ---
[LSP] Connection Taken
  Attempt to open script 'file://c:/godot/mechtech/mechs/mech_builder.gd' resulted in error 'Can't open file'.
  Attempt to open script 'file://c:/godot/mechtech/mechs/mech_builder.gd' resulted in error 'Can't open file'.
  ...

Steps to reproduce

  1. Open project A in vscode
  2. Open some gdscript files of project A in vscode
  3. Make sure that vscode tries to connect to Language Server (LSP)
  4. Open project B in Godot -> Godot tries to open files belonging to project A

To reproduce the situation again, just restart vscode.

Minimal reproduction project (MRP)

N/A

neruthes commented 2 months ago

Reproduced in 4.3 stable.

image

I use vscodium to edit a GDScript file whose path appeared in Godot editor error logs.

I also suspect that the LSP server or the LSP client is not handling file path correctly. I usually see 3 slashes in file: URI. The same file would be represented as file:///home/neruthes/....