Code Completion involving class methods versus instance methods

Issue #975 resolved
Mike Wannamaker created an issue

The code completion is awesome, however it doesn't distinguish between Class methods/fields and instance methods/fields. If I have a static method on a class called getInstance(), and I do MyClass.get Then all the class instance methods show up for code completion and they should not. Same as with an instance of the class the static methods show up.

It doesn't block me from working but this is a big annoyance.

Reproduction is pretty straight forward.

Comments (3)

  1. Scott Wells repo owner

    Yeah, this is on my list. The reason it's not implemented right now is because Salesforce was not returning reliable information about the static modifier in earlier versions of the APIs used to build the OST, so it would have caused valid completions to be omitted when completing against OST types. It does seem to be much more reliable now, though, so minimally I'd like to make it respect class vs. instance by default and, if that causes issues, allow the user to disable it so that it behaves as it does now.

    This will likely be grouped together with smart completion which is also on my near-term agenda. Thanks for logging!

  2. Scott Wells repo owner

    Obviously a blast from the past, but working on this now for inclusion in the next build. I'm also planning to include a code inspection that flags invalid usages of class symbols via instances and vice-versa with quick fixes where possible, e.g., change myString.isNotEmpty(myString) to String.isNotEmpty(myString).

  3. Log in to comment