fortinmike / XcodeBoost

An Xcode plugin that aims to make altering and inspecting code quick and easy.
MIT License
817 stars 86 forks source link

Consider symbol scope when highlighting symbols #16

Closed fortinmike closed 10 years ago

fortinmike commented 10 years ago

Currently, XcodeBoost finds the selected symbol in the whole file, regardless of if the symbol is declared in the global scope or not. What I would like to do is limit the results to the uses of the symbol in the current method if it's not declared in the global scope.

A possible course of action:
  1. Find occurrences of the symbol in the whole file.
  2. Check if the occurrences all occur within method definitions.
  3. If they do, then consider the symbol as local to the current method.
  4. If they don't, consider the symbol as global and highlight all occurrences (current behaviour).