I believe in this approach, but making it usable is harder than it sounds. Once I tried watching myself program with this idea in mind. I realized I often start by typing methods which don't yet have a class, code fragments which don't yet belong to a function, even expressions which don't yet live in a statement and which refer to variables which not only don't yet exist but don't belong to any yet-existing class — maybe I'll pause half-way through writing the expression and start creating the class in another window.
So you pass through a lot of ill-defined states. For the IDE to keep up it would have to just represent explicitly "this is a code fragment which doesn't have a name", "this is a variable which isn't defined anywhere" and so forth.