diff --git a/src/app/editor/code-view/view.base.ts b/src/app/editor/code-view/view.base.ts index 7968d19..4b41fc6 100644 --- a/src/app/editor/code-view/view.base.ts +++ b/src/app/editor/code-view/view.base.ts @@ -178,11 +178,6 @@ export class CodeViewBase { } public closeFile() { - let message = new ServiceMessage(); - message.action = "close-file"; - message.rawData = this.editor.getSession(); - - this.lspManagerService.sendMessage(message); this.tabsService.closeTab(this.activeFile.path); } diff --git a/src/app/editor/editors.component.ts b/src/app/editor/editors.component.ts index f6b0b5e..a821f75 100644 --- a/src/app/editor/editors.component.ts +++ b/src/app/editor/editors.component.ts @@ -139,6 +139,7 @@ export class EditorsComponent { } } + activeComponent.lspManagerService.closeDocument(file.session); this.filesService.delete(file); } @@ -192,7 +193,7 @@ export class EditorsComponent { }); window.fs.onUpdateFilePath(async (path: string) => { - console.log(path); + console.log("TODO (onUpdateFilePath) :", path); // this.tabsService.sendMessage(message); // this.filesService.sendMessage(message); }); diff --git a/src/app/editor/lsp-manager/lsp-manager.component.ts b/src/app/editor/lsp-manager/lsp-manager.component.ts index 9928ec7..77724aa 100644 --- a/src/app/editor/lsp-manager/lsp-manager.component.ts +++ b/src/app/editor/lsp-manager/lsp-manager.component.ts @@ -98,12 +98,12 @@ export class LspManagerComponent { public registerEditorToLanguageClient() { this.lspManagerService.registerEditorToLSPClient(this.editor); - +/* this.lspManagerService.setSessionFilePath( this.editor.session, this.activeFile.path ); - +*/ } @@ -139,13 +139,17 @@ export class LspManagerComponent { } private editorUpdate(message: ServiceMessage) { + if (!message.rawData.activeFile) return; + this.editor.setSession(message.rawData.editor.getSession()) this.activeFile = message.rawData.activeFile; +/* this.lspManagerService.setSessionFilePath( this.editor.session, this.activeFile.path ); +*/ }