Could it be that some script is defining window[0] to hold some value? scopeCompletionSource just shows the properties from the object it is given, and I don’t think it would be appropriate to put some random filtering heuristic in there. I’m not seeing this on the codemirror.net demo. Are you?
It turns out that an iframe in my page is defining window[0] as the frame window. I wasn’t able to fix this, since I need iframes in my website for it to work properly.
In fact, I was actually thinking about doing that originally, but I didn’t think CodeMirror 6 would detect any new variables defined in the editor’s “value”. It turns out it does, which was quite surprising to me.