updating LSP service to load language servers dynamically
This commit is contained in:
@@ -5,12 +5,11 @@ import * as ace from 'ace-builds/src-noconflict/ace';
|
||||
import 'ace-builds/src-noconflict/theme-one_dark';
|
||||
import "ace-builds/src-noconflict/ext-language_tools";
|
||||
|
||||
import { EditorSettings } from "../../common/configs/editor.config";
|
||||
import { ServiceMessage } from '../../common/types/service-message.type';
|
||||
|
||||
import { EditorsService } from '../../common/services/editor/editors.service';
|
||||
import { LSPService } from '../../common/services/lsp.service';
|
||||
|
||||
import { EditorSettings } from "../../common/configs/editor.config";
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -49,13 +48,19 @@ export class AceEditorComponent {
|
||||
this.editor.setOptions( this.editorSettings.CONFIG );
|
||||
// this.editor.commands.addCommands( this.editorSettings.KEYBINDINGS );
|
||||
|
||||
// Note: https://github.com/mkslanc/ace-linters/blob/c286d85c558530aa1b0597d02108bc782abd4736/packages/ace-linters/src/language-provider.ts#L277
|
||||
// found on focus ^ might have other signals we can watch like session being set, etc.
|
||||
this.editor.on("focus", () => {
|
||||
this.editorsService.setActiveEditor(this.uuid);
|
||||
});
|
||||
|
||||
// this.editor.on("changeSession", (session) => {
|
||||
// console.log(session);
|
||||
// console.log(session.session["$modeId"]);
|
||||
// });
|
||||
}
|
||||
|
||||
public registerEditorToLSP() {
|
||||
public registerEditorToLSPMode() {
|
||||
this.lspService.registerEditor(this.editor);
|
||||
}
|
||||
|
||||
|
@@ -86,7 +86,7 @@ export class EditorsComponent {
|
||||
let editorComponent = this.editors.get(this.activeEditor)?.instance;
|
||||
let editor = editorComponent.editor;
|
||||
editor?.setSession(session);
|
||||
// editorComponent.registerEditorToLSP();
|
||||
editorComponent.registerEditorToLSPMode();
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user