Using the enclosed type to fix completion and imports for inner classes.

Make sure that the enclosing object is passed to the indexer also for modules.

Fix #1002002
Merge pull request #607 from tbje/fix-inner-type-completion-#1002002

Using the enclosed type to fix completion and imports for inner classes.