Skip to content

Commit abb14f6

Browse files
committed
Simplify multiple files parser by removing XML and comment-based filename support
- simplify parser by not parsing xml - simplify by not handling paths inside code blocks - simplify by removing support for html-comment-style, html-comment-filename-outside-code-block - - simplify by removing support for path in markdown argument - simplify by removing support for path in multi line comment - simplify by removing support for markdown backticks file path in one line - simplify by removing support for 'language and path' - simplify by removing support for 'filename comment and backticks on same line' - simplify by removing support for 'file content only' └── apps └── editor └── src └── commands └── apply-response-command └── utils └── response-parser ├── parsers │ └── multiple-files-parser │ ├── helpers │ │ ├── index.ts │ │ ├── item-management.ts │ │ ├── path-utils.ts │ │ └── text-processing.ts │ ├── index.ts │ ├── multiple-files-parser.ts │ └── test │ ├── cases │ │ ├── backslash-paths │ │ │ ├── 1-file.txt │ │ │ ├── 2-file.txt │ │ │ └── backslash-paths.txt │ │ ├── comment-filename │ │ │ ├── 1-file.txt │ │ │ ├── 2-file.txt │ │ │ └── comment-filename.txt │ │ ├── conflict-with-inline-file │ │ │ ├── 1-file.txt │ │ │ ├── 2-conflict-with-inline-file.txt │ │ │ └── conflict-with-inline-file.txt │ │ ├── curly-on-same-line-as-closing-backticks │ │ │ ├── 1-file.txt │ │ │ ├── 2-file.txt │ │ │ └── curly-on-same-line-as-closing-backticks.txt │ │ ├── delete-file-header │ │ │ ├── 1-text.txt │ │ │ ├── 2-file.txt │ │ │ ├── 3-text.txt │ │ │ └── delete-file-header.txt │ │ ├── duplicate-files │ │ │ ├── 1-file.txt │ │ │ └── duplicate-files.txt │ │ ├── empty-file │ │ │ ├── 1-file.txt │ │ │ ├── 2-file.txt │ │ │ └── empty-file.txt │ │ ├── file-content-only │ │ │ ├── 1-file.txt │ │ │ └── file-content-only.txt │ │ ├── filename-comment-and-backticks-on-same-line │ │ │ ├── 1-file.txt │ │ │ └── filename-comment-and-backticks-on-same-line.txt │ │ ├── html-comment-filename-outside-code-block │ │ │ ├── 1-file.txt │ │ │ ├── 2-file.txt │ │ │ └── html-comment-filename-outside-code-block.txt │ │ ├── html-comment-in-markdown-heading │ │ │ ├── 1-file.txt │ │ │ └── html-comment-in-markdown-heading.txt │ │ ├── html-comment-style │ │ │ ├── 1-file.txt │ │ │ └── html-comment-style.txt │ │ ├── inner-backticks │ │ │ ├── 1-file.txt │ │ │ └── inner-backticks.txt │ │ ├── inner-backticks-raw │ │ │ ├── 1-file.txt │ │ │ └── inner-backticks-raw.txt │ │ ├── language-and-path │ │ │ ├── 1-file.txt │ │ │ └── language-and-path.txt │ │ ├── markdown-backticks-file-path-in-one-line │ │ │ ├── 1-file.txt │ │ │ └── markdown-backticks-file-path-in-one-line.txt │ │ ├── markdown-code-block-with-code │ │ │ ├── 1-file.txt │ │ │ └── markdown-code-block-with-code.txt │ │ ├── markdown-inside-markdown │ │ │ ├── 1-file.txt │ │ │ └── markdown-inside-markdown.txt │ │ ├── markdown-with-nested-code-block │ │ │ ├── 1-file.txt │ │ │ └── markdown-with-nested-code-block.txt │ │ ├── markdown-wrappers │ │ │ ├── 1-file.txt │ │ │ ├── 2-file.txt │ │ │ └── markdown-wrappers.txt │ │ ├── merge-conflicts-in-separate-code-blocks │ │ │ ├── 1-file.txt │ │ │ └── merge-conflicts-in-separate-code-blocks.txt │ │ ├── merge-conflicts-merge-the-same-file │ │ │ ├── 1-text.txt │ │ │ ├── 2-file.txt │ │ │ └── merge-conflicts-merge-the-same-file.txt │ │ ├── merge-conflicts-three-dots │ │ │ ├── 1-file.txt │ │ │ └── merge-conflicts-three-dots.txt │ │ ├── multiple-markdowns-with-headings │ │ │ ├── 1-file.txt │ │ │ ├── 2-file.txt │ │ │ └── multiple-markdowns-with-headings.txt │ │ ├── path-above-code-block │ │ │ ├── 1-text.txt │ │ │ ├── 2-file.txt │ │ │ └── path-above-code-block.txt │ │ ├── path-above-code-block-bold │ │ │ ├── 1-file.txt │ │ │ └── path-above-code-block-bold.txt │ │ ├── path-above-code-block-enclosed-in-code-block │ │ │ ├── 1-text.txt │ │ │ ├── 2-file.txt │ │ │ └── path-above-code-block-enclosed-in-code-block.txt │ │ ├── path-above-code-block-enclosed-in-code-block-2 │ │ │ ├── 1-text.txt │ │ │ ├── 2-file.txt │ │ │ └── path-above-code-block-enclosed-in-code-block-2.txt │ │ ├── path-above-code-block-raw │ │ │ ├── 1-file.txt │ │ │ └── path-above-code-block-raw.txt │ │ ├── path-above-code-block-renaming │ │ │ ├── 1-file.txt │ │ │ └── path-above-code-block-renaming.txt │ │ ├── path-duplicated-in-empty-code-block │ │ │ ├── 1-file.txt │ │ │ ├── 2-text.txt │ │ │ └── path-duplicated-in-empty-code-block.txt │ │ ├── path-in-backticks-comment-with-intermediate-text │ │ │ ├── 1-text.txt │ │ │ ├── 2-file.txt │ │ │ └── path-in-backticks-comment-with-intermediate-text.txt │ │ ├── path-in-backticks-no-intermediate-empty-lines │ │ │ ├── 1-file.txt │ │ │ └── path-in-backticks-no-intermediate-empty-lines.txt │ │ ├── path-in-markdown-argument │ │ │ ├── 1-file.txt │ │ │ └── path-in-markdown-argument.txt │ │ ├── path-in-multi-line-comment │ │ │ ├── 1-file.txt │ │ │ └── path-in-multi-line-comment.txt │ │ ├── php-opening-tag │ │ │ ├── 1-file.txt │ │ │ └── php-opening-tag.txt │ │ ├── text-below-code-block │ │ │ ├── 1-file.txt │ │ │ ├── 2-text.txt │ │ │ └── text-below-code-block.txt │ │ ├── text-between │ │ │ ├── 1-text.txt │ │ │ ├── 10-inline-file.txt │ │ │ ├── 11-text.txt │ │ │ ├── 2-inline-file.txt │ │ │ ├── 3-text.txt │ │ │ ├── 4-file.txt │ │ │ ├── 5-text.txt │ │ │ ├── 6-inline-file.txt │ │ │ ├── 7-text.txt │ │ │ ├── 8-file.txt │ │ │ ├── 9-text.txt │ │ │ └── text-between.txt │ │ ├── unclosed-markdown-wrapper │ │ │ ├── 1-file.txt │ │ │ ├── 2-file.txt │ │ │ └── unclosed-markdown-wrapper.txt │ │ ├── uncommented-filename │ │ │ ├── 1-file.txt │ │ │ └── uncommented-filename.txt │ │ └── with-workspace-prefix │ │ ├── 1-file.txt │ │ └── with-workspace-prefix.txt │ └── multiple-files-parser.spec.ts └── response-parser.ts
1 parent 203f754 commit abb14f6

99 files changed

Lines changed: 25 additions & 1465 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export * from './xml-utils'
21
export * from './path-utils'
32
export * from './text-processing'
43
export * from './item-management'

‎apps/editor/src/commands/apply-response-command/utils/response-parser/parsers/multiple-files-parser/helpers/text-processing.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
export const strip_markdown_code_block = (content: string): string => {
2-
const trimmed = content.trim()
3-
const lines = trimmed.split('\n')
4-
5-
if (
6-
lines.length >= 2 &&
7-
lines[0].trim().startsWith('```') &&
8-
lines[lines.length - 1].trim() == '```'
9-
) {
10-
return lines.slice(1, -1).join('\n')
11-
}
12-
13-
return trimmed
14-
}
15-
161
export const process_conflict_markers = (content: string): string => {
172
const lines = content.split('\n')
183
const result_lines: string[] = []

‎apps/editor/src/commands/apply-response-command/utils/response-parser/parsers/multiple-files-parser/helpers/xml-utils.ts‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)