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

NEW (Extension) @W-15639759@ Introduce a new command to run graph engine at the project level #100

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

jag-j
Copy link
Collaborator

@jag-j jag-j commented Jul 3, 2024

No description provided.

@@ -162,6 +166,10 @@
"command": "sfca.runDfaOnSelectedMethod",
"when": "false"
},
{
"command": "sfca.runDfa",
"when": "false"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm setting this as false so the new command will not show up until Delta run is fully complete. To test this locally, you'll have to change this to true.

src/extension.ts Outdated
return;
});

const projectDir: string[] = vscode.workspace.workspaceFolders?.map(folder => folder.uri.path);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

workspaceRoot is now deprecated and this seems to be the way to get the project directory's root. I couldn't get much info on this from the docs, but I have tested this and it works as expected.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we move this logic inside of targeting.getProjectDir() and make currentFile an optional input argument?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's good idea. Done.

src/extension.ts Outdated
TelemetryService.sendExtensionActivationEvent(extensionHrStart);
outputChannel.appendLine(`Extension sfdx-code-analyzer-vscode activated.`);
return Promise.resolve(context);
}

async function _runDfa(context: vscode.ExtensionContext, outputChannel: vscode.LogOutputChannel) {
const choice = await vscode.window.showQuickPick(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this prompt show up every time - even when you haven't ran before? Ideally it should only show up when we have ran already with violations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As discussed in the standup, took care of this to show only when cache exists.

src/extension.ts Outdated

const projectDir: string[] = vscode.workspace.workspaceFolders?.map(folder => folder.uri.path);
if (projectDir.length === 0) {
void vscode.window.showWarningMessage('***No project directory could be identified. Not proceeding with DFA run.***');
Copy link
Collaborator

Choose a reason for hiding this comment

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

When is this possible? Is it when someone opens up vscode for a file and then closes the file or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This happens when you haven't opened up any project and still try to run SFCA commands. This is something we should fix at a later point. For example, some of the other extensions make sure a sfdx project is loaded before showing their commands.

src/extension.ts Outdated
return;
});

const projectDir: string[] = vscode.workspace.workspaceFolders?.map(folder => folder.uri.path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we move this logic inside of targeting.getProjectDir() and make currentFile an optional input argument?

@jag-j jag-j merged commit 88f8033 into dev Jul 8, 2024
7 checks passed
@jag-j jag-j deleted the jj/W-15639759 branch July 8, 2024 21:32
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.

3 participants