Fix DAP path mismatch on Windows

This commit is contained in:
Ricardo Subtil
2023-04-08 19:59:01 +01:00
parent cfab3d2f57
commit b8ae1c218c
2 changed files with 12 additions and 0 deletions

View File

@@ -45,6 +45,12 @@ private:
friend DebugAdapterProtocol;
_FORCE_INLINE_ bool is_valid_path(const String &p_path) const {
// If path contains \, it's a Windows path, so we need to convert it to /, and check as case-insensitive.
if (p_path.contains("\\")) {
String project_path = ProjectSettings::get_singleton()->get_resource_path();
String path = p_path.replace("\\", "/");
return path.findn(project_path) != -1;
}
return p_path.begins_with(ProjectSettings::get_singleton()->get_resource_path());
}