Skip to content

Commit c0e4e48

Browse files
committed
fix minor UID related issue
(cherry picked from commit 9e860b7c5036397486e12731e317f5b3a52bfa3e) IJ-CR-157870 GitOrigin-RevId: d6dc83ef32c5343f5553acb3682b53d9a5addda1
1 parent 4a2fe4a commit c0e4e48

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

rider/src/main/kotlin/com/jetbrains/rider/plugins/godot/projectView/GodotUidTracker.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
1414
import com.intellij.openapi.vfs.VfsUtil
1515
import com.intellij.openapi.vfs.VfsUtilCore
1616
import com.intellij.openapi.vfs.newvfs.BulkFileListener
17-
import com.intellij.openapi.vfs.newvfs.events.VFileDeleteEvent
18-
import com.intellij.openapi.vfs.newvfs.events.VFileEvent
19-
import com.intellij.openapi.vfs.newvfs.events.VFileMoveEvent
20-
import com.intellij.openapi.vfs.newvfs.events.VFilePropertyChangeEvent
17+
import com.intellij.openapi.vfs.newvfs.events.*
2118
import com.intellij.openapi.vfs.readBytes
2219
import com.intellij.util.PathUtil
2320
import com.intellij.util.application
@@ -34,16 +31,21 @@ import java.nio.file.Path
3431
import java.nio.file.Paths
3532
import kotlin.io.path.name
3633

37-
// for file outside csproj, just nesting rules are enough
38-
// but users may decide to include some files in the csproj
39-
// when files are in the project model and their uid is not, we need to take the same approach as Unity plugin
34+
/* the platform behavior is a bit unexpected
35+
- for move, rename file outside csproj just nesting is enough
36+
- but deleting file would not cause uid deletion
37+
38+
when files are in the project model and their uid is not, we need to take the same approach as Unity plugin
39+
40+
todo: when coping a file we need to either avoid coping UID file or substitute guid inside a copy
41+
*/
4042

4143
class GodotUidTrackerInitializer : ProjectActivity {
4244
override suspend fun execute(project: Project) {
4345
val lifetime = GodotProjectLifetimeService.getLifetime(project)
4446
val godotDiscoverer = GodotProjectDiscoverer.getInstance(project)
4547
godotDiscoverer.godotDescriptor.adviseUntil(lifetime) {
46-
if (it != null && !it.isPureGdScriptProject) {
48+
if (it != null) {
4749
GodotUidTracker.getInstance().register(project)
4850
return@adviseUntil true
4951
}

0 commit comments

Comments
 (0)