Skip to content

Commit

Permalink
refactor: Make ImproveComments methods private and update method sign…
Browse files Browse the repository at this point in the history
…atures
  • Loading branch information
simlarsen committed Sep 4, 2024
1 parent eb4d832 commit 989a082
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Copilot/Service/CopilotActions/ImproveComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class ImproveComments extends CopilotActionBase {
return data;
}

public async didPassValidation(data: CopilotPromptResult): Promise<boolean> {
private async didPassValidation(data: CopilotPromptResult): Promise<boolean> {
const validationResponse: string = data.output as string;
if (validationResponse === "--no--") {
return true;
Expand All @@ -86,7 +86,7 @@ export default class ImproveComments extends CopilotActionBase {
return false;
}

public async isFileAlreadyWellCommented(content: string): Promise<boolean> {
private async isFileAlreadyWellCommented(content: string): Promise<boolean> {
if (content.includes("--all-good--")) {
return true;
}
Expand Down Expand Up @@ -162,7 +162,7 @@ export default class ImproveComments extends CopilotActionBase {
};
}

public async getValidationPrompt(data: {
private async getValidationPrompt(data: {
oldCode: string;
newCode: string;
}): Promise<CopilotActionPrompt> {
Expand Down Expand Up @@ -277,6 +277,7 @@ export default class ImproveComments extends CopilotActionBase {
);

const lastWordOfInputCode: string = Text.getLastWord(data.inputCode);

extractedCode = Text.trimEndUntilThisWord(
extractedCode,
lastWordOfInputCode,
Expand Down

0 comments on commit 989a082

Please sign in to comment.