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

chore: core API to access the sfdx project namespace. #5253

Merged
merged 10 commits into from
Dec 5, 2023

Conversation

floralan
Copy link
Contributor

@floralan floralan commented Nov 29, 2023

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/222

What 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.

@floralan floralan self-assigned this Nov 30, 2023
@floralan floralan marked this pull request as ready for review November 30, 2023 21:18
@floralan floralan requested a review from a team as a code owner November 30, 2023 21:18
@gbockus-sf gbockus-sf changed the title chore: core API to access the sfdx project namespace chore: core API to access the sfdx project namespace. Nov 30, 2023
Copy link
Member

@mingxuanzhangsfdx mingxuanzhangsfdx left a 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.

@floralan floralan merged commit 1ac6bda into develop Dec 5, 2023
13 checks passed
@floralan floralan deleted the fl/W-14559660-sfdx-namespace branch December 5, 2023 19:27
@daphne-sfdc daphne-sfdc restored the fl/W-14559660-sfdx-namespace branch December 5, 2023 19:39
public async getSfdxNamespace(): Promise<string | undefined> {
const namespace = await SfdxProjectConfig.getValue('namespace');
return typeof namespace === 'string' ? namespace : undefined;
}
Copy link
Contributor

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

Thoughts?

Copy link
Contributor Author

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.

Copy link
Contributor

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 👍

@daphne-sfdc daphne-sfdc deleted the fl/W-14559660-sfdx-namespace branch January 7, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants