fix to type inferencing of declared variables for code completion
added test case
revised test cases
minor code fixes
Merge pull request #2943 from aparajit-pratap/codeBlockBugFixes

Cross merge from master to Revit2015 for PR #2912