diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-03 22:18:43 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-03 22:18:43 -0700 |
commit | d84b22d0064af505d1a38036cfedd911d4b47306 (patch) | |
tree | cd67292f2da48a597e533acafa0e389e80901063 /continuedev/src | |
parent | c4ab2657c07b23d2c62acde7829ad33f98c8cd7f (diff) | |
parent | 430f4e1b5ebd4f913ac2fe97227e2e7eaf8b008b (diff) | |
download | sncontinue-d84b22d0064af505d1a38036cfedd911d4b47306.tar.gz sncontinue-d84b22d0064af505d1a38036cfedd911d4b47306.tar.bz2 sncontinue-d84b22d0064af505d1a38036cfedd911d4b47306.zip |
Merge branch 'main' of https://github.com/continuedev/continue
Diffstat (limited to 'continuedev/src')
-rw-r--r-- | continuedev/src/continuedev/core/config.py | 5 | ||||
-rw-r--r-- | continuedev/src/continuedev/libs/util/step_name_to_steps.py | 2 | ||||
-rw-r--r-- | continuedev/src/continuedev/steps/open_config.py | 13 |
3 files changed, 20 insertions, 0 deletions
diff --git a/continuedev/src/continuedev/core/config.py b/continuedev/src/continuedev/core/config.py index d268d247..3208e63d 100644 --- a/continuedev/src/continuedev/core/config.py +++ b/continuedev/src/continuedev/core/config.py @@ -50,6 +50,11 @@ class ContinueConfig(BaseModel): step_name="SimpleChatStep", ), SlashCommand( + name="config", + description="Open the config file to create new and edit existing slash commands", + step_name="OpenConfigStep", + ), + SlashCommand( name="comment", description="Write comments for the current file or highlighted code", step_name="CommentCodeStep", diff --git a/continuedev/src/continuedev/libs/util/step_name_to_steps.py b/continuedev/src/continuedev/libs/util/step_name_to_steps.py index f431f317..d329e110 100644 --- a/continuedev/src/continuedev/libs/util/step_name_to_steps.py +++ b/continuedev/src/continuedev/libs/util/step_name_to_steps.py @@ -12,6 +12,7 @@ from ...recipes.DDtoBQRecipe.main import DDtoBQRecipe from ...recipes.DeployPipelineAirflowRecipe.main import DeployPipelineAirflowRecipe from ...steps.on_traceback import DefaultOnTracebackStep from ...steps.clear_history import ClearHistoryStep +from ...steps.open_config import OpenConfigStep # This mapping is used to convert from string in ContinueConfig json to corresponding Step class. # Used for example in slash_commands and steps_on_startup @@ -27,6 +28,7 @@ step_name_to_step_class = { "DeployPipelineAirflowRecipe": DeployPipelineAirflowRecipe, "DefaultOnTracebackStep": DefaultOnTracebackStep, "ClearHistoryStep": ClearHistoryStep, + "OpenConfigStep": OpenConfigStep } diff --git a/continuedev/src/continuedev/steps/open_config.py b/continuedev/src/continuedev/steps/open_config.py new file mode 100644 index 00000000..43c1b7ce --- /dev/null +++ b/continuedev/src/continuedev/steps/open_config.py @@ -0,0 +1,13 @@ +from ..core.main import Step +from ..core.sdk import ContinueSDK +import os + + +class OpenConfigStep(Step): + name: str = "Open config" + + async def run(self, sdk: ContinueSDK): + global_dir = os.path.expanduser('~/.continue') + config_path = os.path.join(global_dir, 'config.json') + print(config_path) + await sdk.ide.setFileOpen(config_path)
\ No newline at end of file |