Making methods explicitly private, public, or protected

This commit is contained in:
2025-06-21 19:49:58 -05:00
parent dae0cd9516
commit 5965bb7552
11 changed files with 81 additions and 61 deletions

View File

@@ -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();
}

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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();
}
}

View File

@@ -13,10 +13,12 @@ export class LSPService {
lspConfigData!: {};
languageProviders: {} = {};
constructor() {
this.loadLSPService();
}
private loadLSPService() {
this.getLspConfigData().then((lspConfigData: string) => {
this.lspConfigData = JSON.parse(lspConfigData);