WIP lsp-manager effort 3
This commit is contained in:
parent
f463970b6b
commit
f8d9c3f31b
@ -8,14 +8,15 @@
|
|||||||
"command": "lsp-ws-proxy --listen 4114 -- jdtls",
|
"command": "lsp-ws-proxy --listen 4114 -- jdtls",
|
||||||
"alt-command": "lsp-ws-proxy -- jdtls",
|
"alt-command": "lsp-ws-proxy -- jdtls",
|
||||||
"alt-command2": "java-language-server",
|
"alt-command2": "java-language-server",
|
||||||
"socket": "ws://127.0.0.1:4114/?name=jdtls",
|
"socket": "ws://127.0.0.1:4114/java",
|
||||||
"alt-socket": "ws://127.0.0.1:3030/?name=java-language-server",
|
"socket-two": "ws://127.0.0.1:4114/?name=jdtls",
|
||||||
|
"alt-socket": "ws://127.0.0.1:9999/?name=java-language-server",
|
||||||
"initialization-options": {
|
"initialization-options": {
|
||||||
"bundles": [
|
"bundles": [
|
||||||
"intellicode-core.jar"
|
"intellicode-core.jar"
|
||||||
],
|
],
|
||||||
"workspaceFolders": [
|
"workspaceFolders": [
|
||||||
"file://"
|
"file://{workspace.folder}"
|
||||||
],
|
],
|
||||||
"extendedClientCapabilities": {
|
"extendedClientCapabilities": {
|
||||||
"classFileContentsSupport": true,
|
"classFileContentsSupport": true,
|
||||||
@ -150,7 +151,8 @@
|
|||||||
"alt-command": "pylsp",
|
"alt-command": "pylsp",
|
||||||
"alt-command2": "lsp-ws-proxy --listen 4114 -- pylsp",
|
"alt-command2": "lsp-ws-proxy --listen 4114 -- pylsp",
|
||||||
"alt-command3": "pylsp --ws --port 4114",
|
"alt-command3": "pylsp --ws --port 4114",
|
||||||
"socket": "ws://127.0.0.1:9999/?name=pylsp",
|
"socket": "ws://127.0.0.1:9999/python",
|
||||||
|
"socket-two": "ws://127.0.0.1:9999/?name=pylsp",
|
||||||
"initialization-options": {
|
"initialization-options": {
|
||||||
"pyls": {
|
"pyls": {
|
||||||
"plugins": {
|
"plugins": {
|
||||||
@ -215,7 +217,7 @@
|
|||||||
"extra_paths": [
|
"extra_paths": [
|
||||||
"{user.home}/Portable_Apps/py-venvs/pylsp-venv/venv/lib/python3.10/site-packages"
|
"{user.home}/Portable_Apps/py-venvs/pylsp-venv/venv/lib/python3.10/site-packages"
|
||||||
],
|
],
|
||||||
"root_dir": ""
|
"root_dir": "file://{workspace.folder}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,7 +228,8 @@
|
|||||||
"info": "https://pypi.org/project/jedi-language-server/",
|
"info": "https://pypi.org/project/jedi-language-server/",
|
||||||
"command": "jedi-language-server",
|
"command": "jedi-language-server",
|
||||||
"alt-command": "lsp-ws-proxy --listen 3030 -- jedi-language-server",
|
"alt-command": "lsp-ws-proxy --listen 3030 -- jedi-language-server",
|
||||||
"socket": "ws://127.0.0.1:3030/?name=jedi-language-server",
|
"socket": "ws://127.0.0.1:9999/python",
|
||||||
|
"socket-two": "ws://127.0.0.1:9999/?name=jedi-language-server",
|
||||||
"initialization-options": {
|
"initialization-options": {
|
||||||
"jediSettings": {
|
"jediSettings": {
|
||||||
"autoImportModules": [],
|
"autoImportModules": [],
|
||||||
@ -255,28 +258,8 @@
|
|||||||
"info": "https://clangd.llvm.org/",
|
"info": "https://clangd.llvm.org/",
|
||||||
"command": "lsp-ws-proxy -- clangd",
|
"command": "lsp-ws-proxy -- clangd",
|
||||||
"alt-command": "clangd",
|
"alt-command": "clangd",
|
||||||
"socket": "ws://127.0.0.1:3030/?name=clangd",
|
"socket": "ws://127.0.0.1:9999/cpp",
|
||||||
"initialization-options": {}
|
"socket-two": "ws://127.0.0.1:9999/?name=clangd",
|
||||||
},
|
|
||||||
"sh": {
|
|
||||||
"info": "",
|
|
||||||
"command": "",
|
|
||||||
"alt-command": "",
|
|
||||||
"socket": "ws://127.0.0.1:3030/?name=shell",
|
|
||||||
"initialization-options": {}
|
|
||||||
},
|
|
||||||
"go": {
|
|
||||||
"info": "https://pkg.go.dev/golang.org/x/tools/gopls#section-readme",
|
|
||||||
"command": "lsp-ws-proxy -- gopls",
|
|
||||||
"alt-command": "gopls",
|
|
||||||
"socket": "ws://127.0.0.1:3030/?name=gopls",
|
|
||||||
"initialization-options": {}
|
|
||||||
},
|
|
||||||
"lua": {
|
|
||||||
"info": "https://github.com/LuaLS/lua-language-server",
|
|
||||||
"command": "lsp-ws-proxy -- lua-language-server",
|
|
||||||
"alt-command": "lua-language-server",
|
|
||||||
"socket": "ws://127.0.0.1:3030/?name=gopls",
|
|
||||||
"initialization-options": {}
|
"initialization-options": {}
|
||||||
},
|
},
|
||||||
"c": {
|
"c": {
|
||||||
@ -284,7 +267,40 @@
|
|||||||
"info": "https://clangd.llvm.org/",
|
"info": "https://clangd.llvm.org/",
|
||||||
"command": "lsp-ws-proxy -- clangd",
|
"command": "lsp-ws-proxy -- clangd",
|
||||||
"alt-command": "clangd",
|
"alt-command": "clangd",
|
||||||
"socket": "ws://127.0.0.1:3030/?name=clangd",
|
"socket": "ws://127.0.0.1:9999/c",
|
||||||
|
"socket-two": "ws://127.0.0.1:9999/?name=clangd",
|
||||||
|
"initialization-options": {}
|
||||||
|
},
|
||||||
|
"go": {
|
||||||
|
"info": "https://pkg.go.dev/golang.org/x/tools/gopls#section-readme",
|
||||||
|
"command": "lsp-ws-proxy -- gopls",
|
||||||
|
"alt-command": "gopls",
|
||||||
|
"socket": "ws://127.0.0.1:9999/go",
|
||||||
|
"socket-two": "ws://127.0.0.1:9999/?name=gopls",
|
||||||
|
"initialization-options": {}
|
||||||
|
},
|
||||||
|
"typescript": {
|
||||||
|
"info": "https://github.com/typescript-language-server/typescript-language-server",
|
||||||
|
"command": "lsp-ws-proxy -- typescript-language-server",
|
||||||
|
"alt-command": "typescript-language-server --stdio",
|
||||||
|
"socket": "ws://127.0.0.1:9999/typescript",
|
||||||
|
"socket-two": "ws://127.0.0.1:9999/?name=ts",
|
||||||
|
"initialization-options": {}
|
||||||
|
},
|
||||||
|
"sh": {
|
||||||
|
"info": "",
|
||||||
|
"command": "",
|
||||||
|
"alt-command": "",
|
||||||
|
"socket": "ws://127.0.0.1:9999/bash",
|
||||||
|
"socket-two": "ws://127.0.0.1:9999/?name=shell",
|
||||||
|
"initialization-options": {}
|
||||||
|
},
|
||||||
|
"lua": {
|
||||||
|
"info": "https://github.com/LuaLS/lua-language-server",
|
||||||
|
"command": "lsp-ws-proxy -- lua-language-server",
|
||||||
|
"alt-command": "lua-language-server",
|
||||||
|
"socket": "ws://127.0.0.1:9999/lua",
|
||||||
|
"socket-two": "ws://127.0.0.1:9999/?name=lua",
|
||||||
"initialization-options": {}
|
"initialization-options": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -31,7 +31,7 @@ export class PaneHandleDirective {
|
|||||||
!target.classList.contains("hr-pane-handle") &&
|
!target.classList.contains("hr-pane-handle") &&
|
||||||
!target.classList.contains("vr-pane-handle")
|
!target.classList.contains("vr-pane-handle")
|
||||||
) {
|
) {
|
||||||
console.log("Must have 'hr-pane-handle' or 'vr-pane-handle' in classList!");
|
console.error("Must have 'hr-pane-handle' or 'vr-pane-handle' in classList!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@ import { ServiceMessage } from '../../../types/service-message.type';
|
|||||||
export class LspManagerService {
|
export class LspManagerService {
|
||||||
private messageSubject: ReplaySubject<ServiceMessage> = new ReplaySubject<ServiceMessage>(1);
|
private messageSubject: ReplaySubject<ServiceMessage> = new ReplaySubject<ServiceMessage>(1);
|
||||||
|
|
||||||
lspConfigData!: {};
|
workspaceFolder: string = "";
|
||||||
languageProviders: {} = {};
|
lspConfigDataStr: string = "";
|
||||||
workspaceFolder: string = "";
|
languageProviders: {} = {};
|
||||||
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -25,55 +25,79 @@ export class LspManagerService {
|
|||||||
|
|
||||||
public loadLspConfigData(): Promise<string | void> {
|
public loadLspConfigData(): Promise<string | void> {
|
||||||
return this.getLspConfigData().then((lspConfigData: string) => {
|
return this.getLspConfigData().then((lspConfigData: string) => {
|
||||||
this.lspConfigData = JSON.parse(lspConfigData);
|
this.lspConfigDataStr = lspConfigData;
|
||||||
|
|
||||||
if (this.lspConfigData["message"]) {
|
|
||||||
console.log(
|
|
||||||
"Warning: LSP this.lspConfigData is a 'message'",
|
|
||||||
this.lspConfigData
|
|
||||||
);
|
|
||||||
|
|
||||||
this.lspConfigData = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
return lspConfigData;
|
return lspConfigData;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public registerEditor(editor: any): void {
|
public registerEditorToLSPClient(editor: any): void {
|
||||||
let modeParts = editor.session.getMode()["$Id"].split("/");
|
let mode = this.getMode(editor.session);
|
||||||
let mode = modeParts[ modeParts.length - 1 ];
|
|
||||||
|
|
||||||
if ( !this.languageProviders[mode] ) {
|
if ( this.languageProviders[mode] ) {
|
||||||
this.languageProviders[mode] = this.getLanguageProviderWithClientServer(mode);
|
this.languageProviders[mode].registerEditor(editor);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.languageProviders[mode].registerEditor(editor);
|
this.languageProviders[mode]?.registerEditor(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private getLspConfigData(): Promise<string> {
|
private getLspConfigData(): Promise<string> {
|
||||||
return window.fs.getLspConfigData();
|
return window.fs.getLspConfigData();
|
||||||
}
|
}
|
||||||
|
|
||||||
private getLanguageProviderWithClientServer(mode: string) {
|
private parseAndReturnLSPConfigData() {
|
||||||
let _initializationOptions = {};
|
let configData = JSON.parse(
|
||||||
|
this.lspConfigDataStr.replaceAll("{workspace.folder}", this.workspaceFolder)
|
||||||
|
);
|
||||||
|
|
||||||
if ( Object.keys(this.lspConfigData).length !== 0 && this.lspConfigData[mode] ) {
|
if (configData["message"]) {
|
||||||
_initializationOptions = this.lspConfigData[mode]["initialization-options"];
|
console.warn(
|
||||||
|
"Warning: LSP this.lspConfigDataStr is a 'message'",
|
||||||
|
this.lspConfigDataStr
|
||||||
|
);
|
||||||
|
|
||||||
|
configData = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
let servers: LanguageClientConfig[] = [
|
return configData;
|
||||||
{
|
}
|
||||||
module: () => import("ace-linters/build/language-client"),
|
|
||||||
modes: mode,
|
|
||||||
type: "socket",
|
|
||||||
socket: new WebSocket(`ws://127.0.0.1:9999/${mode}`),
|
|
||||||
// socket: new WebSocket("ws://127.0.0.1:9999/?name=pylsp"),
|
|
||||||
initializationOptions: _initializationOptions
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
return AceLanguageClient.for(servers);
|
private getInitializationOptions(mode: string, configData: {}) {
|
||||||
|
let _initializationOptions = {};
|
||||||
|
|
||||||
|
if ( Object.keys(configData).length !== 0 && configData[mode] ) {
|
||||||
|
_initializationOptions = configData[mode]["initialization-options"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return _initializationOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public createLanguageProviderWithClientServer(mode: string) {
|
||||||
|
if ( this.languageProviders[mode] ) return;
|
||||||
|
let servers: LanguageClientConfig[] = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
let configData = this.parseAndReturnLSPConfigData();
|
||||||
|
let _initializationOptions = this.getInitializationOptions(mode, configData);
|
||||||
|
servers = [
|
||||||
|
{
|
||||||
|
module: () => import("ace-linters/build/language-client"),
|
||||||
|
modes: mode,
|
||||||
|
type: "socket",
|
||||||
|
socket: new WebSocket( configData[mode]["socket"] ),
|
||||||
|
initializationOptions: _initializationOptions
|
||||||
|
}
|
||||||
|
];
|
||||||
|
} catch(error) {
|
||||||
|
console.error(
|
||||||
|
"Error: Language Server could not be loaded OR doesn't exist in Newton-LSP config setup...",
|
||||||
|
);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.languageProviders[mode] = AceLanguageClient.for(servers);
|
||||||
|
return this.languageProviders[mode];
|
||||||
}
|
}
|
||||||
|
|
||||||
private getLanguageProviderWithWebWorker() {
|
private getLanguageProviderWithWebWorker() {
|
||||||
@ -81,16 +105,20 @@ export class LspManagerService {
|
|||||||
return LanguageProvider.create(worker);
|
return LanguageProvider.create(worker);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected setSessionFilePath(session: any, filePath: string = "") {
|
public setSessionFilePath(session: any, filePath: string = "") {
|
||||||
if ( !session || !filePath ) return;
|
if ( !session || !filePath ) return;
|
||||||
let mode = session.getMode()["$Id"];
|
let mode = this.getMode(session);
|
||||||
if ( !this.languageProviders[mode] ) return;
|
if ( !this.languageProviders[mode] ) return;
|
||||||
this.languageProviders[mode].setSessionFilePath(session, filePath);
|
this.languageProviders[mode].setSessionFilePath(session, filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected closeDocument(session: any) {
|
public getMode(session: any) {
|
||||||
|
return session.getMode()["$id"].replace("ace/mode/", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public closeDocument(session: any) {
|
||||||
if ( !session ) return;
|
if ( !session ) return;
|
||||||
let mode = session.getMode()["$Id"];
|
let mode = this.getMode(session);
|
||||||
if ( !this.languageProviders[mode] ) return;
|
if ( !this.languageProviders[mode] ) return;
|
||||||
this.languageProviders[mode].closeDocument(session);
|
this.languageProviders[mode].closeDocument(session);
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,7 @@ export class FilesService {
|
|||||||
): Promise<NewtonFile | undefined | null> {
|
): Promise<NewtonFile | undefined | null> {
|
||||||
for (let i = 0; i < files.length; i++) {
|
for (let i = 0; i < files.length; i++) {
|
||||||
const file = files[i];
|
const file = files[i];
|
||||||
|
// const path = window.fs.getPathForFile(file).replace("file://", "");
|
||||||
const path = window.fs.getPathForFile(file);
|
const path = window.fs.getPathForFile(file);
|
||||||
|
|
||||||
if (!file || !path) continue;
|
if (!file || !path) continue;
|
||||||
@ -95,7 +96,7 @@ export class FilesService {
|
|||||||
|
|
||||||
this.files.set(file.path, file);
|
this.files.set(file.path, file);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(
|
console.error(
|
||||||
`---- Error ----\nPath: ${path}\nMessage: ${error}`
|
`---- Error ----\nPath: ${path}\nMessage: ${error}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -178,6 +178,11 @@ export class CodeViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public closeFile() {
|
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);
|
this.tabsService.closeTab(this.activeFile.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,11 +128,11 @@ export class CodeViewComponent extends CodeViewBase {
|
|||||||
|
|
||||||
this.editorsService.sendMessage(message);
|
this.editorsService.sendMessage(message);
|
||||||
this.searchReplaceService.sendMessage(message);
|
this.searchReplaceService.sendMessage(message);
|
||||||
this.lspManagerService.sendMessage(message);
|
|
||||||
|
|
||||||
message = new ServiceMessage();
|
message = new ServiceMessage();
|
||||||
message.action = "set-active-editor";
|
message.action = "set-active-editor";
|
||||||
message.rawData = this;
|
message.rawData = this;
|
||||||
|
this.lspManagerService.sendMessage(message);
|
||||||
this.markdownPreviewService.sendMessage(message);
|
this.markdownPreviewService.sendMessage(message);
|
||||||
|
|
||||||
this.updateInfoBar();
|
this.updateInfoBar();
|
||||||
@ -176,8 +176,8 @@ export class CodeViewComponent extends CodeViewBase {
|
|||||||
|
|
||||||
this.editor.on("changeSession", (session) => {
|
this.editor.on("changeSession", (session) => {
|
||||||
let message = new ServiceMessage();
|
let message = new ServiceMessage();
|
||||||
message.action = "set-active-editor";
|
message.action = "editor-update";
|
||||||
message.rawData = this.editor;
|
message.rawData = this;
|
||||||
|
|
||||||
this.lspManagerService.sendMessage(message);
|
this.lspManagerService.sendMessage(message);
|
||||||
|
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
<div class="row mt-2 mb-3">
|
<div class="row mt-2 mb-3">
|
||||||
|
|
||||||
|
<div class="col col-auto">
|
||||||
|
<button class="btn btn-sm btn-dark" (click)="createLanguageClient()">Create Language Client</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col clear-right-padding">
|
<div class="col clear-right-padding">
|
||||||
<div class="input-group-sm">
|
<div class="input-group-sm">
|
||||||
<label class="form-control" [innerText]="lspManagerService.workspaceFolder || 'Project Path...'">
|
<label class="form-control" [innerText]="lspManagerService.workspaceFolder || 'Project Path...'">
|
||||||
@ -36,7 +40,13 @@
|
|||||||
|
|
||||||
<div class="row mt-2 md-2">
|
<div class="row mt-2 md-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
Target Editor: <label [innerText]="editor?.id || 'Editor...'"></label>
|
Target Editor: <label [innerText]="editor?.id || '...'"></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<button class="btn btn-sm btn-dark"
|
||||||
|
(click)="registerEditorToLanguageClient()">
|
||||||
|
Register Editor To LSP
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
Active Editor Session:
|
Active Editor Session:
|
||||||
|
@ -34,6 +34,7 @@ export class LspManagerComponent {
|
|||||||
lspTextEditor: any;
|
lspTextEditor: any;
|
||||||
innerEditor: any;
|
innerEditor: any;
|
||||||
editor: any;
|
editor: any;
|
||||||
|
activeFile: any;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -43,6 +44,16 @@ export class LspManagerComponent {
|
|||||||
|
|
||||||
|
|
||||||
private ngAfterViewInit(): void {
|
private ngAfterViewInit(): void {
|
||||||
|
this.mapEditorsAndLoadConfig();
|
||||||
|
this.loadSubscribers();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ngOnDestroy() {
|
||||||
|
this.unsubscribe.next();
|
||||||
|
this.unsubscribe.complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
private mapEditorsAndLoadConfig() {
|
||||||
this.lspTextEditor = this.lspEditorComponent.editor;
|
this.lspTextEditor = this.lspEditorComponent.editor;
|
||||||
this.innerEditor = this.sessionEditorComponent.editor;
|
this.innerEditor = this.sessionEditorComponent.editor;
|
||||||
|
|
||||||
@ -50,13 +61,6 @@ export class LspManagerComponent {
|
|||||||
this.lspTextEditor.session.setMode("ace/mode/json");
|
this.lspTextEditor.session.setMode("ace/mode/json");
|
||||||
this.lspTextEditor.session.setValue(lspConfigData);
|
this.lspTextEditor.session.setValue(lspConfigData);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.loadSubscribers();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ngOnDestroy() {
|
|
||||||
this.unsubscribe.next();
|
|
||||||
this.unsubscribe.complete();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadSubscribers() {
|
private loadSubscribers() {
|
||||||
@ -67,6 +71,10 @@ export class LspManagerComponent {
|
|||||||
this.toggleLspManager(message);
|
this.toggleLspManager(message);
|
||||||
} else if (message.action === "set-active-editor") {
|
} else if (message.action === "set-active-editor") {
|
||||||
this.setActiveEditor(message);
|
this.setActiveEditor(message);
|
||||||
|
} else if (message.action === "editor-update") {
|
||||||
|
this.editorUpdate(message);
|
||||||
|
} else if (message.action === "close-file") {
|
||||||
|
this.closeFile(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -83,6 +91,19 @@ export class LspManagerComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public createLanguageClient() {
|
||||||
|
let mode = this.lspManagerService.getMode(this.editor.session);
|
||||||
|
this.lspManagerService.createLanguageProviderWithClientServer(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public registerEditorToLanguageClient() {
|
||||||
|
this.lspManagerService.registerEditorToLSPClient(this.editor);
|
||||||
|
|
||||||
|
this.lspManagerService.setSessionFilePath(
|
||||||
|
this.editor.session,
|
||||||
|
this.activeFile.path
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public globalLspManagerKeyHandler(event: any) {
|
public globalLspManagerKeyHandler(event: any) {
|
||||||
@ -108,10 +129,26 @@ export class LspManagerComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private setActiveEditor(message: ServiceMessage) {
|
private setActiveEditor(message: ServiceMessage) {
|
||||||
this.editor = message.rawData;
|
this.editor = message.rawData.editor;
|
||||||
|
this.activeFile = message.rawData.activeFile;
|
||||||
|
|
||||||
// TODO: figure out why this doesn't update the session consistently...
|
// TODO: figure out why this doesn't update the session consistently...
|
||||||
// It seems maybe bound to visible state as change detector ref didn't help either.
|
// It seems maybe bound to visible state as change detector ref didn't help either.
|
||||||
// this.innerEditor.setSession(this.editor.session);
|
// this.innerEditor.setSession(this.editor.session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private editorUpdate(message: ServiceMessage) {
|
||||||
|
this.editor.setSession(message.rawData.editor.getSession())
|
||||||
|
this.activeFile = message.rawData.activeFile;
|
||||||
|
|
||||||
|
this.lspManagerService.setSessionFilePath(
|
||||||
|
this.editor.session,
|
||||||
|
this.activeFile.path
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private closeFile(message: ServiceMessage) {
|
||||||
|
this.lspManagerService.closeDocument(message.rawData);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user