Untitled documents definitely make things more complicated. The nice thing about `id` -> `Document` mapping is it's guaranteed to be stable. 

Here is one possible solution: keep a map of `InMemoryFile` instances, and have a lookup that takes a `fullPath` and returns an existing `InMemoryFile` (if one is found). This way `getOpenDocumentForPath()` could do an explicit `InMemoryFile` check first, and then fall back on `getFileForPath()`, and use the `id` for quick lookup (avoiding the linear search by `fullPath`).

How does that sound?