RIDER-133554 ColorScheme: support for global variable in GDScript#457
RIDER-133554 ColorScheme: support for global variable in GDScript#457plane90 wants to merge 6 commits intoJetBrains:masterfrom
Conversation
|
Congrats on the pull request! |
gdscript/src/main/resources/colorSchemes/GdDarculaColorScheme.xml
Outdated
Show resolved
Hide resolved
gdscript/src/main/resources/colorSchemes/GdDarculaColorScheme.xml
Outdated
Show resolved
Hide resolved
gdscript/src/main/kotlin/gdscript/annotator/GdRefIdAnnotator.kt
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| if (psi.containingFile.isInSdk()) { | ||
| val autoload = ProjectAutoloadUtil.findFromAlias(txt, element) |
There was a problem hiding this comment.
this call is too heavy to be called many times and repeated on every change.
| snapshot = ReadAction.compute<Snapshot, RuntimeException> { buildSnapshot() } | ||
| } | ||
|
|
||
| private fun subscribeToChangesVF() { |
There was a problem hiding this comment.
what is the scenario for the VFS listener?
There was a problem hiding this comment.
I initially added the VFS listener because I thought .tscn script changes could be reflected before a PSI commit (I observed VFS events even without explicitly saving), so I tried to refresh the autoload snapshot when watched .tscn files change.
After re-checking the actual workflow, that observation was based on a wrong assumption on my side: the changes weren’t truly saved/committed yet. The correct behavior should be that updates are applied only after the file is saved and PSI is committed. In that case, the PSI listener (with performWhenAllCommitted) is sufficient, and the VFS listener is unnecessary and potentially misleading.
Sorry for the confusion and for introducing this bug-prone logic. I’ll update the PR to remove (or significantly narrow) the VFS listener and rely on PSI commit-based refresh only.
Additionally, I noticed a bug: if an autoload entry points to a .tscn and its nodes have no script (or the script is cleared), findGdFileForTscnFile returns null and the loop exits early, which prevents collecting the .tscn into watchedFiles.
I will fix this by registering .tscn files in watchedFiles regardless of script resolution, and by falling back to using the .tscn PSI file when no script is present.
|
Please incorporate (cherry-pick) this change to the pull request |
|
Hi @plane90! |
…GlobalScope.gd) add ColorScheme: Global Variable(Autoload), Global Variable(Built-in)
…nd fixed collection order
…ariable highlight labels)
(cherry picked from commit 61130fc)
|
@van800 |
|
Thank you! |
Autoload,
Built-in