summaryrefslogtreecommitdiff
path: root/continuedev/src/continuedev/server
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-06-29 22:46:56 -0700
committerNate Sesti <sestinj@gmail.com>2023-06-29 22:46:56 -0700
commit1da66af471329204dec9749451d533a47212c7fa (patch)
treeab6e3da7181fe4b298030b0f110f18823e0558ca /continuedev/src/continuedev/server
parentacb5f920a2d1640b8cc2a3e6f2db1f7d5a554978 (diff)
downloadsncontinue-1da66af471329204dec9749451d533a47212c7fa.tar.gz
sncontinue-1da66af471329204dec9749451d533a47212c7fa.tar.bz2
sncontinue-1da66af471329204dec9749451d533a47212c7fa.zip
lock suggestions until done streaming
Diffstat (limited to 'continuedev/src/continuedev/server')
-rw-r--r--continuedev/src/continuedev/server/ide.py9
-rw-r--r--continuedev/src/continuedev/server/ide_protocol.py4
2 files changed, 13 insertions, 0 deletions
diff --git a/continuedev/src/continuedev/server/ide.py b/continuedev/src/continuedev/server/ide.py
index cc8cb15e..65f3ee74 100644
--- a/continuedev/src/continuedev/server/ide.py
+++ b/continuedev/src/continuedev/server/ide.py
@@ -132,6 +132,8 @@ class IdeProtocolServer(AbstractIdeProtocolServer):
await self.openGUI()
elif message_type == "setFileOpen":
await self.setFileOpen(data["filepath"], data["open"])
+ elif message_type == "setSuggestionsLocked":
+ await self.setSuggestionsLocked(data["filepath"], data["locked"])
elif message_type == "fileEdits":
fileEdits = list(
map(lambda d: FileEditWithFullContents.parse_obj(d), data["fileEdits"]))
@@ -158,6 +160,13 @@ class IdeProtocolServer(AbstractIdeProtocolServer):
"open": open
})
+ async def setSuggestionsLocked(self, filepath: str, locked: bool = True):
+ # Lock suggestions in the file so they don't ruin the offset before others are inserted
+ await self._send_json("setSuggestionsLocked", {
+ "filepath": filepath,
+ "locked": locked
+ })
+
async def openGUI(self):
session_id = self.session_manager.new_session(self)
await self._send_json("openGUI", {
diff --git a/continuedev/src/continuedev/server/ide_protocol.py b/continuedev/src/continuedev/server/ide_protocol.py
index 79820c36..d2dafa9a 100644
--- a/continuedev/src/continuedev/server/ide_protocol.py
+++ b/continuedev/src/continuedev/server/ide_protocol.py
@@ -24,6 +24,10 @@ class AbstractIdeProtocolServer(ABC):
"""Set whether a file is open"""
@abstractmethod
+ async def setSuggestionsLocked(self, filepath: str, locked: bool = True):
+ """Set whether suggestions are locked"""
+
+ @abstractmethod
async def openGUI(self):
"""Open a GUI"""