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 | ce36d1e516e4cec7adfb8407cb50d7a5589be081 (patch) | |
tree | 1752c022dac77183f3c6c55f70a95c8fa9d1b1fa /continuedev/src | |
parent | af3ce820326e632d2cbb4f1880024046c8aa00cb (diff) | |
parent | 022cbb382bf5b0aa82216d73b4b59b85be0508c2 (diff) | |
download | sncontinue-ce36d1e516e4cec7adfb8407cb50d7a5589be081.tar.gz sncontinue-ce36d1e516e4cec7adfb8407cb50d7a5589be081.tar.bz2 sncontinue-ce36d1e516e4cec7adfb8407cb50d7a5589be081.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 |