Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion GodotDebugSession/GodotDebuggerSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,25 @@ protected override async void OnRun(DebuggerStartInfo startInfo)
string host = "127.0.0.1";
int remoteDebugPort = ((IPEndPoint)remoteDebugListener.LocalEndpoint).Port;

// Construct the --remote-debug parameter for the found version of Godot

var versionCommand = Command.Run(godotStartInfo.GodotExecutablePath, new[] { "--version" }).Result;
string versionOutput = versionCommand.StandardOutput;
int versionFirstDot = versionOutput.IndexOf('.');
if (versionFirstDot == -1 || !int.TryParse(versionOutput.Substring(0, versionFirstDot), out int versionMajor))
{
Logger.Log($"Godot launch request failed: Godot version unrecognized: {versionOutput}.");
Exit();
return;
}
string remoteDebugAddress = versionMajor >= 4 ? $"tcp://{host}:{remoteDebugPort}" : $"{host}:{remoteDebugPort}";

// Launch Godot to run the game and connect to our remote debugger

var args = new List<string>()
{
"--path", workingDir,
"--remote-debug", $"{host}:{remoteDebugPort}",
"--remote-debug", remoteDebugAddress,
};
args.AddRange(godotStartInfo.ExecutableArguments);

Expand Down
2 changes: 1 addition & 1 deletion src/assets-generator/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function createBuildTaskDescription(godotExecutablePath: string | undefin
label: 'build',
command: godotExecutablePath,
type: 'process',
args: ['--build-solutions', '--path', '${workspaceRoot}', '--no-window', '-q'],
args: ['--build-solutions', '--path', '${workspaceRoot}', '--no-window', '--quit'],
problemMatcher: '$msCompile',
};
}
Expand Down
6 changes: 5 additions & 1 deletion src/godot-tools-messaging/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ export class Client implements Disposable {
this.logger = logger;

this.projectDir = godotProjectDir;
this.projectMetadataDir = path.join(godotProjectDir, '.mono', 'metadata');
this.projectMetadataDir = path.join(godotProjectDir, '.godot', 'mono', 'metadata');
if (!fs.existsSync(this.projectMetadataDir)) {
// Fallback for 3.x projects
this.projectMetadataDir = path.join(godotProjectDir, '.mono', 'metadata');
}

this.metaFilePath = path.join(this.projectMetadataDir, GodotIdeMetadata.defaultFileName);
}
Expand Down