godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.47k stars 148 forks source link

Opening a file through Godot doesn't work if opened using "Open workspace with Godot Editor" #626

Open rktprof opened 3 months ago

rktprof commented 3 months ago

Godot version

4.2.1

VS Code version

VSCodium 1.87.2

Godot Tools VS Code extension version

2.0.0

System information

macOS 14.4

Issue description

When opening Godot though the "Open workspace with Godot Editor" button in VSCode you can't open script files using the FileSystem browser (or "Quick Open...") in the editor, the terminal in VSCode prints this error:

node:internal/modules/cjs/loader:1087
                                       throw err;
                                                   ^

                                                    Error: Cannot find module '/Users/rktprof/Documents/Projects/test-project'
                                 at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
         at node:internal/modules/cjs/loader:929:27
                                                       at Function._load (node:electron/js2c/node_init:2:13357)
                at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:96:12)
      at node:internal/main/run_main_module:23:47 {
                                                     code: 'MODULE_NOT_FOUND',
                                                                                requireStack: []
                                                                                                }

                                                                                                 Node.js v18.17.1

Steps to reproduce