Repository navigation
Commit 053c43c
committed
Add support for parsing new files based on empty files in diff parser
- add text case for 'new file based on empty file'
- use '==' or '!=' instead of '===' or '!==' when comparing to string and applicable
└── apps
└── editor
└── src
└── commands
└── apply-response-command
└── utils
└── response-parser
└── parsers
└── diff-parser
├── diff-parser.ts
├── helpers
│ ├── block-utils.ts
│ ├── index.ts
│ ├── patch-utils.ts
│ └── path-utils.ts
├── index.ts
└── test
├── cases
│ ├── deletion-via-header
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── deletion-via-header.txt
│ ├── deletion-via-redundant-header
│ │ ├── 1-file.txt
│ │ └── deletion-via-redundant-header.txt
│ ├── file-deletion
│ │ ├── 1-file.txt
│ │ └── file-deletion.txt
│ ├── git-and-hunk-header-same-line
│ │ ├── 1-file.txt
│ │ └── git-and-hunk-header-same-line.txt
│ ├── git-broken-hunk-header
│ │ ├── 1-file.txt
│ │ └── git-broken-hunk-header.txt
│ ├── git-two-header-types
│ │ ├── 1-file.txt
│ │ └── git-two-header-types.txt
│ ├── ignore-ellipsis
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── ignore-ellipsis.txt
│ ├── inner-backticks
│ │ ├── 1-file.txt
│ │ └── inner-backticks.txt
│ ├── inner-triple-backticks
│ │ ├── 1-file.txt
│ │ └── inner-triple-backticks.txt
│ ├── markdown-missing-ending
│ │ ├── 1-file.txt
│ │ └── markdown-missing-ending.txt
│ ├── markdown-path-above
│ │ ├── 1-file.txt
│ │ └── markdown-path-above.txt
│ ├── markdown-path-above-no-hunk-header
│ │ ├── 1-file.txt
│ │ └── markdown-path-above-no-hunk-header.txt
│ ├── markdown-path-above-with-text-containing-path
│ │ ├── 1-text.txt
│ │ ├── 2-file.txt
│ │ └── markdown-path-above-with-text-containing-path.txt
│ ├── markdown-redundant-closing-backticks
│ │ ├── 1-file.txt
│ │ └── markdown-redundant-closing-backticks.txt
│ ├── markdown-repeated-path-above
│ │ ├── 1-text.txt
│ │ ├── 2-file.txt
│ │ └── markdown-repeated-path-above.txt
│ ├── markdown-unnecessary-empty-lines
│ │ ├── 1-file.txt
│ │ └── markdown-path-above.txt
│ ├── mix-delete-and-new-file
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── mix-delete-and-new-file.txt
│ ├── mix-new-file-from-heading-and-diff
│ │ ├── 1-text.txt
│ │ ├── 2-file.txt
│ │ ├── 3-file.txt
│ │ └── mix-new-file-from-heading-and-diff.txt
│ ├── mix-new-file-from-xml-tag-heading-and-diff
│ │ ├── 1-text.txt
│ │ ├── 2-file.txt
│ │ ├── 3-file.txt
│ │ └── mix-new-file-from-xml-tag-heading-and-diff.txt
│ ├── mix-new-file-xml-and-diff-variant-1
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── mix-new-file-xml-and-diff-variant-1.txt
│ ├── mix-new-file-xml-and-diff-variant-2
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── mix-new-file-xml-and-diff-variant-2.txt
│ ├── mix-rename-and-update
│ │ ├── 1-file.txt
│ │ └── mix-rename-and-update.txt
│ ├── mix-rename-one-liner-and-diff
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── mix-rename-one-liner-and-diff.txt
│ ├── multiple-edits-for-the-same-file
│ │ ├── 1-text.txt
│ │ ├── 2-file.txt
│ │ └── multiple-edits-for-the-same-file.txt
│ ├── multiple-files-git-and-hunk-header-same-line
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-git-and-hunk-header-same-line.txt
│ ├── multiple-files-no-markdown-block
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-no-markdown-block.txt
│ ├── multiple-files-no-prefix-single-markdown-block
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-no-prefix-single-markdown-block.txt
│ ├── multiple-files-same-line-backticks
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-same-line-backticks.txt
│ ├── multiple-files-separate-markdown-blocks
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-separate-markdown-blocks.txt
│ ├── multiple-files-single-markdown-block
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-single-markdown-block.txt
│ ├── multiple-files-text-between
│ │ ├── 1-text.txt
│ │ ├── 2-file.txt
│ │ ├── 3-text.txt
│ │ ├── 4-file.txt
│ │ ├── 5-text.txt
│ │ └── multiple-files-text-between.txt
│ ├── multiple-files-with-git-headers-no-file-lines
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-with-git-headers-no-file-lines.txt
│ ├── multiple-files-with-git-headers-separate-markdown-blocks
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-with-git-headers-separate-markdown-blocks.txt
│ ├── multiple-files-with-quoted-paths
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-with-quoted-paths.txt
│ ├── multiple-files-with-timestamps
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-files-with-timestamps.txt
│ ├── multiple-new-files-separate-markdown-blocks
│ │ ├── 1-file.txt
│ │ ├── 2-file.txt
│ │ └── multiple-new-files-separate-markdown-blocks.txt
│ ├── new-file-based-on-empty-file
│ │ ├── 1-file.txt
│ │ └── new-file-based-on-empty-file.txt
│ ├── new-file-with-git-header
│ │ ├── 1-file.txt
│ │ └── new-file-with-git-header.txt
│ ├── no-markdown-or-git-header
│ │ ├── 1-file.txt
│ │ └── no-markdown-or-git-header.txt
│ ├── no-prefix
│ │ ├── 1-file.txt
│ │ └── no-prefix.txt
│ ├── non-diff-code-blocks
│ │ ├── 1-text.txt
│ │ ├── 2-inline-file.txt
│ │ ├── 3-file.txt
│ │ └── non-diff-code-blocks.txt
│ ├── rename
│ │ ├── 1-file.txt
│ │ └── rename.txt
│ ├── with-empty-lines-between
│ │ ├── 1-file.txt
│ │ └── with-empty-lines-between.txt
│ ├── with-git-header-no-file-lines
│ │ ├── 1-file.txt
│ │ └── with-git-header-no-file-lines.txt
│ ├── with-git-header-no-markdown
│ │ ├── 1-file.txt
│ │ └── with-git-header-no-markdown.txt
│ ├── with-quoted-paths
│ │ ├── 1-file.txt
│ │ └── with-quoted-paths.txt
│ ├── with-timestamps
│ │ ├── 1-file.txt
│ │ └── with-timestamps.txt
│ ├── with-xml-file-path
│ │ ├── 1-file.txt
│ │ └── with-xml-file-path.txt
│ ├── within-xml-tags
│ │ ├── 1-file.txt
│ │ └── within-xml-tags.txt
│ ├── within-xml-tags-unquoted-path
│ │ ├── 1-file.txt
│ │ └── within-xml-tags-unquoted-path.txt
│ └── within-xml-tags-with-cdata
│ ├── 1-file.txt
│ └── within-xml-tags-with-cdata.txt
└── diff-parser.spec.ts1 parent 8438973 commit 053c43c
5 files changed
Lines changed: 56 additions & 7 deletions
File tree
- apps/editor/src/commands/apply-response-command/utils/response-parser/parsers/diff-parser
- test
- cases/new-file-based-on-empty-file
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
708 | | - | |
| 708 | + | |
709 | 709 | | |
710 | 710 | | |
711 | 711 | | |
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
820 | 835 | | |
821 | | - | |
822 | | - | |
823 | | - | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
824 | 847 | | |
825 | 848 | | |
826 | 849 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
948 | 964 | | |
0 commit comments