outcomes of work session
This commit is contained in:
parent
4fdf41ae8d
commit
0930f7048c
15 changed files with 2592 additions and 203 deletions
|
|
@ -73,6 +73,7 @@ cd continue/extension/scripts && python3 install_from_source.py
|
|||
- [Continue GUI README](./extension/react-app/): learn about the React app that lets users interact with the server and is placed adjacent to the text editor in any suppported IDE
|
||||
- [Schema README](./schema): learn about the JSON Schema types generated from Pydantic models, which we use across the `continuedev/` and `extension/` directories
|
||||
- [Continue Docs README](./docs): learn how our [docs](https://continue.dev/docs) are written and built
|
||||
- Add steps for development README mention here
|
||||
|
||||
# License
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@ Continue is a Python library for automating repetitive sequences of software dev
|
|||
|
||||
## Continue Server
|
||||
|
||||
The Continue server acts as a bridge between the Continue React app and your IDE, running your recipes and acting on the codebase. Start it by running the following commands:
|
||||
The Continue server acts as a bridge between the Continue React app and your IDE, running your recipes and acting on the codebase.
|
||||
|
||||
- `cd continuedev`
|
||||
- Make sure packages are installed with `poetry install`
|
||||
- `poetry shell`
|
||||
- `cd ..`
|
||||
- `python3 -m continuedev.src.continuedev.server.main`
|
||||
Start it by running the following commands:
|
||||
1. `cd continuedev`
|
||||
2. Make sure packages are installed with `poetry install`
|
||||
3. `poetry shell`
|
||||
4. `cd ..`
|
||||
5. `python3 -m continuedev.src.continuedev.server.main`
|
||||
|
||||
## Scripts
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ nest-asyncio = "^1.5.6"
|
|||
websockets = "^11.0.2"
|
||||
urllib3 = "1.26.15"
|
||||
gpt-index = "^0.6.8"
|
||||
setuptools = "^67.7.2"
|
||||
posthog = "^3.0.1"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from abc import ABC, abstractmethod
|
||||
from typing import Coroutine, List
|
||||
from typing import Coroutine, List, Union
|
||||
|
||||
from .config import ContinueConfig
|
||||
from ..models.filesystem_edit import FileSystemEdit
|
||||
|
|
@ -45,7 +45,7 @@ class AbstractContinueSDK(ABC):
|
|||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def run(self, commands: List[str] | str, cwd: str = None):
|
||||
async def run(self, commands: Union[List[str], str], cwd: str = None):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
|
|
@ -57,7 +57,7 @@ class AbstractContinueSDK(ABC):
|
|||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def add_file(self, filename: str, content: str | None):
|
||||
async def add_file(self, filename: str, content: Union[str, None]):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class ContinueSDK(AbstractContinueSDK):
|
|||
async def wait_for_user_confirmation(self, prompt: str):
|
||||
return await self.run_step(WaitForUserConfirmationStep(prompt=prompt))
|
||||
|
||||
async def run(self, commands: List[str] | str, cwd: str = None):
|
||||
async def run(self, commands: Union[List[str], str], cwd: str = None):
|
||||
commands = commands if isinstance(commands, List) else [commands]
|
||||
return await self.run_step(ShellCommandsStep(cmds=commands, cwd=cwd))
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ class ContinueSDK(AbstractContinueSDK):
|
|||
file_edit = FileEdit.from_append(filepath, previous_content, content)
|
||||
await self.ide.applyFileSystemEdit(file_edit)
|
||||
|
||||
async def add_file(self, filename: str, content: str | None):
|
||||
async def add_file(self, filename: str, content: Union[str, None]):
|
||||
filepath = await self._ensure_absolute_path(filename)
|
||||
return await self.run_step(FileSystemEditStep(edit=AddFile(filename=filename, content=content)))
|
||||
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ class FileSystemEditStep(ReversibleStep):
|
|||
|
||||
class ShellCommandsStep(Step):
|
||||
cmds: List[str]
|
||||
cwd: str | None = None
|
||||
cwd: Union[str, None] = None
|
||||
name: str = "Run Shell Commands"
|
||||
|
||||
_err_text: str | None = None
|
||||
_err_text: Union[str, None] = None
|
||||
|
||||
async def describe(self, models: Models) -> Coroutine[str, None, None]:
|
||||
if self._err_text is not None:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Steps
|
||||
|
||||
**TODO: better explain each step and link to them**
|
||||
**TODO: better explain each step and link to them, find all in steps folder**
|
||||
|
||||
#### EditCodeStep
|
||||
|
||||
|
|
@ -30,4 +30,4 @@ Type `/ask` and ask any question about your whole codebase. The Chroma embedding
|
|||
|
||||
## Recipes
|
||||
|
||||
**TODO: add each recipe, explain them, and link to them**
|
||||
**TODO: add each recipe, explain them, and link to them, find all in recipes folder**
|
||||
|
|
@ -11,8 +11,14 @@ Points to include
|
|||
- How to create recipe
|
||||
- Using models
|
||||
|
||||
1. Create a recipe here
|
||||
|
||||
continue/continuedev/src/continuedev/recipes
|
||||
|
||||
## 1. Create a step
|
||||
|
||||
|
||||
|
||||
### a. Start by creating a subclass of Step
|
||||
|
||||
You should first consider what will be the parameters of your recipe. These are defined as attributes in the step, as with `input_file_path: str` below
|
||||
|
|
|
|||
|
|
@ -10,9 +10,15 @@ All of the recipes are located in this part of the codebase here
|
|||
|
||||
At the moment, we only support editing the file open and focused in the code editor, so you need to make sure that is
|
||||
|
||||
user input step
|
||||
demopolicy decides what to do
|
||||
default step, starcoder to edit the current open file
|
||||
|
||||
## Use its slash command to start the recipe
|
||||
|
||||
Every recipe can be triggered by the user using its slash command. For example, `/comment` will trigger
|
||||
Every recipe can be triggered by the user using its slash command. For example, `/comment` will trigger.
|
||||
|
||||
add to the if / else with `/` commands
|
||||
|
||||
## Review the steps and take any required manual actions
|
||||
|
||||
|
|
|
|||
|
|
@ -5,3 +5,5 @@ This is the Continue VS Code Extension. Its primary jobs are
|
|||
1. Implement the IDE side of the Continue IDE protocol, allowing a Continue server to interact natively in an IDE. This happens in `src/continueIdeClient.ts`.
|
||||
2. Open the Continue React app in a side panel. The React app's source code lives in the `react-app` directory. The panel is opened by the `continue.openDebugPanel` command, as defined in `src/commands.ts`.
|
||||
3. Run a Continue server in the background, which connects to both the IDE protocol and the React app. The server is launched in `src/activation/environmentSetup.ts` by calling Python code that lives in `scripts/` (unless extension settings define a server URL other than localhost:8000, in which case the extension will just connect to that).
|
||||
|
||||
1. Open Continue
|
||||
2695
extension/package-lock.json
generated
2695
extension/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -182,6 +182,8 @@
|
|||
"@types/mocha": "^10.0.1",
|
||||
"@types/node": "16.x",
|
||||
"@types/node-fetch": "^2.6.2",
|
||||
"@types/react-dom": "^18.2.4",
|
||||
"@types/styled-components": "^5.1.26",
|
||||
"@types/vscode": "^1.74.0",
|
||||
"@types/ws": "^8.5.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
||||
|
|
@ -200,11 +202,16 @@
|
|||
"@reduxjs/toolkit": "^1.9.3",
|
||||
"@segment/analytics-node": "^0.0.1-beta.16",
|
||||
"@styled-icons/heroicons-outline": "^10.47.0",
|
||||
"@vitejs/plugin-react-swc": "^3.3.2",
|
||||
"axios": "^1.2.5",
|
||||
"highlight.js": "^11.7.0",
|
||||
"octokit": "^2.0.11",
|
||||
"posthog-js": "^1.63.3",
|
||||
"react-markdown": "^8.0.7",
|
||||
"react-redux": "^8.0.5",
|
||||
"strip-ansi": "^7.0.1",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"vite": "^4.3.9",
|
||||
"vscode-languageclient": "^8.0.2",
|
||||
"ws": "^8.13.0"
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -2,47 +2,31 @@
|
|||
|
||||
## How to get started with development
|
||||
|
||||
1. Clone the `continue` repo
|
||||
1. Clone the Continue repo
|
||||
|
||||
2. Open a VS Code window with the `continue` repo
|
||||
2. Open a VS Code window with the `continue` directory as your workspace
|
||||
|
||||
3. Package and then start the FastAPI server by following instructions outlined in `package/server/README.md`
|
||||
3. Package and then start the FastAPI server by following instructions outlined in the `Continue Server` section of the `continuedev/README.md`
|
||||
|
||||
4. Open the `extension` sub-directory of the repo in a second VS Code window
|
||||
4. Open a VS Code window with the `extension` directory as your workspace
|
||||
|
||||
5. Run `npm install`
|
||||
5. From `continue/extension`, run `npm install`
|
||||
|
||||
6. Run `npm run clientgen`
|
||||
6. Run `npm run full-package`
|
||||
|
||||
7. Run `cd react-app`
|
||||
7. Open `src/activation/activate.ts` file (or any TypeScript file)
|
||||
|
||||
8. Run `npm run build`
|
||||
8. Press `F5` on your keyboard to start `Run and Debug` mode
|
||||
|
||||
9. Run `cd ..` to return to `extension` directory
|
||||
9. `cmd+shift+p` to look at developer console and select Continue commands
|
||||
|
||||
10. Then run `npm run compile`
|
||||
10. Every time you make changes to the code, you need to run `npm run compile`
|
||||
|
||||
11. Open `src/activate.ts` file (or any TypeScript file)
|
||||
11. If you run into a "command not found" error, try running `npm run rebuild` and then `npm run compile`
|
||||
|
||||
12. Press `F5` on your keyboard to start `Run and Debug` mode
|
||||
## Alternative: Install from source
|
||||
|
||||
13. `cmd+shift+p` to look at developer console and select Continue commands
|
||||
|
||||
14. Every time you make changes to the code, you need to run `npm run compile`
|
||||
|
||||
15. If you run into a "command not found" error, try running `npm run rebuild` and then `npm run compile`
|
||||
|
||||
## Alternative: Install a packaged version
|
||||
|
||||
You should always have a packaged version installed in VS Code, because when Continue is broken you'll want a stable version to help you debug. There are four key commands in the `package.json`:
|
||||
|
||||
1. `npm run package` will create a .vsix file in the `build/` folder that can then be installed. It is this same file that you can share with others who want to try the extension.
|
||||
|
||||
2. `npm run install-extension` will install the extension to VS Code. You should then see it in your installed extensions in the VS Code sidebar.
|
||||
|
||||
3. `npm run uninstall` will uninstall the extension. You don't always have to do this thanks to the reinstall command, but can be useful when you want to do so manually.
|
||||
|
||||
4. `npm run reinstall` will go through the entire process of uninstalling the existing installed extension, rebuilding, and then installing the new version. You shouldn't be doing this every time you make a change to the extension, but rather when there is some significant update that you would like to make available to yourself (or if you happen to be debugging something which is specific to the packaged extension).
|
||||
Update: directions to root README
|
||||
|
||||
## Background
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ async function setupPythonEnv() {
|
|||
const createEnvCommand = [
|
||||
`cd ${path.join(getExtensionUri().fsPath, "scripts")}`,
|
||||
`${pythonCmd} -m venv env`,
|
||||
].join(" && ");
|
||||
].join(" ; ");
|
||||
|
||||
// Repeat until it is successfully created (sometimes it fails to generate the bin, need to try again)
|
||||
while (true) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue