Fix parsing bugs and add better indentation support
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include "lsp/lsp.h"
|
||||
#include "main.h"
|
||||
|
||||
Queue<LSPOpenRequest> lsp_open_queue;
|
||||
|
||||
|
||||
+1
-2
@@ -53,9 +53,8 @@ std::shared_ptr<LSPInstance> get_or_init_lsp(std::string lsp_id) {
|
||||
if (!init_lsp(lsp))
|
||||
return nullptr;
|
||||
LSPPending *pending = new LSPPending();
|
||||
pending->method = "initialize";
|
||||
pending->editor = nullptr;
|
||||
pending->callback = [lsp, lsp_id](Editor *, std::string, json msg) {
|
||||
pending->callback = [lsp, lsp_id](Editor *, const json &msg) {
|
||||
if (msg.contains("result") && msg["result"].contains("capabilities")) {
|
||||
auto &caps = msg["result"]["capabilities"];
|
||||
// if (caps.contains("positionEncoding")) {
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ void lsp_worker() {
|
||||
LSPPending *pend = it->second;
|
||||
lock.unlock();
|
||||
if (pend->callback)
|
||||
pend->callback(pend->editor, pend->method, *msg);
|
||||
pend->callback(pend->editor, *msg);
|
||||
delete pend;
|
||||
lock.lock();
|
||||
lsp->pending.erase(it);
|
||||
|
||||
Reference in New Issue
Block a user