Skip to content

Commit 52d7afe

Browse files
committed
Remove redundant Set deduplication when formatting prompts in commit messages
- don't deduplicate simplified prompts
1 parent 7ac224c commit 52d7afe

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

apps/editor/src/commands/generate-commit-message-command/generate-commit-message-command.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,10 @@ export const generate_commit_message_command = (
238238
const selected_prompts_text =
239239
include_prompts_setting && selected_prompts.length > 0
240240
? '\n\n' +
241-
[
242-
...new Set(
243-
selected_prompts.map((p) =>
244-
simplify_prompt_symbols({ prompt: p.prompt })
245-
)
241+
selected_prompts
242+
.map(
243+
(p) => `- ${simplify_prompt_symbols({ prompt: p.prompt })}`
246244
)
247-
]
248-
.map((s) => `- ${s}`)
249245
.join('\n')
250246
: ''
251247

@@ -264,14 +260,10 @@ export const generate_commit_message_command = (
264260
const prompts_text =
265261
include_prompts_setting && relevant_prompts.length > 0
266262
? '\n\n' +
267-
[
268-
...new Set(
269-
relevant_prompts.map((p) =>
270-
simplify_prompt_symbols({ prompt: p.prompt })
271-
)
263+
relevant_prompts
264+
.map(
265+
(p) => `- ${simplify_prompt_symbols({ prompt: p.prompt })}`
272266
)
273-
]
274-
.map((s) => `- ${s}`)
275267
.join('\n')
276268
: ''
277269
repository.inputBox.value = commit_message + prompts_text

0 commit comments

Comments
 (0)