Skip to content

Commit e780eb1

Browse files
committed
Add explanatory comments to empty catch blocks
- in such cases `catch {}`, place "ignore" comment in body ├── apps │ ├── browser │ │ └── src │ │ └── background │ │ ├── message-handler.ts │ │ └── websocket.ts │ └── editor │ └── src │ ├── commands │ │ ├── apply-from-terminal-command.ts │ │ ├── copy-merge-commit-details-command.ts │ │ ├── generate-commit-message-commands │ │ │ └── utils │ │ │ └── build-commit-message-prompt.ts │ │ ├── history-command │ │ │ └── actions │ │ │ └── restore-checkpoint.ts │ │ ├── new-file-command.ts │ │ ├── new-folder-command.ts │ │ ├── select-files-of-commit-command.ts │ │ └── set-ranges-command.ts │ ├── context │ │ └── providers │ │ └── workspace │ │ ├── modules │ │ │ └── token-calculator.ts │ │ └── workspace-provider.ts │ ├── features │ │ ├── agentic-search │ │ │ └── agentic-search.ts │ │ ├── apply-response │ │ │ ├── response-processor │ │ │ │ ├── handlers │ │ │ │ │ ├── patch-repair-handler.ts │ │ │ │ │ └── restore-preview-handler.ts │ │ │ │ └── response-processor.ts │ │ │ └── utils │ │ │ ├── file-operations │ │ │ │ └── prepare-rename-operation.ts │ │ │ └── preview │ │ │ ├── vscode-ui.ts │ │ │ └── workspace-listener.ts │ │ ├── checkpoints │ │ │ └── utils │ │ │ └── checkpoints-metadata.ts │ │ └── search-files │ │ └── utils │ │ └── analyze-files.ts │ ├── migrations │ │ └── migrate-checkpoints-to-global-storage.ts │ ├── services │ │ └── websocket-manager.ts │ ├── utils │ │ ├── agentic-cli-invocation │ │ │ └── invoke-agentic-cli.ts │ │ ├── get-imports-for-uri.ts │ │ ├── git-repository-utils.ts │ │ ├── sync-directory.ts │ │ └── workspace-snapshot.ts │ └── views │ ├── prompt │ │ └── backend │ │ ├── message-handlers │ │ │ ├── handle-paste-url.ts │ │ │ ├── handle-patch-repair.ts │ │ │ ├── handle-preview-changes-symbol.ts │ │ │ └── handle-show-diff.ts │ │ └── utils │ │ └── website-fetcher.ts │ └── shared │ └── utils │ └── hash-sign-quick-pick │ └── symbols │ ├── commit-symbol.ts │ └── skill-symbol.ts └── install.ps1
1 parent 3f1c281 commit e780eb1

36 files changed

Lines changed: 199 additions & 70 deletions

‎apps/browser/src/background/message-handler.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ const handle_initialize_chat_message = async (
186186
break
187187
}
188188
}
189-
} catch {}
189+
} catch {
190+
// Ignore
191+
}
190192
}
191193
}
192194

‎apps/browser/src/background/websocket.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ const abandon_socket = (c: Connection) => {
9999
ws.onclose = null
100100
try {
101101
ws.close()
102-
} catch {}
102+
} catch {
103+
// Ignore
104+
}
103105
}
104106

105107
export const check_and_recover_connection = async () => {
@@ -261,10 +263,7 @@ browser.storage.onChanged.addListener((changes, areaName) => {
261263
const old_ports = (changes['forwarded-ports'].oldValue as number[]) || []
262264

263265
for (const port of old_ports) {
264-
if (
265-
!new_ports.includes(port) &&
266-
port !== DEFAULT_PORT
267-
) {
266+
if (!new_ports.includes(port) && port !== DEFAULT_PORT) {
268267
const c = connections.get(port)
269268
if (c) {
270269
abandon_socket(c)

‎apps/editor/src/commands/apply-from-terminal-command.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ const build_diff_from_sandbox = async (
4848
original: original_path,
4949
dest_rel: unix_rel_path
5050
})
51-
} catch {}
51+
} catch {
52+
// Ignore
53+
}
5254
}
5355
}
5456

@@ -117,7 +119,9 @@ export const apply_from_terminal_command = (): vscode.Disposable => {
117119
flags: metadata.flags
118120
}
119121
}
120-
} catch {}
122+
} catch {
123+
// Ignore
124+
}
121125

122126
const accepted = await apply_response({
123127
response: diff_markdown,

‎apps/editor/src/commands/copy-merge-commit-details-command.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export const copy_merge_commit_details_command = (): vscode.Disposable => {
2525
})
2626
.toString()
2727
.trim()
28-
} catch {}
28+
} catch {
29+
// Ignore
30+
}
2931

3032
if (!branches_output) {
3133
vscode.window.showInformationMessage(

‎apps/editor/src/commands/generate-commit-message-commands/utils/build-commit-message-prompt.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ export const build_commit_message_prompt = async (
166166
})
167167
}
168168
}
169-
} catch {}
169+
} catch {
170+
// Ignore
171+
}
170172
}
171173

172174
changes_content_part = PromptBuilder.build_diff_file_context({
@@ -215,7 +217,9 @@ export const build_commit_message_prompt = async (
215217
})
216218
}
217219
}
218-
} catch {}
220+
} catch {
221+
// Ignore
222+
}
219223

220224
return ''
221225
})

‎apps/editor/src/commands/history-command/actions/restore-checkpoint.ts‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ export const restore_checkpoint = async (params: {
166166
const history_data =
167167
await vscode.workspace.fs.readFile(history_file_path)
168168
loaded_history = JSON.parse(new TextDecoder().decode(history_data))
169-
} catch {}
169+
} catch {
170+
// Ignore
171+
}
170172

171173
if (loaded_history.length > 0) {
172174
params.prompt_view_provider.response_history = loaded_history
@@ -194,7 +196,9 @@ export const restore_checkpoint = async (params: {
194196
loaded_completed_tasks = JSON.parse(
195197
new TextDecoder().decode(completed_tasks_data)
196198
)
197-
} catch {}
199+
} catch {
200+
// Ignore
201+
}
198202

199203
if (loaded_completed_tasks !== undefined) {
200204
params.prompt_view_provider.completed_tasks = loaded_completed_tasks
@@ -232,7 +236,9 @@ export const restore_checkpoint = async (params: {
232236
preserveFocus: true,
233237
preview: false
234238
})
235-
} catch {}
239+
} catch {
240+
// Ignore
241+
}
236242
}
237243

238244
if (active_file) {
@@ -244,7 +250,9 @@ export const restore_checkpoint = async (params: {
244250
preserveFocus: false,
245251
preview: false
246252
})
247-
} catch {}
253+
} catch {
254+
// Ignore
255+
}
248256
}
249257

250258
await params.extension_context.workspaceState.update(

‎apps/editor/src/commands/new-file-command.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export const new_file_command = () => {
4343
if (!stats.isDirectory()) {
4444
parent_path = path.dirname(parent_path)
4545
}
46-
} catch {}
46+
} catch {
47+
// Ignore
48+
}
4749

4850
const input_box = vscode.window.createInputBox()
4951
input_box.title = t('command.new-file-command.title')
@@ -111,7 +113,9 @@ export const new_file_command = () => {
111113
})
112114
)
113115
return
114-
} catch {}
116+
} catch {
117+
// Ignore
118+
}
115119

116120
// Ensure parent directory exists (this does not trigger onDidCreateFiles)
117121
const directory = path.dirname(file_path)

‎apps/editor/src/commands/new-folder-command.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export const new_folder_command = () => {
4343
if (!stats.isDirectory()) {
4444
parent_path = path.dirname(parent_path)
4545
}
46-
} catch {}
46+
} catch {
47+
// Ignore
48+
}
4749

4850
const input_box = vscode.window.createInputBox()
4951
input_box.title = t('command.new-folder-command.title')
@@ -117,7 +119,9 @@ export const new_folder_command = () => {
117119
})
118120
)
119121
return
120-
} catch {}
122+
} catch {
123+
// Ignore
124+
}
121125

122126
const directory = path.dirname(target_path)
123127
await vscode.workspace.fs.createDirectory(vscode.Uri.file(directory))
@@ -145,7 +149,9 @@ export const new_folder_command = () => {
145149
})
146150
)
147151
return
148-
} catch {}
152+
} catch {
153+
// Ignore
154+
}
149155

150156
await vscode.workspace.fs.createDirectory(vscode.Uri.file(target_path))
151157
} catch (error) {

‎apps/editor/src/commands/select-files-of-commit-command.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ export const select_files_of_commit_command = (
165165
)
166166
.toString()
167167
.trim()
168-
} catch {}
168+
} catch {
169+
// Ignore
170+
}
169171

170172
const branches = branches_output
171173
.split('\n')
@@ -256,7 +258,9 @@ export const select_files_of_commit_command = (
256258
)
257259
.toString()
258260
.trim()
259-
} catch {}
261+
} catch {
262+
// Ignore
263+
}
260264

261265
is_ahead_of_branch = true
262266
branch_name = selected_branch.name
@@ -284,7 +288,9 @@ export const select_files_of_commit_command = (
284288
)
285289
.toString()
286290
.trim()
287-
} catch {}
291+
} catch {
292+
// Ignore
293+
}
288294

289295
if (!files_output) {
290296
vscode.window.showInformationMessage(

‎apps/editor/src/commands/set-ranges-command.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export const set_ranges_command = (
4343
const { bytesRead } = await file_handle.read(buffer, 0, 8000, 0)
4444
await file_handle.close()
4545
is_binary = is_binary_file(file_path, buffer.subarray(0, bytesRead))
46-
} catch {}
46+
} catch {
47+
// Ignore
48+
}
4749
}
4850

4951
if (is_binary) {
@@ -69,7 +71,9 @@ export const set_ranges_command = (
6971
for (const [key, value] of Object.entries(raw_ranges)) {
7072
file_ranges[normalize_path(key)] = value as string
7173
}
72-
} catch {}
74+
} catch {
75+
// Ignore
76+
}
7377

7478
const all_global_ranges = RangesStorage.load_all(extension_context)
7579
const global_ranges_for_workspace =

0 commit comments

Comments
 (0)