-
Notifications
You must be signed in to change notification settings - Fork 393
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
chore: core API to access the sfdx project namespace. #5253
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. With this API e4d could identify if there is a namespace in the project to avoid wrong class symbol.
public async getSfdxNamespace(): Promise<string | undefined> { | ||
const namespace = await SfdxProjectConfig.getValue('namespace'); | ||
return typeof namespace === 'string' ? namespace : undefined; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Flora. Sorry for the delay. Rather then overloading the workspaceContext with sfdxConfig info, how about we add SfdxProjectConfig as a new exported api? The SfdxConfig seems like an obvious addition to the core extension API. Basically just add SfdxProjectConfig
to
WorkspaceContext |
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbockus-sf Yeah, I've considered adding another exported API vs overloading the workspaceContext. The sfdx namespace exists in the sfdx-project.json
file, which is located in the workspace, so I thought it made sense to include it as part of the workspaceContext. I'm open to moving it to a new API if you have a strong preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @floralan! Yeah Let's go ahead and make that API update. It will ensure we have access to any configuration without having to update the workspace context 👍
What does this PR do?
This PR adds the
getSfdxNamespace
function to the core API so that we can utilize it in E4D. PR in E4D that uses this function: https://github.com/forcedotcom/salesforcedx-vscode-einstein-gpt/pull/222What issues does this PR fix or reference?
@W-14559660@
Functionality Before
Can't get sfdx project namespace from the core extension API
Functionality After
Available function to get sfdx project namespace.