Open bitspittle opened 3 months ago
I'll be honest, I'm not really sure what's going on here.
The color provider extension point is just doing some checks using PSI elements passed in from the IJ framework. There's no caching.
I don't think the fundamental issue (outdated stubs, etc.) is something I'm causing. Possibly I can wrap my code in a try / catch Throwable to avoid getting pointed at as a bad extension by IDEA.
@bitspittle Wrapping the entire parsing function in a try-catch seems a little overkill. From what I can deduce using the stacktrace, stuff goes downhill when accessing this.valueParameterList?.text
inside of isKobwebColorFunction
. Maybe there is some safe version of fetching the text? Regardless i would rather catch errors inside of isKobwebColorFunction
. Also you can use runCatching { ... }.getOrDefault(false)
for a nicer way of ignoring errors here.
I do aggree though that this is probably not the plugin causing the issue
Thanks @Nxllpointer for also taking a look.
It's possible the best course of action is to actually remove the code I introduced entirely. This seems like such a fundamental error that there's no way we could catch all places.
It's also unfortunately very timing specific and hard (impossible?) for us to reproduce.
Here are some more interesting links that LoP surfaced:
LoP saw the error two times when they were doing rebase / merges.
Could this perhaps be due to a race condition? I am pretty certain our getColorFrom
gets called on some other thread, so the PSI tree could possibly be updated while our method is running. That might explain why the error surfaced when rebasing/merging, since a lot of code gets changed in an instant by an external source. Very wild speculation though.
Outdated stub in index
PSI and index do not match