continue-custom/server/continuedev/plugins/steps/draft/abstract_method.py
Nate Sesti 279593a848
Strong typing (#533)
* refactor: ♻️ get rid of continuedev.src.continuedev structure

* refactor: ♻️ switching back to server folder

* feat: ✨ make config.py imports shorter

* feat: 🔖 publish as pre-release vscode extension

* refactor: ♻️ refactor and add more completion params to ui

* build: 🏗️ download from preview S3
2023-10-04 23:47:59 -07:00

21 lines
723 B
Python

from ....core.main import Step
from ....core.sdk import ContinueSDK
class ImplementAbstractMethodStep(Step):
name: str = "Implement abstract method for all subclasses"
method_name: str
class_name: str
async def run(self, sdk: ContinueSDK):
if sdk.lsp is None:
self.description = "Language Server Protocol is not enabled"
return
implementations = await sdk.lsp.go_to_implementations(self.class_name)
for implementation in implementations:
await sdk.edit_file(
range_in_files=[implementation.range_in_file],
prompt=f"Implement method `{self.method_name}` for this subclass of `{self.class_name}`",
)