From 5965bb7552f953b92c2ca943985d470718ef0865 Mon Sep 17 00:00:00 2001
From: itdominator <1itdominator@gmail.com>
Date: Sat, 21 Jun 2025 19:49:58 -0500
Subject: [PATCH] Making methods explicitly private, public, or protected

---
 .../common/services/editor/editors.service.ts | 10 +++---
 .../common/services/editor/files.service.ts   | 23 +++++++-----
 .../editor/info-bar/info-bar.service.ts       | 20 +++++------
 .../editor/modals/files-modal.service.ts      |  8 ++---
 .../services/editor/tabs/tabs.service.ts      |  4 +--
 src/app/common/services/lsp.service.ts        |  2 ++
 src/app/editor/editors.component.ts           |  8 ++---
 src/app/editor/info-bar/info-bar.component.ts |  4 +--
 .../editor/modals/files-modal.component.ts    | 16 ++++-----
 .../newton-editor/newton-editor.component.ts  | 12 +++++--
 src/app/editor/tabs/tabs.component.ts         | 35 ++++++++++---------
 11 files changed, 81 insertions(+), 61 deletions(-)

diff --git a/src/app/common/services/editor/editors.service.ts b/src/app/common/services/editor/editors.service.ts
index e84728b..579d408 100644
--- a/src/app/common/services/editor/editors.service.ts
+++ b/src/app/common/services/editor/editors.service.ts
@@ -24,24 +24,24 @@ export class EditorsService {
     }
 
 
-    getEditorsAsArray(): ComponentRef<NewtonEditorComponent>[] {
+    public getEditorsAsArray(): ComponentRef<NewtonEditorComponent>[] {
         return [...this.editors.values()];
     }
 
-    get(uuid: string): NewtonEditorComponent {
+    public get(uuid: string): NewtonEditorComponent {
         return this.editors.get(uuid).instance;
     }
 
-    set(uuid: string, component: ComponentRef<NewtonEditorComponent>) {
+    public set(uuid: string, component: ComponentRef<NewtonEditorComponent>) {
         this.editors.set(uuid, component);
     }
 
 
-    sendMessage(data: ServiceMessage): void {
+    public sendMessage(data: ServiceMessage): void {
         this.messageSubject.next(data);
     }
 
-    getMessage$(): Observable<ServiceMessage> {
+    public getMessage$(): Observable<ServiceMessage> {
         return this.messageSubject.asObservable();
     }
 
diff --git a/src/app/common/services/editor/files.service.ts b/src/app/common/services/editor/files.service.ts
index 908239d..eaece12 100644
--- a/src/app/common/services/editor/files.service.ts
+++ b/src/app/common/services/editor/files.service.ts
@@ -27,29 +27,31 @@ export class FilesService {
     }
 
 
-    get(path: string): NewtonFile {
+    public get(path: string): NewtonFile {
         return this.files.get(path);
     }
 
-    delete(file: NewtonFile) {
+    public delete(file: NewtonFile) {
         file.session.destroy();
         window.fs.closeFile(file.path);
         this.files.delete(file.path);
     }
 
-    set(file: NewtonFile) {
+    public set(file: NewtonFile) {
         this.files.set(file.path, file);
     }
 
-    sendMessage(data: ServiceMessage): void {
+    public sendMessage(data: ServiceMessage): void {
         this.messageSubject.next(data);
     }
 
-    getMessage$(): Observable<ServiceMessage> {
+    public getMessage$(): Observable<ServiceMessage> {
         return this.messageSubject.asObservable();
     }
 
-    async loadFilesList(files: Array<NewtonFile>): Promise<NewtonFile | undefined | null> {
+    public async loadFilesList(
+        files: Array<NewtonFile>
+    ): Promise<NewtonFile | undefined | null> {
 	    for (let i = 0; i < files.length; i++) {
 		    const file = files[i];
 		    const path = window.fs.getPathForFile(file);
@@ -64,7 +66,12 @@ export class FilesService {
 	    return files[ files.length - 1 ];
     }
 
-    async addFile(path: string, file: NewtonFile, loadFileContents: boolean = true, data: string = ""): Promise<void> {
+    public async addFile(
+        path: string,
+        file: NewtonFile,
+        loadFileContents: boolean = true,
+        data: string = ""
+    ): Promise<void> {
 	    try {
 	        let pathParts = path.split("/");
 	        file.fname    = pathParts[ pathParts.length - 1 ];
@@ -87,7 +94,7 @@ export class FilesService {
 	    }
     }
 
-    async addTab(file: NewtonFile) {
+    public async addTab(file: NewtonFile) {
         let message      = new ServiceMessage();
         message.action   = "create-tab";
         message.fileName = file.fname;
diff --git a/src/app/common/services/editor/info-bar/info-bar.service.ts b/src/app/common/services/editor/info-bar/info-bar.service.ts
index fed6037..26552d7 100644
--- a/src/app/common/services/editor/info-bar/info-bar.service.ts
+++ b/src/app/common/services/editor/info-bar/info-bar.service.ts
@@ -18,43 +18,43 @@ export class InfoBarService {
     constructor() {}
 
 
-    setData(data: ServiceMessage): void {
+    public setData(data: ServiceMessage): void {
         this.dataSubject.next(data);
     }
 
-    getData$(): Observable<ServiceMessage> {
+    public getData$(): Observable<ServiceMessage> {
         return this.dataSubject.asObservable();
     }
 
-    setInfoBarFPath(data: string): void {
+    public setInfoBarFPath(data: string): void {
         this.fpathSubject.next(data);
     }
 
-    updateInfoBarFPath$(): Observable<string> {
+    public updateInfoBarFPath$(): Observable<string> {
         return this.fpathSubject.asObservable();
     }
 
-    setInfoBarCursorPos(data: any): void {
+    public setInfoBarCursorPos(data: any): void {
         this.cursorPosSubject.next(data);
     }
 
-    updateInfoBarCursorPos$(): Observable<any> {
+    public updateInfoBarCursorPos$(): Observable<any> {
         return this.cursorPosSubject.asObservable();
     }
 
-    setInfoBarEncodeing(data: string): void {
+    public setInfoBarEncodeing(data: string): void {
         this.encodeingSubject.next(data);
     }
 
-    updateInfoBarEncodeing$(): Observable<string> {
+    public updateInfoBarEncodeing$(): Observable<string> {
         return this.encodeingSubject.asObservable();
     }
 
-   setInfoBarFType(data: string): void {
+   public setInfoBarFType(data: string): void {
         this.ftypeSubject.next(data);
     }
 
-    updateInfoBarFType$(): Observable<string> {
+    public updateInfoBarFType$(): Observable<string> {
         return this.ftypeSubject.asObservable();
     }
 
diff --git a/src/app/common/services/editor/modals/files-modal.service.ts b/src/app/common/services/editor/modals/files-modal.service.ts
index d25db9c..3fc1e19 100644
--- a/src/app/common/services/editor/modals/files-modal.service.ts
+++ b/src/app/common/services/editor/modals/files-modal.service.ts
@@ -15,19 +15,19 @@ export class FilesModalService {
     }
 
 
-    showFilesModal(): void {
+    public showFilesModal(): void {
         this.showFilesModalSubject.next(null);
     }
 
-    showFilesModalRequested$(): Observable<null> {
+    public showFilesModalRequested$(): Observable<null> {
         return this.showFilesModalSubject.asObservable();
     }
 
-    addFileToModal(data: string): void {
+    public addFileToModal(data: string): void {
         this.addFileSubject.next(data);
     }
 
-    addFileToModalRequested$(): Observable<string> {
+    public addFileToModalRequested$(): Observable<string> {
         return this.addFileSubject.asObservable();
     }
 
diff --git a/src/app/common/services/editor/tabs/tabs.service.ts b/src/app/common/services/editor/tabs/tabs.service.ts
index 26a118d..cf04e7e 100644
--- a/src/app/common/services/editor/tabs/tabs.service.ts
+++ b/src/app/common/services/editor/tabs/tabs.service.ts
@@ -13,11 +13,11 @@ export class TabsService {
     constructor() {}
 
 
-    sendMessage(data: ServiceMessage): void {
+    public sendMessage(data: ServiceMessage): void {
         this.messageSubject.next(data);
     }
 
-    getMessage$(): Observable<ServiceMessage> {
+    public getMessage$(): Observable<ServiceMessage> {
         return this.messageSubject.asObservable();
     }
 }
\ No newline at end of file
diff --git a/src/app/common/services/lsp.service.ts b/src/app/common/services/lsp.service.ts
index 6656ca8..2816e67 100644
--- a/src/app/common/services/lsp.service.ts
+++ b/src/app/common/services/lsp.service.ts
@@ -13,10 +13,12 @@ export class LSPService {
     lspConfigData!: {};
     languageProviders: {} = {};
 
+
     constructor() {
         this.loadLSPService();
     }
 
+
     private loadLSPService() {
         this.getLspConfigData().then((lspConfigData: string) => {
             this.lspConfigData = JSON.parse(lspConfigData);
diff --git a/src/app/editor/editors.component.ts b/src/app/editor/editors.component.ts
index 8844ea8..ebd0f9e 100644
--- a/src/app/editor/editors.component.ts
+++ b/src/app/editor/editors.component.ts
@@ -41,7 +41,7 @@ export class EditorsComponent {
     }
 
 
-    public ngAfterViewInit(): void {
+    private ngAfterViewInit(): void {
         this.loadSubscribers();
         this.loadMainSubscribers();
 
@@ -54,12 +54,12 @@ export class EditorsComponent {
         rightEditor.instance.leftSiblingUUID = leftEditor.instance.uuid;
     }
 
-    ngOnDestroy() {
+    private ngOnDestroy() {
         this.unsubscribe.next();
         this.unsubscribe.complete();
     }
 
-    loadSubscribers() {
+    private loadSubscribers() {
 
         this.editorsService.getMessage$().pipe(
             takeUntil(this.unsubscribe)
@@ -133,7 +133,7 @@ export class EditorsComponent {
 
     }
 
-    loadMainSubscribers() {
+    private loadMainSubscribers() {
         window.fs.onLoadFiles(async (paths: []) => {
             for (let i = 0; i < paths.length; i++) {
                 let file = new File([], "") as NewtonFile;
diff --git a/src/app/editor/info-bar/info-bar.component.ts b/src/app/editor/info-bar/info-bar.component.ts
index 2c9cf3e..32e2e74 100644
--- a/src/app/editor/info-bar/info-bar.component.ts
+++ b/src/app/editor/info-bar/info-bar.component.ts
@@ -31,12 +31,12 @@ export class InfoBarComponent {
     constructor() {}
 
 
-    public ngAfterViewInit(): void {
+    private ngAfterViewInit(): void {
         this.loadSubscribers();
     }
 
 
-    loadSubscribers() {
+    private loadSubscribers() {
 
         this.infoBarService.updateInfoBarFPath$().pipe(
             takeUntil(this.unsubscribe)
diff --git a/src/app/editor/modals/files-modal.component.ts b/src/app/editor/modals/files-modal.component.ts
index 9e580c0..c154394 100644
--- a/src/app/editor/modals/files-modal.component.ts
+++ b/src/app/editor/modals/files-modal.component.ts
@@ -38,11 +38,11 @@ export class FilesModalComponent {
     }
 
 
-    public ngAfterViewInit(): void {
+    private ngAfterViewInit(): void {
         this.loadSubscribers();
     }
 
-    loadSubscribers() {
+    private loadSubscribers() {
         this.tabsService.getMessage$().pipe(
             takeUntil(this.unsubscribe)
         ).subscribe((data: ServiceMessage) => {
@@ -70,15 +70,15 @@ export class FilesModalComponent {
         });
     }
 
-    private createFileRow(title: string, uuid: string, path: string): void {
-        this.files.push({title: title, uuid: uuid, path: path})
-    }
-
-    createModal() {
+    private createModal() {
         this.filesModal = new bootstrap.Modal("#filesModal", {});
     }
 
-    showModal() {
+    public createFileRow(title: string, uuid: string, path: string): void {
+        this.files.push({title: title, uuid: uuid, path: path})
+    }
+
+    public showModal() {
         this.filesModal?.toggle();
     }
 
diff --git a/src/app/editor/newton-editor/newton-editor.component.ts b/src/app/editor/newton-editor/newton-editor.component.ts
index fb2053d..1e31eb2 100644
--- a/src/app/editor/newton-editor/newton-editor.component.ts
+++ b/src/app/editor/newton-editor/newton-editor.component.ts
@@ -35,7 +35,7 @@ export class NewtonEditorComponent extends NewtonEditorBase {
     }
 
 
-    public ngAfterViewInit(): void {
+    private ngAfterViewInit(): void {
         if (this.isDefault) {
             this.addActiveStyling();
         }
@@ -43,12 +43,17 @@ export class NewtonEditorComponent extends NewtonEditorBase {
         this.loadAce();
     }
 
-    public loadAce(): void {
+    private loadAce(): void {
         ace.config.set('basePath', this.editorSettings.BASE_PATH);
 
         this.editor = ace.edit( this.editorElm.nativeElement );
         this.editor.setOptions( this.editorSettings.CONFIG );
 
+        this.loadAceKeyBindings();
+        this.loadAceEventBindings();
+    }
+
+    private loadAceKeyBindings(): void {
         let keyBindings = [];
         for (let i = 0; i < this.editorSettings.KEYBINDINGS.length; i++) {
             let keyBinding = this.editorSettings.KEYBINDINGS[i];
@@ -78,6 +83,9 @@ export class NewtonEditorComponent extends NewtonEditorBase {
         }
 
         this.editor.commands.addCommands( keyBindings );
+    }
+
+    private loadAceEventBindings(): void {
 
         // Note:  https://ajaxorg.github.io/ace-api-docs/interfaces/ace.Ace.EditorEvents.html
         this.editor.on("focus", (e) => {
diff --git a/src/app/editor/tabs/tabs.component.ts b/src/app/editor/tabs/tabs.component.ts
index 561bb7e..7b750ff 100644
--- a/src/app/editor/tabs/tabs.component.ts
+++ b/src/app/editor/tabs/tabs.component.ts
@@ -39,7 +39,16 @@ export class TabsComponent {
     constructor() {
     }
 
-    public ngAfterViewInit(): void {
+    private ngAfterViewInit(): void {
+        this.loadSubscribers();
+    }
+
+    private ngOnDestroy(): void {
+        this.unsubscribe.next();
+        this.unsubscribe.complete();
+    }
+
+    private loadSubscribers() {
         this.tabsService.getMessage$().pipe(
             takeUntil(this.unsubscribe)
         ).subscribe((message: ServiceMessage) => {
@@ -61,17 +70,7 @@ export class TabsComponent {
         });
     }
 
-    ngOnDestroy(): void {
-        this.unsubscribe.next();
-        this.unsubscribe.complete();
-    }
-
-    private createTab(title: string, uuid: string, path: string): void {
-        this.tabs.push({title: title, uuid: uuid, path: path});
-        this.changeDetectorRef.detectChanges();
-    }
-
-    handleAction(event: any): void {
+    protected handleAction(event: any): void {
         let target = event.target;
 
         if ( target.classList.contains("tab") ) {
@@ -93,7 +92,12 @@ export class TabsComponent {
 
     }
 
-    closeTab(fpath: string): void {
+    public createTab(title: string, uuid: string, path: string): void {
+        this.tabs.push({title: title, uuid: uuid, path: path});
+        this.changeDetectorRef.detectChanges();
+    }
+
+    public closeTab(fpath: string): void {
         this.sendEditorsServiceAMessage("close-tab", fpath);
 
         for (let i = 0; i < this.tabs.length; i++) {
@@ -104,8 +108,7 @@ export class TabsComponent {
 
     }
 
-
-    moved(event: any): void {
+    private moved(event: any): void {
         let target = event.event.target;
         let fpath  = "";
 
@@ -125,7 +128,7 @@ export class TabsComponent {
 
     }
 
-    dropped(event: CdkDragDrop<any>): void {
+    protected dropped(event: CdkDragDrop<any>): void {
         if (this.newIndex == -1) return;
 
         moveItemInArray(this.tabs, event.previousIndex, this.newIndex);