Skip to content

Commit 76dd1cd

Browse files
committed
Wrap generated ASCII trees in markdown code blocks for commit details and prompts
- the ascii tree in commit message should be wrapped in markdown code block ``` ├── apps │ └── editor │ ├── package.json │ └── src │ ├── commands │ │ ├── copy-merge-commit-details-command.ts │ │ ├── copy-paths-command.ts │ │ ├── generate-commit-message-commands │ │ │ ├── actions │ │ │ │ ├── get-prompt-data.ts │ │ │ │ └── run-generate-action.ts │ │ │ ├── generate-commit-message-commands.ts │ │ │ ├── index.ts │ │ │ └── utils │ │ │ ├── build-commit-message-prompt.ts │ │ │ ├── generate-commit-message-with-api.ts │ │ │ ├── get-commit-message-config.ts │ │ │ └── strip-wrapping-quotes.ts │ │ └── select-files-of-commit-command.ts │ ├── constants │ │ └── state-keys.ts │ ├── i18n │ │ └── translations │ │ └── commands │ │ ├── copy-paths-command.ts │ │ └── generate-commit-message-command.ts │ ├── utils │ │ ├── ascii-tree │ │ │ ├── ascii-tree.ts │ │ │ └── index.ts │ │ └── extract-paths-from-text │ │ ├── extract-paths-from-text.spec.ts │ │ └── extract-paths-from-text.ts │ └── views │ ├── prompt │ │ └── backend │ │ ├── message-handlers │ │ │ └── handle-hash-sign-quick-pick │ │ │ └── symbols │ │ │ └── commit-symbol.ts │ │ └── utils │ │ └── symbols │ │ └── git │ │ └── replace-git-symbols.ts │ └── settings │ ├── backend │ │ ├── message-handlers │ │ │ ├── handle-get-attach-ascii-tree-of-context.ts │ │ │ ├── handle-update-attach-ascii-tree-of-context.ts │ │ │ └── index.ts │ │ └── settings-view-provider.ts │ ├── frontend │ │ ├── Home │ │ │ ├── Home.tsx │ │ │ └── sections │ │ │ └── GeneralSection.tsx │ │ ├── Settings.tsx │ │ ├── hooks │ │ │ └── use-settings.ts │ │ └── i18n │ │ └── translations │ │ └── general.ts │ └── types │ └── messages.ts └── packages └── ui └── src └── components └── editor └── prompt ├── AsciiArtEffect │ ├── AsciiArtEffect.module.scss │ ├── AsciiArtEffect.tsx │ └── index.ts └── TargetButton ├── TargetButton.module.scss └── TargetButton.tsx ```
1 parent 1de214a commit 76dd1cd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/editor/src/commands/copy-merge-commit-details-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export const copy_merge_commit_details_command = (): vscode.Disposable => {
156156
const extracted_paths = AsciiTree.extract_paths(log_output)
157157
let tree_text = ''
158158
if (extracted_paths.length > 0) {
159-
tree_text = AsciiTree.generate(extracted_paths)
159+
tree_text = '```\n' + AsciiTree.generate(extracted_paths) + '\n```'
160160
}
161161

162162
const final_text = `${final_bullets}${tree_text ? '\n\n' + tree_text : ''}`

‎apps/editor/src/commands/generate-commit-message-commands/actions/run-generate-action.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ export const run_generate_action = async (params: {
669669
const display_paths = selected_files_to_attach.map((p) =>
670670
normalize_path(vscode.workspace.asRelativePath(p))
671671
)
672-
return '\n\n' + AsciiTree.generate(display_paths)
672+
return '\n\n```\n' + AsciiTree.generate(display_paths) + '\n```'
673673
}
674674

675675
return ''

0 commit comments

Comments
 (0)