@@ -14,10 +14,7 @@ import com.intellij.openapi.vfs.LocalFileSystem
14
14
import com.intellij.openapi.vfs.VfsUtil
15
15
import com.intellij.openapi.vfs.VfsUtilCore
16
16
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.*
21
18
import com.intellij.openapi.vfs.readBytes
22
19
import com.intellij.util.PathUtil
23
20
import com.intellij.util.application
@@ -34,16 +31,21 @@ import java.nio.file.Path
34
31
import java.nio.file.Paths
35
32
import kotlin.io.path.name
36
33
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
+ */
40
42
41
43
class GodotUidTrackerInitializer : ProjectActivity {
42
44
override suspend fun execute (project : Project ) {
43
45
val lifetime = GodotProjectLifetimeService .getLifetime(project)
44
46
val godotDiscoverer = GodotProjectDiscoverer .getInstance(project)
45
47
godotDiscoverer.godotDescriptor.adviseUntil(lifetime) {
46
- if (it != null && ! it.isPureGdScriptProject ) {
48
+ if (it != null ) {
47
49
GodotUidTracker .getInstance().register(project)
48
50
return @adviseUntil true
49
51
}
0 commit comments