Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-completion for SObject names #520

Open
wants to merge 1 commit into
base: release/v1.12.6
Choose a base branch
from

Conversation

mhogg-srg
Copy link

Salesforce objects retrieve SObject names during initialization and append them to the normal elements returned by dir, allowing for auto-complete of SObject names found in the Salesforce instance. (Sadly, not all IDEs support auto-completion using dir.)

@jon-wobken jon-wobken added the Backlog Issue will be looked at sometime in the future label Feb 1, 2022
@jon-wobken jon-wobken changed the base branch from master to release/v1.12.2 July 25, 2022 15:00
@jon-wobken jon-wobken changed the base branch from release/v1.12.2 to release/v1.12.3 September 12, 2022 20:54
@paneidos
Copy link
Contributor

This would cost one API call per instance of the Salesforce class.

@mhogg-srg
Copy link
Author

This would cost one API call per instance of the Salesforce class.

That's an excellent point. I guess that makes this idea undesirable, unless an optional parameter were added to the constructor, something like a boolean called interactive.

in self.describe()['sobjects']]
except: # pylint: disable=bare-except
self._sobject_names = []

Copy link
Contributor

@ericbn ericbn Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this code could be moved inside the __dir__ function so it does not run in production code. Also not sure the bare except is a good idea -- could be at least except Exception:.

@jon-wobken jon-wobken changed the base branch from release/v1.12.3 to release/v1.12.4 January 12, 2023 19:02
@jon-wobken jon-wobken changed the base branch from release/v1.12.4 to release/v1.12.6 October 24, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog Issue will be looked at sometime in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants