Finished implementing improved scope-checking for symbol highlighting.