Skip to content

Commit a6e79cc

Browse files
committed
Remove clipboard paths prompt symbol
- remove 'clipboard paths' symbol
1 parent a8fdba1 commit a6e79cc

12 files changed

Lines changed: 7 additions & 272 deletions

File tree

‎apps/editor/src/i18n/translations/views/prompt/handlers/hash-sign.ts‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -361,43 +361,6 @@ export const translations = {
361361
hu: 'Fedezz fel képességeket a skills.sh oldalon',
362362
bg: 'Открийте умения на skills.sh'
363363
},
364-
'views.prompt.handlers.hash-sign.quick-pick.clipboard-paths.label': {
365-
en: 'Clipboard paths',
366-
pl: 'Ścieżki ze schowka',
367-
'zh-cn': '剪贴板路径',
368-
ja: 'クリップボードのパス',
369-
'zh-tw': '剪貼板路徑',
370-
de: 'Zwischenablage-Pfade',
371-
es: 'Rutas del portapapeles',
372-
fr: 'Chemins du presse-papiers',
373-
'pt-br': 'Caminhos da área de transferência',
374-
ru: 'Пути из буфера обмена',
375-
ko: '클립보드 경로',
376-
it: 'Percorsi negli appunti',
377-
tr: 'Pano yolları',
378-
cs: 'Cesty ze schránky',
379-
hu: 'Vágólap útvonalak',
380-
bg: 'Пътища от клипборда'
381-
},
382-
'views.prompt.handlers.hash-sign.quick-pick.clipboard-paths.description': {
383-
en: 'Files matching paths found in the clipboard',
384-
pl: 'Pliki pasujące do ścieżek znalezionych w schowku',
385-
'zh-cn': '与在剪贴板中找到的路径匹配的文件',
386-
ja: 'クリップボードに見つかったパスに一致するファイル',
387-
'zh-tw': '與在剪貼板中找到的路徑匹配的文件',
388-
de: 'Dateien, die mit den in der Zwischenablage gefundenen Pfaden übereinstimmen',
389-
es: 'Archivos que coinciden con las rutas encontradas en el portapapeles',
390-
fr: 'Fichiers correspondant aux chemins trouvés dans le presse-papiers',
391-
'pt-br':
392-
'Arquivos que correspondem aos caminhos encontrados na área de transferência',
393-
ru: 'Файлы, соответствующие путям, найденным в буфере обмена',
394-
ko: '클립보드에서 찾은 경로와 일치하는 파일',
395-
it: 'File corrispondenti ai percorsi trovati negli appunti',
396-
tr: 'Panoda bulunan yollarla eşleşen dosyalar',
397-
cs: 'Soubory odpovídající cestám nalezeným ve schránce',
398-
hu: 'A vágólapon található útvonalaknak megfelelő fájlok',
399-
bg: 'Файлове, съвпадащи с пътищата, намерени в клипборда'
400-
},
401364
'views.prompt.handlers.hash-sign.quick-pick.placeholder': {
402365
en: 'Select symbol to insert',
403366
pl: 'Wybierz symbol do wstawienia',

‎apps/editor/src/views/prompt/backend/message-handlers/handle-hash-sign-quick-pick/handle-hash-sign-quick-pick.ts‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ import {
77
handle_changes_item,
88
handle_commit_item,
99
handle_saved_context_item,
10-
handle_skill_item,
11-
handle_clipboard_paths_item
10+
handle_skill_item
1211
} from './symbols'
1312

1413
const selection_label = `$(list-flat) ${t('views.prompt.handlers.hash-sign.quick-pick.selection.label')}`
1514
const changes_label = `$(git-pull-request-draft) ${t('views.prompt.handlers.hash-sign.quick-pick.changes.label')}`
1615
const commit_label = `$(git-commit) ${t('views.prompt.handlers.hash-sign.quick-pick.commit.label')}`
1716
const saved_context_label = `$(checklist) ${t('views.prompt.handlers.hash-sign.quick-pick.saved-context.label')}`
1817
const skill_label = `$(thinking) ${t('views.prompt.handlers.hash-sign.quick-pick.skill.label')}`
19-
const clipboard_paths_label = `$(clippy) ${t('views.prompt.handlers.hash-sign.quick-pick.clipboard-paths.label')}`
2018

2119
const hash_sign_quick_pick = async (params: {
2220
extension_context: vscode.ExtensionContext
@@ -58,12 +56,6 @@ const hash_sign_quick_pick = async (params: {
5856
tooltip: t('views.prompt.handlers.hash-sign.quick-pick.skill.tooltip')
5957
}
6058
]
61-
},
62-
{
63-
label: clipboard_paths_label,
64-
description: t(
65-
'views.prompt.handlers.hash-sign.quick-pick.clipboard-paths.description'
66-
)
6759
}
6860
]
6961

@@ -153,9 +145,6 @@ const hash_sign_quick_pick = async (params: {
153145
case skill_label:
154146
result = await handle_skill_item()
155147
break
156-
case clipboard_paths_label:
157-
result = await handle_clipboard_paths_item()
158-
break
159148
default:
160149
continue
161150
}

‎apps/editor/src/views/prompt/backend/message-handlers/handle-hash-sign-quick-pick/symbols/clipboard-paths-symbol.ts‎

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

‎apps/editor/src/views/prompt/backend/message-handlers/handle-hash-sign-quick-pick/symbols/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ export * from './changes-symbol'
33
export * from './commit-symbol'
44
export * from './saved-context-symbol'
55
export * from './skill-symbol'
6-
export * from './clipboard-paths-symbol'

‎apps/editor/src/views/prompt/backend/utils/symbols/clipboard-paths/replace-clipboard-paths-symbol.ts‎

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

‎apps/editor/src/views/prompt/backend/utils/symbols/replace-symbols.ts‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { replace_image_symbol } from './image/replace-image-symbol'
1111
import { replace_pasted_text_symbol } from './pasted-text/replace-pasted-text-symbol'
1212
import { replace_website_symbol } from './website/replace-website-symbol'
1313
import { replace_fragment_symbol } from './fragment/replace-fragment-symbol'
14-
import { replace_clipboard_paths_symbol } from './clipboard-paths/replace-clipboard-paths-symbol'
1514
import { SymbolCacheManager } from './symbol-cache'
1615

1716
export const replace_symbols = async (params: {
@@ -60,16 +59,6 @@ export const replace_symbols = async (params: {
6059
skill_definitions += result.context_definitions
6160
}
6261

63-
if (processed_instructions.includes('#ClipboardPaths')) {
64-
const result = await replace_clipboard_paths_symbol({
65-
instruction: processed_instructions,
66-
workspace_provider: params.workspace_provider,
67-
symbols_cache: params.symbols_cache
68-
})
69-
processed_instructions = result.instruction
70-
skill_definitions += result.additional_files_definitions
71-
}
72-
7362
if (processed_instructions.includes('#Skill(')) {
7463
const result = await replace_skill_symbol({
7564
instruction: processed_instructions,

‎packages/ui/src/components/editor/common/prompts/PromptField/hooks/use-handlers/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const get_symbol_ranges = (params: {
1111
}): { start: number; end: number }[] => {
1212
const ranges: { start: number; end: number }[] = []
1313
const regex =
14-
/`([^`]+)`|(#Changes\([^)]+\))|(#Selection)|(#SavedContext\((?:WorkspaceState|JSON) "(?:\\.|[^"\\])*"\))|(#(?:Commit|CommitMessage)\([^:]+:[^\s"]+ "(?:\\.|[^"\\])*"\))|(#Fragment\(.+?:\d+:\d+-\d+:\d+\))|(#Skill\([^)]+\))|(#Image\([a-fA-F0-9]+\))|(#PastedText\([a-fA-F0-9]+:\d+\))|(#Website\([^)]+\))|(#ClipboardPaths)/g
14+
/`([^`]+)`|(#Changes\([^)]+\))|(#Selection)|(#SavedContext\((?:WorkspaceState|JSON) "(?:\\.|[^"\\])*"\))|(#(?:Commit|CommitMessage)\([^:]+:[^\s"]+ "(?:\\.|[^"\\])*"\))|(#Fragment\(.+?:\d+:\d+-\d+:\d+\))|(#Skill\([^)]+\))|(#Image\([a-fA-F0-9]+\))|(#PastedText\([a-fA-F0-9]+:\d+\))|(#Website\([^)]+\))/g
1515

1616
let match
1717
while ((match = regex.exec(params.text)) !== null) {

‎packages/ui/src/components/editor/common/prompts/shared/symbols/get-highlighted-text.tsx‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ export const get_highlighted_text = (params: {
7070
const website_regex_part = '#Website\\([^)]+\\)'
7171

7272
const pasted_text_regex_part = '#PastedText\\([a-fA-F0-9]+:\\d+\\)'
73-
const clipboard_paths_regex_part = '#ClipboardPaths'
7473

7574
const regex = new RegExp(
76-
`(${fragment_regex_part}|#Selection|#Changes\\([^)]+\\)|${saved_context_regex_part}|${commit_regex_part}|${skill_regex_part}|${image_regex_part}|${pasted_text_regex_part}|${website_regex_part}|${clipboard_paths_regex_part})`,
75+
`(${fragment_regex_part}|#Selection|#Changes\\([^)]+\\)|${saved_context_regex_part}|${commit_regex_part}|${skill_regex_part}|${image_regex_part}|${pasted_text_regex_part}|${website_regex_part})`,
7776
'g'
7877
)
7978
const parts = params.text.split(regex)
@@ -123,17 +122,6 @@ export const get_highlighted_text = (params: {
123122
styles['symbol__text']
124123
}" data-role="symbol-text">Selection</span></span>`
125124
}
126-
if (part == '#ClipboardPaths') {
127-
const className = cn(
128-
styles['symbol'],
129-
styles['symbol--clipboard-paths']
130-
)
131-
return `<span class="${className}" data-type="clipboard-paths-symbol" title="Clipboard paths"><span class="${
132-
styles['symbol__icon']
133-
}" data-role="symbol-icon"></span><span class="${
134-
styles['symbol__text']
135-
}" data-role="symbol-text">Clipboard paths</span></span>`
136-
}
137125
if (part && /^#Changes\([^)]+\)$/.test(part)) {
138126
const branch_name = part.slice(9, -1)
139127
return `<span class="${cn(

‎packages/ui/src/components/editor/common/prompts/shared/symbols/position-mapping.ts‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const map_display_pos_to_raw_pos = (params: {
1010
let last_raw_index = 0
1111

1212
const regex =
13-
/`([^`]+)`|(#Changes\([^)]+\))|(#Selection)|(#SavedContext\((?:WorkspaceState|JSON) "((?:\\.|[^"\\])*)"\))|(#(?:Commit|CommitMessage)\([^:]+:([^\s"]+) "(?:\\.|[^"\\])*"\))|(#Fragment\((.+?):(\d+):(\d+)-(\d+):(\d+)\))|(#Skill\([^)]+\))|(#Image\([a-fA-F0-9]+\))|(#PastedText\([a-fA-F0-9]+:\d+\))|(#Website\([^)]+\))|(#ClipboardPaths)/g
13+
/`([^`]+)`|(#Changes\([^)]+\))|(#Selection)|(#SavedContext\((?:WorkspaceState|JSON) "((?:\\.|[^"\\])*)"\))|(#(?:Commit|CommitMessage)\([^:]+:([^\s"]+) "(?:\\.|[^"\\])*"\))|(#Fragment\((.+?):(\d+):(\d+)-(\d+):(\d+)\))|(#Skill\([^)]+\))|(#Image\([a-fA-F0-9]+\))|(#PastedText\([a-fA-F0-9]+:\d+\))|(#Website\([^)]+\))/g
1414
let match
1515

1616
while ((match = regex.exec(params.raw_text)) !== null) {
@@ -28,7 +28,6 @@ export const map_display_pos_to_raw_pos = (params: {
2828
const image_symbol = match[15]
2929
const pasted_text_symbol = match[16]
3030
const website_symbol = match[17]
31-
const clipboard_paths_symbol = match[18]
3231

3332
let is_replacement_match = false
3433
let display_match_length = 0
@@ -91,9 +90,6 @@ export const map_display_pos_to_raw_pos = (params: {
9190
} catch {}
9291
display_match_length = label.length
9392
is_replacement_match = true
94-
} else if (clipboard_paths_symbol) {
95-
display_match_length = 'Clipboard paths'.length
96-
is_replacement_match = true
9793
}
9894

9995
if (!is_replacement_match) {
@@ -137,7 +133,7 @@ export const map_raw_pos_to_display_pos = (params: {
137133
let last_raw_index = 0
138134

139135
const regex =
140-
/`([^`]+)`|(#Changes\([^)]+\))|(#Selection)|(#SavedContext\((?:WorkspaceState|JSON) "((?:\\.|[^"\\])*)"\))|(#(?:Commit|CommitMessage)\([^:]+:([^\s"]+) "(?:\\.|[^"\\])*"\))|(#Fragment\((.+?):(\d+):(\d+)-(\d+):(\d+)\))|(#Skill\([^)]+\))|(#Image\([a-fA-F0-9]+\))|(#PastedText\([a-fA-F0-9]+:\d+\))|(#Website\([^)]+\))|(#ClipboardPaths)/g
136+
/`([^`]+)`|(#Changes\([^)]+\))|(#Selection)|(#SavedContext\((?:WorkspaceState|JSON) "((?:\\.|[^"\\])*)"\))|(#(?:Commit|CommitMessage)\([^:]+:([^\s"]+) "(?:\\.|[^"\\])*"\))|(#Fragment\((.+?):(\d+):(\d+)-(\d+):(\d+)\))|(#Skill\([^)]+\))|(#Image\([a-fA-F0-9]+\))|(#PastedText\([a-fA-F0-9]+:\d+\))|(#Website\([^)]+\))/g
141137
let match
142138

143139
while ((match = regex.exec(params.raw_text)) !== null) {
@@ -155,7 +151,6 @@ export const map_raw_pos_to_display_pos = (params: {
155151
const image_symbol = match[15]
156152
const pasted_text_symbol = match[16]
157153
const website_symbol = match[17]
158-
const clipboard_paths_symbol = match[18]
159154

160155
let is_replacement_match = false
161156
let display_match_length = 0
@@ -218,9 +213,6 @@ export const map_raw_pos_to_display_pos = (params: {
218213
} catch {}
219214
display_match_length = label.length
220215
is_replacement_match = true
221-
} else if (clipboard_paths_symbol) {
222-
display_match_length = 'Clipboard paths'.length
223-
is_replacement_match = true
224216
}
225217

226218
if (!is_replacement_match) {

‎packages/ui/src/components/editor/common/prompts/shared/symbols/prompt-symbols.module.scss‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@
188188
pointer-events: none;
189189
}
190190

191-
&--clipboard-paths &__icon::before {
192-
content: '\eac0';
193-
}
194-
195191
&--pasted-lines &__icon::before {
196192
content: '\eac0';
197193
}

0 commit comments

Comments
 (0)