From 8d0584aa590a8cce0fc4828e4e5ca8862f95ccf2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 29 Oct 2019 17:37:09 +0200 Subject: [PATCH] Add new IDE RPC "open_text_document" method for PIO Home --- platformio/commands/home/rpc/handlers/ide.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/platformio/commands/home/rpc/handlers/ide.py b/platformio/commands/home/rpc/handlers/ide.py index af5b474e..e3ad75f3 100644 --- a/platformio/commands/home/rpc/handlers/ide.py +++ b/platformio/commands/home/rpc/handlers/ide.py @@ -22,7 +22,7 @@ class IDERPC(object): def __init__(self): self._queue = {} - def send_command(self, command, params, sid=0): + def send_command(self, sid, command, params): if not self._queue.get(sid): raise jsonrpc.exceptions.JSONRPCDispatchException( code=4005, message="PIO Home IDE agent is not started" @@ -38,5 +38,10 @@ class IDERPC(object): self._queue[sid].append(defer.Deferred()) return self._queue[sid][-1] - def open_project(self, project_dir, sid=0): - return self.send_command("open_project", project_dir, sid) + def open_project(self, sid, project_dir): + return self.send_command(sid, "open_project", project_dir) + + def open_text_document(self, sid, path, line=None, column=None): + return self.send_command( + sid, "open_text_document", dict(path=path, line=line, column=column) + )