Closed cjkent closed 10 years ago
isPhysical is certainly not the right method to determine if it's REPL. There might be quite many non-physical files created for different purposes. I'd suggest to create a special user data Key and put it either to the Document created for REPL, and then check if it's present. Maybe wrap with some more beautifully-looking static isReplFile() method.
What do you mean by "kept breaking the document"?
And what do you mean by the current namespace in REPL? Do you mean the one defined in previous evaluations? Then maybe it's easier to just track it on the side of the REPL, analysing the PSI as soon as it's being sent to the evaluation and remembering it somewhere.
I left the link in CLJ-198 issue to this pull request, so when we will start to fix this issue, we will take a look here. Or you have fix it earlier by another pull request (we can't merge this pull request, because it's not complete yet).
I'm not sure if this is the right approach but it fixes the problem in the REPL and doesn't seem to break auto-imports in regular files. There are some problems or things I'm unsure about: