Skip to content

Commit b2f28a4

Browse files
committed
Refactor the clipboard parser structure by moving individual parsers and their associated test cases into dedicated subdirectories
- place the file in a folder of the same name - move `apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/completions` to `apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/test` - fix paths - place `apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/relevant-files-parser.ts` in a folder of the same name. Move tests there.
1 parent be2c7cc commit b2f28a4

143 files changed

Lines changed: 18 additions & 7 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.

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser.ts renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/code-at-cursor-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
CodeAtCursorItem,
44
TextItem,
55
extract_workspace_and_path
6-
} from '../clipboard-parser'
6+
} from '../../clipboard-parser'
77

88
const extract_path_and_position = (
99
line: string
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './code-at-cursor-parser'

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/completions/code-completion-with-text/1-text.txt renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/test/cases/code-completion-with-text/1-text.txt

File renamed without changes.

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/completions/code-completion-with-text/2-file.txt renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/test/cases/code-completion-with-text/2-file.txt

File renamed without changes.

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/completions/code-completion-with-text/3-text.txt renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/test/cases/code-completion-with-text/3-text.txt

File renamed without changes.

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/completions/code-completion-with-text/code-completion-with-text.txt renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/test/cases/code-completion-with-text/code-completion-with-text.txt

File renamed without changes.

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/completions/code-completion/1-file.txt renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/test/cases/code-completion/1-file.txt

File renamed without changes.

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/completions/code-completion/code-completion.txt renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/test/cases/code-completion/code-completion.txt

File renamed without changes.

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/completions/completions.spec.ts renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/code-at-cursor-parser/test/code-at-cursor-parser.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { parse_response } from '../../clipboard-parser'
1+
import { parse_response } from '../../..'
22
import * as fs from 'fs'
33
import * as path from 'path'
44

55
describe('clipboard-parser', () => {
66
const load_test_case_file = (test_case: string, filename: string): string => {
7-
return fs.readFileSync(path.join(__dirname, test_case, filename), 'utf-8')
7+
return fs.readFileSync(
8+
path.join(__dirname, 'cases', test_case, filename),
9+
'utf-8'
10+
)
811
}
912

1013
describe('parse_response', () => {

apps/editor/src/commands/apply-response-command/utils/clipboard-parser/test-cases/standard/backslash-paths/1-file.txt renamed to apps/editor/src/commands/apply-response-command/utils/clipboard-parser/parsers/multiple-files-parser/test/cases/backslash-paths/1-file.txt

File renamed without changes.

0 commit comments

Comments
 (0)