Skip to content

Commit 1ed4973

Browse files
committed
Add selectClipboardPaths command to allow file selection using paths found in the clipboard
- add three dots after 'Save file selection' and 'restore file selection' (including translations) - these commands should not be hidden from the command palette - here, [Fragment], should not get selected fiels, but all workspace files - create another util, palce it in `apps/editor/src/context/utils` - move `apps/editor/src/context/get-selected-files.ts` to `apps/editor/src/context/utils` - move `apps/editor/src/context/utils/get-all-workspace-files.ts` and `apps/editor/src/context/utils/get-selected-files.ts` to `apps/editor/src/context/helpers` - create a command 'select clipboard paths', it's purpose is to let user select files found in clipboard text. Prefer code duplication of the parsing logic. Place above 'select changed files' - implement `apps/editor/src/commands/select-clipboard-paths-command.ts` - it works similarly to 'apply response > relevant files', meaning it finds existing in the workspace paths (`apps/editor/src/context/helpers/get-all-workspace-files.ts`) and lets user select them. - add missing translations - extract common parsing logic to `apps/editor/src/utils` - place `apps/editor/src/utils/extract-paths-from-text.ts` in a folder of the same name, add index.ts - `apps/editor/src/utils/extract-paths-from-text/extract-paths-from-text.ts` should have tests (copy ones from 'response parser')
1 parent 2258d1c commit 1ed4973

33 files changed

Lines changed: 671 additions & 151 deletions

‎apps/editor/package.json‎

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@
385385
"title": "%codeWebChat.selectCommitFiles.title%",
386386
"category": "Code Web Chat"
387387
},
388+
{
389+
"command": "codeWebChat.selectClipboardPaths",
390+
"title": "%codeWebChat.selectClipboardPaths.title%",
391+
"category": "Code Web Chat"
392+
},
388393
{
389394
"command": "codeWebChat.selectChangedFiles",
390395
"title": "%codeWebChat.selectChangedFiles.title%",
@@ -431,14 +436,6 @@
431436
}
432437
],
433438
"commandPalette": [
434-
{
435-
"command": "codeWebChat.copyPaths",
436-
"when": "false"
437-
},
438-
{
439-
"command": "codeWebChat.copyPathsOpenEditors",
440-
"when": "false"
441-
},
442439
{
443440
"command": "codeWebChat.undoSelection",
444441
"when": "false"
@@ -523,10 +520,6 @@
523520
"command": "codeWebChat.followOnX",
524521
"when": "false"
525522
},
526-
{
527-
"command": "codeWebChat.duplicateWorkspace",
528-
"when": "false"
529-
},
530523
{
531524
"command": "codeWebChat.settings",
532525
"when": "false"
@@ -578,18 +571,6 @@
578571
{
579572
"command": "codeWebChat.openWebsitePreviewUrl",
580573
"when": "codeWebChat.websitePreviewActive"
581-
},
582-
{
583-
"command": "codeWebChat.selectUnstagedFiles",
584-
"when": "false"
585-
},
586-
{
587-
"command": "codeWebChat.selectChangedFiles",
588-
"when": "false"
589-
},
590-
{
591-
"command": "codeWebChat.selectCommitFiles",
592-
"when": "false"
593574
}
594575
],
595576
"view/title": [
@@ -674,10 +655,15 @@
674655
"group": "3_more@2"
675656
},
676657
{
677-
"command": "codeWebChat.selectChangedFiles",
658+
"command": "codeWebChat.selectClipboardPaths",
678659
"when": "view == codeWebChatViewWorkspace",
679660
"group": "3_more@3"
680661
},
662+
{
663+
"command": "codeWebChat.selectChangedFiles",
664+
"when": "view == codeWebChatViewWorkspace",
665+
"group": "3_more@4"
666+
},
681667
{
682668
"command": "codeWebChat.duplicateWorkspace",
683669
"when": "view == codeWebChatViewWorkspace",

‎apps/editor/package.nls.bg.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "Запазване на избора на файлове",
3-
"codeWebChat.restoreFileSelection.title": "Възстановяване на избора на файлове",
2+
"codeWebChat.saveFileSelection.title": "Запазване на избора на файлове...",
3+
"codeWebChat.restoreFileSelection.title": "Възстановяване на избора на файлове...",
44
"codeWebChat.applyResponse.title": "Приложи отговор от чата",
55
"codeWebChat.copyMarkdown.title": "Копирай Markdown",
66
"codeWebChat.history.title": "История",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "Отвори във вградения терминал",
5151
"codeWebChat.removeFolderFromWorkspace.title": "Премахни папката от работното пространство",
5252
"codeWebChat.openWebsitePreviewUrl.title": "Отвори URL в браузъра",
53-
"codeWebChat.selectUnstagedFiles.title": "Маркирай променените файлове",
53+
"codeWebChat.selectUnstagedFiles.title": "Маркирай променените файлове...",
5454
"codeWebChat.selectCommitFiles.title": "Маркирай файлове от commit...",
55+
"codeWebChat.selectClipboardPaths.title": "Маркирай пътищата от клипборда...",
5556
"codeWebChat.selectChangedFiles.title": "Избери променени файлове..."
5657
}

‎apps/editor/package.nls.cs.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "Uložit výběr souborů",
3-
"codeWebChat.restoreFileSelection.title": "Obnovit výběr souborů",
2+
"codeWebChat.saveFileSelection.title": "Uložit výběr souborů...",
3+
"codeWebChat.restoreFileSelection.title": "Obnovit výběr souborů...",
44
"codeWebChat.applyResponse.title": "Použít odpověď chatu",
55
"codeWebChat.copyMarkdown.title": "Kopírovat Markdown",
66
"codeWebChat.history.title": "Historie",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "Otevřít v integrovaném terminálu",
5151
"codeWebChat.removeFolderFromWorkspace.title": "Odebrat složku z pracovního prostoru",
5252
"codeWebChat.openWebsitePreviewUrl.title": "Otevřít URL v prohlížeči",
53-
"codeWebChat.selectUnstagedFiles.title": "Vybrat upravené soubory",
53+
"codeWebChat.selectUnstagedFiles.title": "Vybrat upravené soubory...",
5454
"codeWebChat.selectCommitFiles.title": "Vybrat soubory z commitu...",
55+
"codeWebChat.selectClipboardPaths.title": "Vybrat cesty ze schránky...",
5556
"codeWebChat.selectChangedFiles.title": "Vybrat změněné soubory..."
5657
}

‎apps/editor/package.nls.de.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "Dateiauswahl speichern",
3-
"codeWebChat.restoreFileSelection.title": "Dateiauswahl wiederherstellen",
2+
"codeWebChat.saveFileSelection.title": "Dateiauswahl speichern...",
3+
"codeWebChat.restoreFileSelection.title": "Dateiauswahl wiederherstellen...",
44
"codeWebChat.applyResponse.title": "Chat-Antwort anwenden",
55
"codeWebChat.copyMarkdown.title": "Markdown kopieren",
66
"codeWebChat.history.title": "Verlauf",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "In integriertem Terminal öffnen",
5151
"codeWebChat.removeFolderFromWorkspace.title": "Ordner aus Arbeitsbereich entfernen",
5252
"codeWebChat.openWebsitePreviewUrl.title": "URL im Browser öffnen",
53-
"codeWebChat.selectUnstagedFiles.title": "Geänderte Dateien auswählen",
53+
"codeWebChat.selectUnstagedFiles.title": "Geänderte Dateien auswählen...",
5454
"codeWebChat.selectCommitFiles.title": "Dateien aus Commit auswählen...",
55+
"codeWebChat.selectClipboardPaths.title": "Zwischenablage-Pfade auswählen...",
5556
"codeWebChat.selectChangedFiles.title": "Geänderte Dateien auswählen..."
5657
}

‎apps/editor/package.nls.es.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "Guardar selección de archivos",
3-
"codeWebChat.restoreFileSelection.title": "Restaurar selección de archivos",
2+
"codeWebChat.saveFileSelection.title": "Guardar selección de archivos...",
3+
"codeWebChat.restoreFileSelection.title": "Restaurar selección de archivos...",
44
"codeWebChat.applyResponse.title": "Aplicar respuesta del chat",
55
"codeWebChat.copyMarkdown.title": "Copiar Markdown",
66
"codeWebChat.history.title": "Historial",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "Abrir en terminal integrado",
5151
"codeWebChat.removeFolderFromWorkspace.title": "Eliminar carpeta del espacio de trabajo",
5252
"codeWebChat.openWebsitePreviewUrl.title": "Abrir URL en el navegador",
53-
"codeWebChat.selectUnstagedFiles.title": "Marcar archivos modificados",
53+
"codeWebChat.selectUnstagedFiles.title": "Marcar archivos modificados...",
5454
"codeWebChat.selectCommitFiles.title": "Marcar archivos de un commit...",
55+
"codeWebChat.selectClipboardPaths.title": "Seleccionar rutas del portapapeles...",
5556
"codeWebChat.selectChangedFiles.title": "Seleccionar archivos cambiados..."
5657
}

‎apps/editor/package.nls.fr.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "Enregistrer la sélection de fichiers",
3-
"codeWebChat.restoreFileSelection.title": "Restaurer la sélection de fichiers",
2+
"codeWebChat.saveFileSelection.title": "Enregistrer la sélection de fichiers...",
3+
"codeWebChat.restoreFileSelection.title": "Restaurer la sélection de fichiers...",
44
"codeWebChat.applyResponse.title": "Appliquer la réponse du chat",
55
"codeWebChat.copyMarkdown.title": "Copier le Markdown",
66
"codeWebChat.history.title": "Historique",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "Ouvrir dans le terminal intégré",
5151
"codeWebChat.removeFolderFromWorkspace.title": "Retirer le dossier de l'espace de travail",
5252
"codeWebChat.openWebsitePreviewUrl.title": "Ouvrir l'URL dans le navigateur",
53-
"codeWebChat.selectUnstagedFiles.title": "Cocher les fichiers modifiés",
53+
"codeWebChat.selectUnstagedFiles.title": "Cocher les fichiers modifiés...",
5454
"codeWebChat.selectCommitFiles.title": "Cocher les fichiers d'un commit...",
55+
"codeWebChat.selectClipboardPaths.title": "Sélectionner les chemins du presse-papiers...",
5556
"codeWebChat.selectChangedFiles.title": "Sélectionner les fichiers modifiés..."
5657
}

‎apps/editor/package.nls.hu.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "Fájlkiválasztás mentése",
3-
"codeWebChat.restoreFileSelection.title": "Fájlkiválasztás visszaállítása",
2+
"codeWebChat.saveFileSelection.title": "Fájlkiválasztás mentése...",
3+
"codeWebChat.restoreFileSelection.title": "Fájlkiválasztás visszaállítása...",
44
"codeWebChat.applyResponse.title": "Csevegési válasz alkalmazása",
55
"codeWebChat.copyMarkdown.title": "Markdown másolása",
66
"codeWebChat.history.title": "Előzmények",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "Megnyitás az integrált terminálban",
5151
"codeWebChat.removeFolderFromWorkspace.title": "Mappa eltávolítása a munkaterületről",
5252
"codeWebChat.openWebsitePreviewUrl.title": "URL megnyitása a böngészőben",
53-
"codeWebChat.selectUnstagedFiles.title": "Módosított fájlok kijelölése",
53+
"codeWebChat.selectUnstagedFiles.title": "Módosított fájlok kijelölése...",
5454
"codeWebChat.selectCommitFiles.title": "Commit fájljainak kijelölése...",
55+
"codeWebChat.selectClipboardPaths.title": "Vágólap útvonalainak kijelölése...",
5556
"codeWebChat.selectChangedFiles.title": "Módosított fájlok kiválasztása..."
5657
}

‎apps/editor/package.nls.it.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "Salva selezione file",
3-
"codeWebChat.restoreFileSelection.title": "Ripristina selezione file",
2+
"codeWebChat.saveFileSelection.title": "Salva selezione file...",
3+
"codeWebChat.restoreFileSelection.title": "Ripristina selezione file...",
44
"codeWebChat.applyResponse.title": "Applica risposta chat",
55
"codeWebChat.copyMarkdown.title": "Copia Markdown",
66
"codeWebChat.history.title": "Cronologia",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "Apri nel terminale integrato",
5151
"codeWebChat.removeFolderFromWorkspace.title": "Rimuovi cartella dall'area di lavoro",
5252
"codeWebChat.openWebsitePreviewUrl.title": "Apri URL nel browser",
53-
"codeWebChat.selectUnstagedFiles.title": "Seleziona file modificati",
53+
"codeWebChat.selectUnstagedFiles.title": "Seleziona file modificati...",
5454
"codeWebChat.selectCommitFiles.title": "Seleziona i file da un commit...",
55+
"codeWebChat.selectClipboardPaths.title": "Seleziona percorsi dagli appunti...",
5556
"codeWebChat.selectChangedFiles.title": "Seleziona i file modificati..."
5657
}

‎apps/editor/package.nls.ja.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "ファイル選択を保存",
3-
"codeWebChat.restoreFileSelection.title": "ファイル選択を復元",
2+
"codeWebChat.saveFileSelection.title": "ファイル選択を保存...",
3+
"codeWebChat.restoreFileSelection.title": "ファイル選択を復元...",
44
"codeWebChat.applyResponse.title": "チャットの応答を適用",
55
"codeWebChat.copyMarkdown.title": "Markdownをコピー",
66
"codeWebChat.history.title": "履歴",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "統合ターミナルで開く",
5151
"codeWebChat.removeFolderFromWorkspace.title": "ワークスペースからフォルダーを削除",
5252
"codeWebChat.openWebsitePreviewUrl.title": "ブラウザーでURLを開く",
53-
"codeWebChat.selectUnstagedFiles.title": "変更されたファイルを選択",
53+
"codeWebChat.selectUnstagedFiles.title": "変更されたファイルを選択...",
5454
"codeWebChat.selectCommitFiles.title": "コミットからのファイルを選択...",
55+
"codeWebChat.selectClipboardPaths.title": "クリップボードのパスを選択...",
5556
"codeWebChat.selectChangedFiles.title": "変更されたファイルを選択..."
5657
}

‎apps/editor/package.nls.json‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"codeWebChat.saveFileSelection.title": "Save File Selection",
3-
"codeWebChat.restoreFileSelection.title": "Restore File Selection",
2+
"codeWebChat.saveFileSelection.title": "Save File Selection...",
3+
"codeWebChat.restoreFileSelection.title": "Restore File Selection...",
44
"codeWebChat.applyResponse.title": "Apply Chat Response",
55
"codeWebChat.copyMarkdown.title": "Copy Markdown",
66
"codeWebChat.history.title": "History",
@@ -50,7 +50,8 @@
5050
"codeWebChat.openInIntegratedTerminal.title": "Open in Integrated Terminal",
5151
"codeWebChat.removeFolderFromWorkspace.title": "Remove Folder from Workspace",
5252
"codeWebChat.openWebsitePreviewUrl.title": "Open URL in Browser",
53-
"codeWebChat.selectUnstagedFiles.title": "Select Unstaged Files",
53+
"codeWebChat.selectUnstagedFiles.title": "Select Unstaged Files...",
5454
"codeWebChat.selectCommitFiles.title": "Select Files of Commit...",
55+
"codeWebChat.selectClipboardPaths.title": "Select Clipboard Paths...",
5556
"codeWebChat.selectChangedFiles.title": "Select Changed Files..."
5657
}

0 commit comments

Comments
 (0)