Skip to content

Commit a6d263f

Browse files
committed
Remove unnecessary void return type annotations from functions
1 parent 9773df0 commit a6d263f

29 files changed

Lines changed: 72 additions & 89 deletions

‎apps/editor/src/commands/apply-chat-response-command/utils/clipboard-parser/parsers/diff-parser/helpers/block-utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const remove_path_line_from_text_block = (params: {
5151
text_item: TextItem
5252
target_file_path: string
5353
is_single_root: boolean
54-
}): void => {
54+
}) => {
5555
const content_lines = params.text_item.content.split('\n')
5656
let path_line_index = -1
5757

‎apps/editor/src/commands/apply-chat-response-command/utils/clipboard-parser/parsers/multiple-files-parser/helpers/item-management.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const create_or_update_file_item = (params: {
1010
mode?: 'overwrite' | 'append'
1111
renamed_from?: string
1212
is_deleted?: boolean
13-
}): void => {
13+
}) => {
1414
const {
1515
file_name,
1616
content,
@@ -63,7 +63,7 @@ export const create_or_update_file_item = (params: {
6363
export const flush_text_block = (params: {
6464
text_block: string
6565
results: (FileItem | TextItem | InlineFileItem)[]
66-
}): void => {
66+
}) => {
6767
const { text_block, results } = params
6868

6969
if (!text_block.trim()) {

‎apps/editor/src/commands/apply-chat-response-command/utils/preview/temp-file-manager.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { PreparedFile } from './types'
33

44
export const create_temp_files_with_original_content = (
55
prepared_files: PreparedFile[]
6-
): void => {
6+
) => {
77
prepared_files.forEach((file) => {
88
fs.writeFileSync(file.temp_file_path, file.original_content)
99
})
1010
}
1111

12-
export const cleanup_temp_files = (prepared_files: PreparedFile[]): void => {
12+
export const cleanup_temp_files = (prepared_files: PreparedFile[]) => {
1313
prepared_files.forEach((file) => {
1414
try {
1515
fs.unlinkSync(file.temp_file_path)

‎apps/editor/src/commands/apply-context-command/helpers/saving/global-storage-utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const save_contexts_for_workspace = (
4040
context: vscode.ExtensionContext,
4141
workspace_root: string,
4242
contexts: SavedContext[]
43-
): void => {
43+
) => {
4444
const file_path = get_global_contexts_file_path(context)
4545
const dir_path = path.dirname(file_path)
4646

‎apps/editor/src/context/providers/context/context-provider.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class ContextProvider implements vscode.TreeDataProvider<FileItem> {
1717
)
1818
}
1919

20-
refresh(): void {
20+
refresh() {
2121
this._onDidChangeTreeData.fire()
2222
}
2323

‎apps/editor/src/context/providers/open-editors/open-editors-provider.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class OpenEditorsProvider
3131
private _workspace_provider: WorkspaceProvider
3232
private _use_compact_token_count: boolean = false
3333

34-
public set_use_compact_token_count(use_compact: boolean): void {
34+
public set_use_compact_token_count(use_compact: boolean) {
3535
if (this._use_compact_token_count != use_compact) {
3636
this._use_compact_token_count = use_compact
3737
this.refresh()
@@ -78,12 +78,12 @@ export class OpenEditorsProvider
7878

7979
public update_workspace_folders(
8080
workspace_folders: readonly vscode.WorkspaceFolder[]
81-
): void {
81+
) {
8282
this._workspace_roots = workspace_folders.map((folder) => folder.uri.fsPath)
8383
this.refresh()
8484
}
8585

86-
private _dispatch_change_events(): void {
86+
private _dispatch_change_events() {
8787
this._on_did_change_checked_files.fire()
8888
this.refresh()
8989
}
@@ -98,7 +98,7 @@ export class OpenEditorsProvider
9898
return this._workspace_roots.find((root) => file_path.startsWith(root))
9999
}
100100

101-
private _uncheck_ignored_files(): void {
101+
private _uncheck_ignored_files() {
102102
const checked_files = this.get_checked_files()
103103

104104
const files_to_uncheck = checked_files.filter((file_path) =>
@@ -114,7 +114,7 @@ export class OpenEditorsProvider
114114
}
115115
}
116116

117-
private _update_preview_tabs_state(): void {
117+
private _update_preview_tabs_state() {
118118
this._preview_tabs.clear()
119119

120120
vscode.window.tabGroups.all.forEach((tab_group) => {
@@ -127,7 +127,7 @@ export class OpenEditorsProvider
127127
})
128128
}
129129

130-
private _handle_tab_changes(e: vscode.TabChangeEvent): void {
130+
private _handle_tab_changes(e: vscode.TabChangeEvent) {
131131
for (const tab of e.changed) {
132132
if (tab.input instanceof vscode.TabInputText) {
133133
const file_path = tab.input.uri.fsPath
@@ -150,18 +150,18 @@ export class OpenEditorsProvider
150150
}
151151
}
152152

153-
mark_opened_from_workspace_view(file_path: string): void {
153+
mark_opened_from_workspace_view(file_path: string) {
154154
this._opened_from_workspace_view.add(file_path)
155155
}
156156

157-
dispose(): void {
157+
dispose() {
158158
this._workspace_change_handler.dispose()
159159
this._tab_change_handler.dispose()
160160
this._config_change_handler.dispose()
161161
this._on_did_change_checked_files.dispose()
162162
}
163163

164-
refresh(): void {
164+
refresh() {
165165
this._clean_up_closed_files()
166166
this._on_did_change_tree_data.fire()
167167
}
@@ -171,7 +171,7 @@ export class OpenEditorsProvider
171171
return workspace_checked_files.includes(file_path)
172172
}
173173

174-
private _clean_up_closed_files(): void {
174+
private _clean_up_closed_files() {
175175
const open_file_paths = new Set(
176176
this._get_open_editors().map((uri) => uri.fsPath)
177177
)
@@ -365,7 +365,7 @@ export class OpenEditorsProvider
365365
this._dispatch_change_events()
366366
}
367367

368-
clear_checks(): void {
368+
clear_checks() {
369369
// Instead of clearing the map, explicitly set each open editor to unchecked
370370
const open_files = this._get_open_editors()
371371

‎apps/editor/src/context/providers/workspace/modules/token-calculator.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class TokenCalculator implements vscode.Disposable {
6363
}
6464
}
6565

66-
private _update_token_counts_cache(): void {
66+
private _update_token_counts_cache() {
6767
if (this._has_token_counts_cache_updated_once) return
6868

6969
if (this._token_cache_update_timeout) {
@@ -143,7 +143,7 @@ export class TokenCalculator implements vscode.Disposable {
143143
mtime: number,
144144
token_count: number,
145145
compact_token_count: number
146-
): void {
146+
) {
147147
if (!this._session_cache[workspace_root]) {
148148
this._session_cache[workspace_root] = {
149149
modified_at: Date.now(),
@@ -189,7 +189,7 @@ export class TokenCalculator implements vscode.Disposable {
189189
}
190190
}
191191

192-
public invalidate_token_counts_for_file(changed_file_path: string): void {
192+
public invalidate_token_counts_for_file(changed_file_path: string) {
193193
const workspace_root =
194194
this._provider.get_workspace_root_for_file(changed_file_path)
195195
if (!workspace_root) {
@@ -211,19 +211,19 @@ export class TokenCalculator implements vscode.Disposable {
211211
}
212212
}
213213

214-
public invalidate_directory_counts(dir_path: string): void {
214+
public invalidate_directory_counts(dir_path: string) {
215215
this._directory_token_counts.delete(dir_path)
216216
this._directory_compact_token_counts.delete(dir_path)
217217
this._directory_selected_token_counts.delete(dir_path)
218218
this._directory_selected_compact_token_counts.delete(dir_path)
219219
}
220220

221-
public invalidate_directory_selected_count(dir_path: string): void {
221+
public invalidate_directory_selected_count(dir_path: string) {
222222
this._directory_selected_token_counts.delete(dir_path)
223223
this._directory_selected_compact_token_counts.delete(dir_path)
224224
}
225225

226-
public clear_caches(): void {
226+
public clear_caches() {
227227
this._file_token_counts.clear()
228228
this._file_compact_token_counts.clear()
229229
this._directory_token_counts.clear()
@@ -232,7 +232,7 @@ export class TokenCalculator implements vscode.Disposable {
232232
this._directory_selected_compact_token_counts.clear()
233233
}
234234

235-
public clear_selected_counts(): void {
235+
public clear_selected_counts() {
236236
this._directory_selected_token_counts.clear()
237237
this._directory_selected_compact_token_counts.clear()
238238
}
@@ -619,7 +619,7 @@ export class TokenCalculator implements vscode.Disposable {
619619
return result
620620
}
621621

622-
public dispose(): void {
622+
public dispose() {
623623
if (this._token_cache_update_timeout) {
624624
clearTimeout(this._token_cache_update_timeout)
625625
}

‎apps/editor/src/context/providers/workspace/workspace-provider.ts‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class WorkspaceProvider
6767
public ranges_initialization: Promise<void>
6868
public use_compact_token_count: boolean = false
6969

70-
public set_use_compact_token_count(use_compact: boolean): void {
70+
public set_use_compact_token_count(use_compact: boolean) {
7171
if (this.use_compact_token_count != use_compact) {
7272
this.use_compact_token_count = use_compact
7373
this.refresh()
@@ -138,7 +138,7 @@ export class WorkspaceProvider
138138
)
139139
}
140140

141-
public load_checked_files_state(): void {
141+
public load_checked_files_state() {
142142
const persisted_checked_paths = this._context.workspaceState.get<string[]>(
143143
CONTEXT_CHECKED_PATHS_STATE_KEY
144144
)
@@ -183,12 +183,12 @@ export class WorkspaceProvider
183183
return matching_root
184184
}
185185

186-
private _dispatch_change_events(): void {
186+
private _dispatch_change_events() {
187187
this._on_did_change_checked_files.fire()
188188
this.refresh()
189189
}
190190

191-
private _uncheck_ignored_files(): void {
191+
private _uncheck_ignored_files() {
192192
const checked_files = this.get_all_checked_paths()
193193

194194
const files_to_uncheck = checked_files.filter((file_path) =>
@@ -212,7 +212,7 @@ export class WorkspaceProvider
212212
}
213213
}
214214

215-
public dispose(): void {
215+
public dispose() {
216216
this._watcher.dispose()
217217
this._ranges_watcher.dispose()
218218
this._gitignore_watcher.dispose()
@@ -228,7 +228,7 @@ export class WorkspaceProvider
228228
this._token_calculator.dispose()
229229
}
230230

231-
private _update_preview_tabs_state(): void {
231+
private _update_preview_tabs_state() {
232232
this._preview_tabs.clear()
233233

234234
vscode.window.tabGroups.all.forEach((tabGroup) => {
@@ -241,7 +241,7 @@ export class WorkspaceProvider
241241
})
242242
}
243243

244-
private _handle_tab_changes(e: vscode.TabChangeEvent): void {
244+
private _handle_tab_changes(e: vscode.TabChangeEvent) {
245245
for (const tab of e.changed) {
246246
if (tab.input instanceof vscode.TabInputText) {
247247
const file_path = tab.input.uri.fsPath
@@ -263,7 +263,7 @@ export class WorkspaceProvider
263263
}
264264
}
265265

266-
private _handle_file_out_preview(file_path: string): void {
266+
private _handle_file_out_preview(file_path: string) {
267267
const workspace_root = this.get_workspace_root_for_file(file_path)
268268
if (!workspace_root) return
269269

@@ -286,7 +286,7 @@ export class WorkspaceProvider
286286
}
287287
}
288288

289-
public mark_opened_from_workspace_view(file_path: string): void {
289+
public mark_opened_from_workspace_view(file_path: string) {
290290
this._opened_from_workspace_view.add(file_path)
291291
}
292292

@@ -316,11 +316,11 @@ export class WorkspaceProvider
316316
return path.basename(root_path)
317317
}
318318

319-
public invalidate_token_counts_for_file(changed_file_path: string): void {
319+
public invalidate_token_counts_for_file(changed_file_path: string) {
320320
this._token_calculator.invalidate_token_counts_for_file(changed_file_path)
321321
}
322322

323-
private _on_file_system_changed(changed_file_path?: string): void {
323+
private _on_file_system_changed(changed_file_path?: string) {
324324
if (!changed_file_path) return
325325

326326
const workspace_root = this.get_workspace_root_for_file(changed_file_path)
@@ -426,15 +426,15 @@ export class WorkspaceProvider
426426
this._schedule_refresh()
427427
}
428428

429-
public refresh(): void {
429+
public refresh() {
430430
if (this._refresh_timeout) {
431431
clearTimeout(this._refresh_timeout)
432432
this._refresh_timeout = null
433433
}
434434
this._on_did_change_tree_data.fire()
435435
}
436436

437-
private _schedule_refresh(): void {
437+
private _schedule_refresh() {
438438
if (this._refresh_timeout) {
439439
clearTimeout(this._refresh_timeout)
440440
}

‎apps/editor/src/migrations/migrate-saved-contexts-to-global-storage.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const load_all_global_contexts = (
3939
const save_all_global_contexts = (
4040
context: vscode.ExtensionContext,
4141
data: GlobalContextsData
42-
): void => {
42+
) => {
4343
const file_path = get_global_contexts_file_path(context)
4444
const dir_path = path.dirname(file_path)
4545

0 commit comments

Comments
 (0)