Wiring lsp config editor to update lspManagerService.lspConfigDataStr; removed redundant check; update lsp config

This commit is contained in:
itdominator 2025-07-19 02:13:52 -05:00
parent 79adb86d25
commit 90c8c9b3ee
3 changed files with 13 additions and 6 deletions

View File

@ -37,6 +37,7 @@
] ]
}, },
"configuration": { "configuration": {
"updateBuildConfiguration": "automatic",
"maven": { "maven": {
"userSettings": "{user.home}/.config/jdtls/settings.xml", "userSettings": "{user.home}/.config/jdtls/settings.xml",
"globalSettings": "{user.home}/.config/jdtls/settings.xml" "globalSettings": "{user.home}/.config/jdtls/settings.xml"

View File

@ -33,12 +33,13 @@ export class LspManagerService {
public registerEditorToLSPClient(editor: any) { public registerEditorToLSPClient(editor: any) {
let mode = this.getMode(editor.session); let mode = this.getMode(editor.session);
if ( this.languageProviders[mode] ) { this.languageProviders[mode]?.registerEditor(
this.languageProviders[mode].registerEditor(editor); editor,
return; {
filePath: editor.session["id"],
joinWorkspaceURI: true
} }
);
this.languageProviders[mode]?.registerEditor(editor);
} }
private getLspConfigData(): Promise<string> { private getLspConfigData(): Promise<string> {

View File

@ -55,6 +55,11 @@ export class LspManagerComponent {
this.lspTextEditor = this.lspEditorComponent.editor; this.lspTextEditor = this.lspEditorComponent.editor;
this.innerEditor = this.sessionEditorComponent.editor; this.innerEditor = this.sessionEditorComponent.editor;
this.lspTextEditor.on("input", () => {
this.lspManagerService.lspConfigDataStr =
this.lspTextEditor.session.getValue();
});
this.lspManagerService.loadLspConfigData().then((lspConfigData) => { this.lspManagerService.loadLspConfigData().then((lspConfigData) => {
this.lspTextEditor.session.setMode("ace/mode/json"); this.lspTextEditor.session.setMode("ace/mode/json");
this.lspTextEditor.session.setValue(lspConfigData); this.lspTextEditor.session.setValue(lspConfigData);