diff options
| author | Ty Dunn <ty@tydunn.com> | 2023-06-15 15:49:35 -0700 | 
|---|---|---|
| committer | Ty Dunn <ty@tydunn.com> | 2023-06-15 15:49:35 -0700 | 
| commit | cb0a3d23b39a6fdedfd36c1bc134d0172a600df4 (patch) | |
| tree | a8063bc3f9a6e629875fac1331b5258bb90f2c83 /continuedev/src | |
| parent | f25671cd182a83efa7b52b1dc613cb2fad2edc5e (diff) | |
| download | sncontinue-cb0a3d23b39a6fdedfd36c1bc134d0172a600df4.tar.gz sncontinue-cb0a3d23b39a6fdedfd36c1bc134d0172a600df4.tar.bz2 sncontinue-cb0a3d23b39a6fdedfd36c1bc134d0172a600df4.zip  | |
get full contents of open file for explain
Diffstat (limited to 'continuedev/src')
| -rw-r--r-- | continuedev/src/continuedev/core/sdk.py | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/continuedev/src/continuedev/core/sdk.py b/continuedev/src/continuedev/core/sdk.py index b806ef73..76f72d01 100644 --- a/continuedev/src/continuedev/core/sdk.py +++ b/continuedev/src/continuedev/core/sdk.py @@ -172,6 +172,15 @@ class ContinueSDK(AbstractContinueSDK):      async def get_chat_context(self) -> List[ChatMessage]:          history_context = self.history.to_chat_history()          highlighted_code = await self.ide.getHighlightedCode() +        if len(highlighted_code) == 0: +            # Get the full contents of all open files +            files = await self.ide.getOpenFiles() +            contents = {} +            for file in files: +                contents[file] = await self.ide.readFile(file) + +            highlighted_code = [RangeInFile.from_entire_file( +                filepath, content) for filepath, content in contents.items()]          for rif in highlighted_code:              code = await self.ide.readRangeInFile(rif)              history_context.append(ChatMessage(  | 
