Skip to content

Commit 7b8cdb0

Browse files
committed
Remove redundant public access modifiers from class members
- dont prefix public class methods with 'public' ├── apps │ └── editor │ └── src │ ├── context │ │ └── providers │ │ ├── open-editors │ │ │ └── open-editors-provider.ts │ │ └── workspace │ │ ├── modules │ │ │ └── token-calculator.ts │ │ └── workspace-provider.ts │ ├── features │ │ └── agentic-search │ │ └── agentic-search-state.ts │ ├── services │ │ ├── model-fetcher.ts │ │ ├── prompt-view-api-calls-manager.ts │ │ ├── providers-manager.ts │ │ ├── websocket-manager.ts │ │ └── websocket-server-process.ts │ ├── utils │ │ └── changes-integration │ │ └── diff-processor │ │ └── test-cases │ │ └── generic-5 │ │ ├── expected.txt │ │ └── original.txt │ └── views │ ├── chats │ │ └── backend │ │ └── chats-view-provider.ts │ ├── prompt │ │ └── backend │ │ ├── prompt-view-provider.ts │ │ └── utils │ │ └── symbols │ │ └── symbol-cache.ts │ └── settings │ └── backend │ └── settings-view-provider.ts └── docs └── privacy.mdx
1 parent 9835edf commit 7b8cdb0

13 files changed

Lines changed: 98 additions & 102 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class OpenEditorsProvider
7070
}, 500)
7171
}
7272

73-
public update_workspace_folders(
73+
update_workspace_folders(
7474
workspace_folders: readonly vscode.WorkspaceFolder[]
7575
) {
7676
this._workspace_roots = workspace_folders

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export class TokenCalculator implements vscode.Disposable {
241241
return count
242242
}
243243

244-
public async with_token_counting_notification<T>(params: {
244+
async with_token_counting_notification<T>(params: {
245245
dir_path?: string
246246
roots?: string[]
247247
task: () => Promise<T>
@@ -343,7 +343,7 @@ export class TokenCalculator implements vscode.Disposable {
343343
}
344344
}
345345

346-
public invalidate_token_counts_for_file(changed_file_path: string) {
346+
invalidate_token_counts_for_file(changed_file_path: string) {
347347
const workspace_root =
348348
this._provider.get_workspace_root_for_file(changed_file_path)
349349
if (!workspace_root) {
@@ -368,20 +368,20 @@ export class TokenCalculator implements vscode.Disposable {
368368
}
369369
}
370370

371-
public invalidate_directory_counts(dir_path: string) {
371+
invalidate_directory_counts(dir_path: string) {
372372
this._directory_token_counts.delete(dir_path)
373373
this._directory_shrink_token_counts.delete(dir_path)
374374
this._directory_file_counts.delete(dir_path)
375375
this._directory_selected_token_counts.delete(dir_path)
376376
this._directory_selected_shrink_token_counts.delete(dir_path)
377377
}
378378

379-
public invalidate_directory_selected_count(dir_path: string) {
379+
invalidate_directory_selected_count(dir_path: string) {
380380
this._directory_selected_token_counts.delete(dir_path)
381381
this._directory_selected_shrink_token_counts.delete(dir_path)
382382
}
383383

384-
public clear_caches() {
384+
clear_caches() {
385385
this._file_token_counts.clear()
386386
this._file_shrink_token_counts.clear()
387387
this._directory_token_counts.clear()
@@ -391,12 +391,12 @@ export class TokenCalculator implements vscode.Disposable {
391391
this._directory_selected_shrink_token_counts.clear()
392392
}
393393

394-
public clear_selected_counts() {
394+
clear_selected_counts() {
395395
this._directory_selected_token_counts.clear()
396396
this._directory_selected_shrink_token_counts.clear()
397397
}
398398

399-
public get_cached_token_count(
399+
get_cached_token_count(
400400
file_path: string
401401
): { total: number; shrink: number } | undefined {
402402
const total = this._file_token_counts.get(file_path)
@@ -407,7 +407,7 @@ export class TokenCalculator implements vscode.Disposable {
407407
return undefined
408408
}
409409

410-
public async calculate_file_tokens(
410+
async calculate_file_tokens(
411411
file_path: string
412412
): Promise<{ total: number; shrink: number }> {
413413
if (
@@ -544,7 +544,7 @@ export class TokenCalculator implements vscode.Disposable {
544544
}
545545
}
546546

547-
public async calculate_directory_tokens(
547+
async calculate_directory_tokens(
548548
dir_path: string
549549
): Promise<{ total: number; shrink: number; file_count: number }> {
550550
if (
@@ -638,7 +638,7 @@ export class TokenCalculator implements vscode.Disposable {
638638
}
639639
}
640640

641-
public async calculate_directory_selected_tokens(
641+
async calculate_directory_selected_tokens(
642642
dir_path: string
643643
): Promise<{ total: number; shrink: number }> {
644644
if (!dir_path) {
@@ -741,7 +741,7 @@ export class TokenCalculator implements vscode.Disposable {
741741
return { total: selected_tokens, shrink: selected_shrink_tokens }
742742
}
743743

744-
public async get_selected_files_token_count(options?: {
744+
async get_selected_files_token_count(options?: {
745745
exclude_file_path?: string
746746
}): Promise<{ total: number; shrink: number }> {
747747
const selected_files = this._provider.get_selected_files()
@@ -780,7 +780,7 @@ export class TokenCalculator implements vscode.Disposable {
780780
return result
781781
}
782782

783-
public dispose() {
783+
dispose() {
784784
if (this._token_cache_update_timeout) {
785785
clearTimeout(this._token_cache_update_timeout)
786786
}

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

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,13 @@ export class WorkspaceProvider
8282
private _is_file_watcher_paused = false
8383
private _resume_file_watcher_timeout: NodeJS.Timeout | null = null
8484

85-
public set_selected_files_view_collapsible_state(
85+
set_selected_files_view_collapsible_state(
8686
state: vscode.TreeItemCollapsibleState
8787
) {
8888
this._selected_files_view_collapsible_state = state
8989
}
9090

91-
public set_workspace_view_collapsible_state(
92-
state: vscode.TreeItemCollapsibleState
93-
) {
91+
set_workspace_view_collapsible_state(state: vscode.TreeItemCollapsibleState) {
9492
this._workspace_view_collapsible_state = state
9593
}
9694

@@ -165,7 +163,7 @@ export class WorkspaceProvider
165163
)
166164
}
167165

168-
public load_selected_files_state() {
166+
load_selected_files_state() {
169167
const load = async () => {
170168
const reg_paths = this._extension_context.workspaceState.get<string[]>(
171169
CONTEXT_SELECTED_PATHS_STATE_KEY
@@ -186,7 +184,7 @@ export class WorkspaceProvider
186184
load()
187185
}
188186

189-
public get_export_state() {
187+
get_export_state() {
190188
return {
191189
selected_files: Array.from(this._checked_items.entries())
192190
.filter(([, state]) => state == vscode.TreeItemCheckboxState.Checked)
@@ -195,11 +193,11 @@ export class WorkspaceProvider
195193
}
196194
}
197195

198-
public get_selection_timestamp(path: string): number | undefined {
196+
get_selection_timestamp(path: string): number | undefined {
199197
return this._selected_timestamps.get(path)
200198
}
201199

202-
public get_workspace_root_for_file(file_path: string): string | undefined {
200+
get_workspace_root_for_file(file_path: string): string | undefined {
203201
if (this._file_workspace_map.has(file_path)) {
204202
return this._file_workspace_map.get(file_path)
205203
}
@@ -262,7 +260,7 @@ export class WorkspaceProvider
262260
}
263261
}
264262

265-
public dispose() {
263+
dispose() {
266264
this._watcher.dispose()
267265
this._ranges_watcher.dispose()
268266
this._gitignore_watcher.dispose()
@@ -339,7 +337,7 @@ export class WorkspaceProvider
339337
}
340338
}
341339

342-
public mark_opened_from_workspace_view(file_path: string) {
340+
mark_opened_from_workspace_view(file_path: string) {
343341
this._opened_from_workspace_view.add(file_path)
344342
}
345343

@@ -357,27 +355,27 @@ export class WorkspaceProvider
357355
return open_uris
358356
}
359357

360-
public get_workspace_roots(): string[] {
358+
get_workspace_roots(): string[] {
361359
return this._workspace_roots
362360
}
363361

364-
public get_workspace_name(root_path: string): string {
362+
get_workspace_name(root_path: string): string {
365363
const index = this._workspace_roots.indexOf(root_path)
366364
if (index !== -1) {
367365
return this._workspace_names[index]
368366
}
369367
return path.basename(root_path)
370368
}
371369

372-
public pause_file_watcher(): void {
370+
pause_file_watcher(): void {
373371
if (this._resume_file_watcher_timeout) {
374372
clearTimeout(this._resume_file_watcher_timeout)
375373
this._resume_file_watcher_timeout = null
376374
}
377375
this._is_file_watcher_paused = true
378376
}
379377

380-
public resume_file_watcher(): void {
378+
resume_file_watcher(): void {
381379
if (this._resume_file_watcher_timeout) {
382380
clearTimeout(this._resume_file_watcher_timeout)
383381
}
@@ -400,7 +398,7 @@ export class WorkspaceProvider
400398
return true
401399
}
402400

403-
public invalidate_token_counts_for_file(changed_file_path: string) {
401+
invalidate_token_counts_for_file(changed_file_path: string) {
404402
this._token_calculator.invalidate_token_counts_for_file(changed_file_path)
405403
}
406404

@@ -517,7 +515,7 @@ export class WorkspaceProvider
517515
this._schedule_refresh()
518516
}
519517

520-
public refresh() {
518+
refresh() {
521519
if (this._refresh_timeout) {
522520
clearTimeout(this._refresh_timeout)
523521
this._refresh_timeout = null
@@ -535,7 +533,7 @@ export class WorkspaceProvider
535533
}, 1500)
536534
}
537535

538-
public async clear_selected_files(): Promise<void> {
536+
async clear_selected_files(): Promise<void> {
539537
this._checked_items.clear()
540538
this._selected_timestamps.clear()
541539
this._partially_selected_dirs.clear()
@@ -606,7 +604,7 @@ export class WorkspaceProvider
606604
return element
607605
}
608606

609-
public async getChildren(element?: FileItem): Promise<FileItem[]> {
607+
async getChildren(element?: FileItem): Promise<FileItem[]> {
610608
await this.gitignore_initialization
611609
await this.ranges_initialization
612610

@@ -653,9 +651,7 @@ export class WorkspaceProvider
653651
}
654652
}
655653

656-
public async getSelectedFilesViewChildren(
657-
element?: FileItem
658-
): Promise<FileItem[]> {
654+
async getSelectedFilesViewChildren(element?: FileItem): Promise<FileItem[]> {
659655
await this.gitignore_initialization
660656
await this.ranges_initialization
661657

@@ -760,7 +756,7 @@ export class WorkspaceProvider
760756
}
761757
return items
762758
}
763-
public async load_all_ranges(): Promise<void> {
759+
async load_all_ranges(): Promise<void> {
764760
if (this._check_file_watcher_paused()) return
765761

766762
this._file_ranges.clear()
@@ -823,11 +819,11 @@ export class WorkspaceProvider
823819
return undefined
824820
}
825821

826-
public get_range(filePath: string): string | undefined {
822+
get_range(filePath: string): string | undefined {
827823
return this._file_ranges.get(filePath)
828824
}
829825

830-
public apply_range_to_content(content: string, range_string: string): string {
826+
apply_range_to_content(content: string, range_string: string): string {
831827
const lines = content.split(/\r?\n/)
832828
const total_lines = lines.length
833829
const included_lines = new Set<number>()
@@ -857,13 +853,13 @@ export class WorkspaceProvider
857853
return sorted_indices.map((i) => lines[i - 1]).join('\n')
858854
}
859855

860-
public get_cached_token_count(
856+
get_cached_token_count(
861857
file_path: string
862858
): { total: number; shrink: number } | undefined {
863859
return this._token_calculator.get_cached_token_count(file_path)
864860
}
865861

866-
public async calculate_file_tokens(
862+
async calculate_file_tokens(
867863
file_path: string
868864
): Promise<{ total: number; shrink: number }> {
869865
return this._token_calculator.calculate_file_tokens(file_path)
@@ -1018,7 +1014,7 @@ export class WorkspaceProvider
10181014
return items
10191015
}
10201016

1021-
public async update_checkbox_state(
1017+
async update_checkbox_state(
10221018
item: FileItem,
10231019
state: vscode.TreeItemCheckboxState
10241020
): Promise<void> {
@@ -1250,13 +1246,13 @@ export class WorkspaceProvider
12501246
}
12511247
}
12521248

1253-
public get_checkbox_state(path: string): vscode.TreeItemCheckboxState {
1249+
get_checkbox_state(path: string): vscode.TreeItemCheckboxState {
12541250
return (
12551251
this._checked_items.get(path) ?? vscode.TreeItemCheckboxState.Unchecked
12561252
)
12571253
}
12581254

1259-
public get_selected_files(): string[] {
1255+
get_selected_files(): string[] {
12601256
return Array.from(this._checked_items.entries())
12611257
.filter(
12621258
([file_path, state]) =>
@@ -1273,13 +1269,13 @@ export class WorkspaceProvider
12731269
.map(([path, _]) => path)
12741270
}
12751271

1276-
public get_all_selected_paths(): string[] {
1272+
get_all_selected_paths(): string[] {
12771273
return Array.from(this._checked_items.entries())
12781274
.filter(([, state]) => state == vscode.TreeItemCheckboxState.Checked)
12791275
.map(([path]) => path)
12801276
}
12811277

1282-
public async set_selected_files(
1278+
async set_selected_files(
12831279
file_paths: string[],
12841280
timestamps?: Map<string, number>
12851281
): Promise<void> {
@@ -1433,7 +1429,7 @@ export class WorkspaceProvider
14331429
this._dispatch_change_events()
14341430
}
14351431

1436-
public is_excluded(relative_path: string): boolean {
1432+
is_excluded(relative_path: string): boolean {
14371433
if (!relative_path || relative_path.trim() == '') {
14381434
return false
14391435
}
@@ -1472,7 +1468,7 @@ export class WorkspaceProvider
14721468
this._token_calculator.clear_caches()
14731469
}
14741470

1475-
public is_ignored_by_patterns(file_path: string): boolean {
1471+
is_ignored_by_patterns(file_path: string): boolean {
14761472
const workspace_root = this.get_workspace_root_for_file(file_path)
14771473
if (!workspace_root) {
14781474
const basename = path.basename(file_path)
@@ -1490,17 +1486,17 @@ export class WorkspaceProvider
14901486
return this._user_ignore_patterns.ignores(relative_path)
14911487
}
14921488

1493-
public is_partially_selected(path: string): boolean {
1489+
is_partially_selected(path: string): boolean {
14941490
return this._partially_selected_dirs.has(path)
14951491
}
14961492

1497-
public async get_selected_files_token_count(options?: {
1493+
async get_selected_files_token_count(options?: {
14981494
exclude_file_path?: string
14991495
}): Promise<{ total: number; shrink: number }> {
15001496
return this._token_calculator.get_selected_files_token_count(options)
15011497
}
15021498

1503-
public async find_all_files(root_path: string): Promise<string[]> {
1499+
async find_all_files(root_path: string): Promise<string[]> {
15041500
const files: string[] = []
15051501
const visited = new Set<string>()
15061502

@@ -1572,7 +1568,7 @@ export class WorkspaceProvider
15721568
return files
15731569
}
15741570

1575-
public async get_all_files_for_uri(uri: vscode.Uri): Promise<vscode.Uri[]> {
1571+
async get_all_files_for_uri(uri: vscode.Uri): Promise<vscode.Uri[]> {
15761572
try {
15771573
const stat = await vscode.workspace.fs.stat(uri)
15781574
if (stat.type & vscode.FileType.File) {
@@ -1614,7 +1610,7 @@ export class WorkspaceProvider
16141610
return []
16151611
}
16161612

1617-
public async update_workspace_folders(
1613+
async update_workspace_folders(
16181614
workspace_folders: readonly vscode.WorkspaceFolder[]
16191615
): Promise<void> {
16201616
const selected_paths = this.get_all_selected_paths()

0 commit comments

Comments
 (0)