Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d1a05f6a84 | |||
| 085e622c1b | |||
| 4cd40ca312 | |||
| aada99d55b | |||
| 0b09b3621f | |||
| a299cd58c7 | |||
| bdc3e7927a | |||
| c2d131da7b | |||
| 78c7374bd9 | |||
| 7acca7e9c9 | |||
| ac7581a14a | |||
| fbd94a84d4 | |||
| 0e55713e55 | |||
| fe578eb6e8 | |||
| fc3aec52bb | |||
| a03e845275 | |||
| 81f836de4f | |||
| 0455606ec6 | |||
| 8de0f9d87b | |||
| 4137df7843 | |||
| c1355f0e68 | |||
| 3bef1800da | |||
| 8dd68351bc | |||
| fa977d7c9a | |||
| 25c2c177b2 | |||
| 2264e08c55 | |||
| 6b92e6b218 | |||
| 448203213c | |||
| 866505ac84 | |||
| 79358e1d15 | |||
| 44106b0333 | |||
| f23897480b | |||
| 8914d1e028 | |||
| 309687c189 | |||
| a8adaab1fd | |||
| ac9fbce495 | |||
| f5ada67ca7 | |||
| 22d2ef1813 | |||
| 8eea041a1e | |||
| e3dd062950 | |||
| 5f05405280 | |||
| 50b79bab3d | |||
| ba639ae108 | |||
| b8ccb80e71 | |||
| cab499581e | |||
| b44f575713 | |||
| ff97a34d54 | |||
| ae658dfc74 | |||
| 8a780dcfab | |||
| 78b2d0e0dd | |||
| 5f8fe11d0c | |||
| d30e686c03 | |||
| efddc17ad8 | |||
| 2c059587ac | |||
| 3f132ca9e5 | |||
| 58c57e5768 | |||
| 436fc6d068 | |||
| a23e0f1376 | |||
| a893ecd380 | |||
| 2b4652499d | |||
| 210b2a5759 | |||
| 8698908881 | |||
| 715278ebbf | |||
| 796ca4f696 | |||
| 363b98a55e | |||
| f5bccdd4cb | |||
| 4b24dee1a9 | |||
| a50b53a461 | |||
| 0166de1d81 | |||
| c78d19473f | |||
| cf36aef12d | |||
| 2f1f5e0267 | |||
| a772adee4b |
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "LineMage",
|
||||
"name": "Void",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
],
|
||||
"rules": {
|
||||
"constructor-super": "warn",
|
||||
"curly": "off", // <-- LineMage
|
||||
"curly": "off", // <-- Void
|
||||
"eqeqeq": "warn",
|
||||
"prefer-const": [
|
||||
"warn",
|
||||
@@ -51,7 +51,7 @@
|
||||
"no-var": "warn",
|
||||
"jsdoc/no-types": "warn",
|
||||
"semi": "off",
|
||||
"@typescript-eslint/semi": "off", // <-- LineMage
|
||||
"@typescript-eslint/semi": "off", // <-- Void
|
||||
"@typescript-eslint/member-delimiter-style": "warn",
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"warn",
|
||||
|
||||
Vendored
+1
-1
@@ -93,7 +93,7 @@
|
||||
}
|
||||
],
|
||||
"git.ignoreLimitWarning": true,
|
||||
// we removed this for LineMage:
|
||||
// we removed this for Void:
|
||||
// "git.branchProtection": [
|
||||
// "main",
|
||||
// "distro",
|
||||
|
||||
+93
-148
@@ -1,52 +1,120 @@
|
||||
|
||||
# Contributing to Void
|
||||
|
||||
Welcome! 👋 This is a guide on how to contribute to Void. We want to make it as easy as possible to contribute, so if you have any questions or comments, reach out via email or discord!
|
||||
|
||||
There are two main ways to contribute:
|
||||
|
||||
- Suggest New Features (discord)
|
||||
- Build New Features (roadmap)
|
||||
|
||||
|
||||
# Contributing to LineMage
|
||||
See the [GitHub Issues](https://github.com/orgs/voideditor/projects/2/views/3) list for a list of the most important features to build, or feel free to create new issues.
|
||||
|
||||
Welcome! 👋 This is a guide on how to contribute to LineMage. We want to make it as easy as possible to contribute, so if you have any questions or comments, reach out via email or Discord!
|
||||
We use a [VSCode extension](https://code.visualstudio.com/api/get-started/your-first-extension) to implement most of Void's functionality. Scroll down to see 1. How to build/contribute to the Extension, or 2. How to build/contribute to the full IDE (for more native changes).
|
||||
|
||||
There are 3 main ways to contribute:
|
||||
|
||||
- Suggest New Features
|
||||
- Improve Documentation
|
||||
- Build New Features
|
||||
|
||||
|
||||
See the [Roadmap](#roadmap) section for a list of the most important features to build, or feel free to build your own features.
|
||||
|
||||
We use a [VSCode extension](https://code.visualstudio.com/api/get-started/your-first-extension) to implement most of LineMage's functionality. Scroll down to see 1. How to contribute to the Extension, or 2. How to contribute to the full IDE (for more native changes).
|
||||
For some useful links we've compiled see [`VOID_USEFUL_LINKS.md`](https://github.com/voideditor/void/blob/main/VOID_USEFUL_LINKS.md).
|
||||
|
||||
|
||||
|
||||
## 1. Building the Extension
|
||||
Here's how you can start contributing to the Void Extension, where is the main place most edits should take place (especially if you're just getting started):
|
||||
|
||||
1. Clone the repository:
|
||||
|
||||
```
|
||||
git clone https://github.com/voideditor/void
|
||||
```
|
||||
|
||||
2. Open the extension folder in VS Code (open it in a new workspace, *don't* just cd into it):
|
||||
|
||||
```
|
||||
/extensions/void
|
||||
```
|
||||
|
||||
3. Install dependencies:
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
4. Build the project. We created this build command so that we could run React in vscode - it converts `sidebar/index.tsx` into a CSS/JS bundle in `dist/`.
|
||||
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
5. Run the project by pressing <kbd>F5</kbd>.
|
||||
|
||||
This will start a new instance of VS Code with the extension enabled. If this does not work, you can press <kbd>Ctrl+Shift+P</kbd>, select "Debug: Start Debugging", and select "VS Code Extension Development".
|
||||
|
||||
If you would like to use AI features, you need to provide an API key. You can do that by going to Settings (Ctrl+,) and modifying `void > "Anthropic Api Key"`. The "Which API" environment variable controls the provider and defaults to "anthropic".
|
||||
|
||||
Now that you're set up, feel free to check out our [Issues](https://github.com/voideditor/void/issues) page!
|
||||
|
||||
## 2. Building the full IDE
|
||||
|
||||
Beyond the extension, we very occasionally edit the IDE when we need to access more functionality. If you want to work on the full IDE, please follow the steps below, or see VS Code's full [how to contribute](https://github.com/microsoft/vscode/wiki/How-to-Contribute) page.
|
||||
|
||||
|
||||
1. Install all dependencies. Make sure you have yarn installed (`npm install -g yarn`)
|
||||
```
|
||||
yarn
|
||||
```
|
||||
|
||||
2. In VS Code, press <kbd>Ctrl+Shift+B</kbd> to start the build process - this can take some time. If you're not using VS Code, run `yarn watch` instead.
|
||||
|
||||
3. Run `./scripts/code.sh` in your terminal.
|
||||
|
||||
This should open up the built IDE after loading for some time. To see new changes without restarting the build, use <kbd>Ctrl+Shift+P</kbd> and run "Reload Window".
|
||||
|
||||
To bundle the IDE, run `yarn gulp vscode-win32-x64`. Here are the full options: vscode-{win32-ia32 | win32-x64 | darwin-x64 | darwin-arm64 | linux-ia32 | linux-x64 | linux-arm}(-min)
|
||||
|
||||
If you're on Windows, we recommend running the project inside a dev container. VSCode should prompt you to do this automatically.
|
||||
|
||||
Now that you're set up, feel free to check out our [Issues](https://github.com/voideditor/void/issues) page!
|
||||
|
||||
## Roadmap
|
||||
|
||||
Here are the most important topics on our Roadmap. More ⭐'s = more important.
|
||||
|
||||
## ⭐⭐⭐ Improve diffs.
|
||||
|
||||
We define a "diff" as a single green/red codeblock that denotes a change. Here are improvements to make:
|
||||
|
||||
1. Show deletions (-) inside diffs. Right now we're only showing insertions (+). Diffs currently work by highlighting all of the new code in green with a simple text decoration. Instead, we would like to use code from VS Code's native diffEditor to show the diffs ("inline" mode). We could alternatively keep what we have and add red zones of the deleted code between lines.
|
||||
|
||||
2. Make diffs responsive. When a user accepts a diff, all of the diffs below it should be updated (because they are now on different line numbers). We're not doing this, so there is a lot of unexpected behavior.
|
||||
|
||||
3. Make diff highlighting dynamic. Right now when the user edits text, we clear all the diffs and their highlights. Instead, we should simply update the highlighting of the diff. Each diff lives on a range of lines, and all changes inside that range or intersecting with it should update its highlighting.
|
||||
|
||||
## ⭐⭐⭐ Make History work well.
|
||||
When the user submits a response or presses the apply/accept/reject button, we should add these events to the history and allow the user to use undo/redo on them. Right now there is unexpected behavior if the user tries to undo or redo their LineMage changes.
|
||||
## ⭐⭐⭐ Improve diffs.
|
||||
|
||||
## ⭐⭐⭐ Build Cursor-style quick edits (ctrl+k).
|
||||
We define a "diff" as a single green/red pair that denotes a change. Here are improvements to make:
|
||||
|
||||
1. Show deletion (-) diffs. Right now we're only showing insertion (+) diffs. Diffs currently work by highlighting all of the new code in green with a simple text decoration. Instead, we would like to use code from VS Code's native diffEditor to show the diffs ("inline" mode). We could alternatively keep what we have and add red zones of the deleted code to indicate a deletion diff (-).
|
||||
|
||||
2. Fix bugginess when the user presses "Accept" or "Reject" on a diff. One issue is that when a diff is accepted/rejected all of the diffs below should be updated (because they are now on different line numbers). There are other miscellaneous issues too.
|
||||
|
||||
3. Make diff highlighting dynamic. Right now when the user edits text, all of the diffs and their highlights are cleared. Instead, we should update the highlighting of the diff. Each diff lives on a range of lines, and all changes inside that range or intersecting with it should update its highlighting.
|
||||
|
||||
|
||||
## ⭐⭐⭐ Build Cursor-style quick edits (ctrl+k).
|
||||
|
||||
When the user presses ctrl+k, an input box should appear inline with the code that they were selecting. This is somewhat difficult to do because an extension alone cannot do this, and it requires creating a new component in the IDE. We think you can modify vscode's built-in "codelens" or "zone widget" components, but we are open to alternatives.
|
||||
|
||||
## ⭐⭐⭐ Improve Ctrl+L.
|
||||
## ⭐⭐⭐ Make History work well.
|
||||
When the user submits a response or presses the apply/accept/reject button, we should add these events to the history, allowing the user to undo/redo them. Right now there is unexpected behavior if the user tries to undo or redo their changes.
|
||||
|
||||
Change the prompt so we output changes like `// ... rest of file`, instead of always outputting the entire file. When the user clicks "apply", the model should rewrite the file and apply diffs in the correct locations.
|
||||
## ⭐⭐⭐ Improve Ctrl+L backend.
|
||||
|
||||
Right now, the model outputs entire files. Instead, we should change the prompt so that the model outputs partial changes like `// ... rest of file`. When the user clicks the "Apply" button, the model should rewrite the file and apply the partial changes in the correct locations.
|
||||
|
||||
## ⭐⭐ Integrate with Ollama.
|
||||
## ⭐⭐ Integrate with Ollama.
|
||||
|
||||
We have an Ollama integration coded up in the extension, but it breaks. This is because Ollama has Node.js dependencies like 'path' and 'os' which cannot run in extensions (extensions have to be able to run in the browser). To fix this, we need to migrate Void's extension so that it runs natively into the VS Code editor so that we can access Node.js.
|
||||
|
||||
## ⭐⭐⭐ Creative.
|
||||
|
||||
Feel free to build AI features beyond the standard Cursor ones. For example, creating better code search, or supporting AI agents that can edit across files and make multiple LLM calls.
|
||||
|
||||
Eventually, we want to build a convenient API for creating AI tools. The API will provide methods for creating the UI (showing an autocomplete suggestion, or creating a new diff), detecting event changes (like `onKeystroke` or `onFileOpen`), and modifying the user's file-system (storing indexes associated with each file), making it much easier to make your own AI plugin. We plan on building these features further along in timeline, but we wanted to list them for completeness.
|
||||
|
||||
We have an Ollama integration coded up in the extension, but it breaks. This is because Ollama has Node.js dependencies like 'path' and 'os' which cannot run in extensions (extensions have to be able to run in the browser). To fix this, we need to migrate LineMage's extension so that it runs natively into the VS Code editor so that we can access Node.js.
|
||||
|
||||
## ⭐ One-stars.
|
||||
|
||||
@@ -58,129 +126,6 @@ We have an Ollama integration coded up in the extension, but it breaks. This is
|
||||
|
||||
⭐ Allow user to X out of their current selection.
|
||||
|
||||
|
||||
|
||||
## 1. Contributing to the Extension
|
||||
Here's how you can start contributing to the Extension:
|
||||
|
||||
1. Clone the repository
|
||||
|
||||
`git clone https://github.com/linemagedev/linemage`
|
||||
|
||||
2. Open the extension folder
|
||||
|
||||
`cd /extensions/linemage`
|
||||
|
||||
3. Install dependencies
|
||||
|
||||
`npm run install`
|
||||
|
||||
4. Build the project
|
||||
|
||||
`npm run build`. Note: We made this build command to run React in vscode. It converts `sidebar/index.tsx` into a CSS/JS bundle in `dist/`.
|
||||
|
||||
5. Run the project
|
||||
|
||||
Press <kbd>F5</kbd>. This will start a new instance of VS Code with the extension enabled. If this does not work, you can press <kbd>F1</kbd>, select "Debug: Start Debugging", press <kbd>Enter</kbd>, and select "VS Code Extension Development".
|
||||
|
||||
If you would like to use AI features, you need to provide an API key. You can do that by going to Settings (<kbd>Ctrl+,</kbd>) and modifying `linemage > "Anthropic Api Key"`. The "Which API" environment variable controls the provider and defaults to "anthropic".
|
||||
|
||||
## 2. Contributing to the full IDE
|
||||
|
||||
Beyond the extension, we sometimes edit the IDE when we need to access more functionality. If you want to make a change to the IDE, please follow the steps below, or see VS Code's full [how to contribute](https://github.com/microsoft/vscode/wiki/How-to-Contribute) page.
|
||||
|
||||
1. Install all dependencies by running `yarn`.
|
||||
|
||||
2. Press <kbd>Ctrl+Shift+B</kbd> to start the build process - this can take some time.
|
||||
|
||||
3. Run `./scripts/code.sh` to open up the built IDE. To see new changes without restarting the build, use <kbd>Ctrl+Shift+P</kbd> and run "Reload Window".
|
||||
|
||||
To bundle the IDE, run `yarn gulp vscode-win32-x64`. Here are the full options: vscode-{win32-ia32 | win32-x64 | darwin-x64 | darwin-arm64 | linux-ia32 | linux-x64 | linux-arm}(-min)
|
||||
|
||||
If you're on Windows, we recommend running the project inside a dev container. VSCode should prompt you to do this automatically.
|
||||
|
||||
|
||||
|
||||
# Submitting a Pull Request
|
||||
|
||||
When you've made changes and want to submit them, please submit a pull request.
|
||||
|
||||
Please submit all Pull Requests to the `dev` branch.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
### Design principles
|
||||
|
||||
- Least amount of eye movement necessary; if user presses submit, show them the message where they submitted
|
||||
|
||||
|
||||
### Ctrl+L (chat)
|
||||
|
||||
|
||||
|
||||
|
||||
### Ctrl+K (inline edits)
|
||||
|
||||
- Create a new input box that takes in the user's description.
|
||||
|
||||
- Make it appear above each.
|
||||
|
||||
- The input box should appear directly above the code selection - this requires using a Zone widget.
|
||||
|
||||
|
||||
### Core
|
||||
|
||||
- Migrate the LineMage extension to live natively in VS Code. There's initial work here at `linemage.contribution.ts`.
|
||||
|
||||
- Allow access to the VS Code extension marketplace.
|
||||
|
||||
- Re-write the whole file when the user clicks "Apply" and show a gray progress indicator in the BG.
|
||||
|
||||
|
||||
|
||||
### Diffs
|
||||
|
||||
"Diffs" are the inline green/red highlights you see to approve or reject a change.
|
||||
|
||||
- Diffs are not responsive to edits right now. To make them responsive, we need to update all Diffs' ranges every time there's a change.
|
||||
|
||||
- Right now Diffs are only shown in green as a simple text decoration. We'd like to have them work better by using code from VS Code's native diffEditor ("inline" mode).
|
||||
|
||||
- **Events:** On many types of events, we should reject all the current Diffs (user submits a new chat message, clicks Apply, etc).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Ollama
|
||||
|
||||
- Ollama doesn't work now because its JS library depends on Node.js and uses imports like 'path', 'os', while extensions must be able to run in the browser. When we migrate the extension into the VS Code codebase, we'll be able to access Node.js and will uncomment the Ollama integration.
|
||||
|
||||
### Greptile
|
||||
|
||||
- Ideally we'd auto-detect -->
|
||||
When you've made changes and want to submit them, please submit a pull request.
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
# Welcome to LineMage!
|
||||
# Welcome to Void.
|
||||
|
||||
|
||||
LineMage is the open-source Cursor alternative. It's a fork of the of [vscode](https://github.com/microsoft/vscode) repository.
|
||||
Void is the open-source Cursor alternative.
|
||||
|
||||
If you're new, welcome! Feel free to check out our [Task board](https://github.com/orgs/voideditor/projects/2/views/3) for the most pressing Issues to work on, and see [`CONTRIBUTING.md`](https://github.com/voideditor/void/blob/main/CONTRIBUTING.md) to get started with the build environment.
|
||||
|
||||
This repo contains the full sourcecode for Void. We have a [waitlist](https://voideditor.com/email) for downloading the official release, but you can build and develop Void right now.
|
||||
|
||||
## Contributing
|
||||
|
||||
To contribute, see [`CONTRIBUTING.md`](https://github.com/linemagedev/linemage/blob/main/CONTRIBUTING.md).
|
||||
|
||||
We're in very early stages and building quickly. We welcome all new contributions!
|
||||
To build and run Void, see [`CONTRIBUTING.md`](https://github.com/voideditor/void/blob/main/CONTRIBUTING.md).
|
||||
|
||||
## Reference
|
||||
For some useful links we've compiled see [`LINEMAGE_USEFUL_LINKS.md`](https://github.com/linemagedev/linemage/blob/main/LINEMAGE_VSCODE_GUIDE.md).
|
||||
|
||||
## Anything else
|
||||
Feel free to reach out in our Discord or contact us via email.
|
||||
Void is a fork of the of [vscode](https://github.com/microsoft/vscode) repository.
|
||||
|
||||
For some useful links we've compiled see [`VOID_USEFUL_LINKS.md`](https://github.com/voideditor/void/blob/main/VOID_USEFUL_LINKS.md).
|
||||
|
||||
|
||||
## Support
|
||||
Feel free to reach out in our [Discord](https://discord.gg/PspNkKG5wt) or contact us via email.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Useful links
|
||||
|
||||
LineMage put together this list of links to get up and running with VSCode's sourcecode. We hope it's helpful!
|
||||
The Void team put together this list of links to get up and running with VSCode's sourcecode. We hope it's helpful!
|
||||
|
||||
## Beginners / Getting started
|
||||
|
||||
- [VSCode UI guide](https://code.visualstudio.com/docs/getstarted/userinterface) - covers auxbar, panels, etc.
|
||||
|
||||
|
||||
- [UX guide](https://code.visualstudio.com/api/ux-guidelines/overview) - covers Containers, Views, Items, etc.
|
||||
|
||||
## Contributing
|
||||
@@ -18,7 +18,7 @@ LineMage put together this list of links to get up and running with VSCode's sou
|
||||
|
||||
## VSCode's Extension API
|
||||
|
||||
LineMage is mostly an extension right now, and these links were very useful for us to get set up.
|
||||
Void is mainly an extension right now, and these links were very useful for us to get set up.
|
||||
|
||||
- [Files you need in an extension](https://code.visualstudio.com/api/get-started/extension-anatomy).
|
||||
|
||||
@@ -26,8 +26,8 @@ LineMage is mostly an extension right now, and these links were very useful for
|
||||
|
||||
- ["Contributes" Guide](https://code.visualstudio.com/api/references/contribution-points) - the `"contributes"` part of `package.json` is how an extension mounts.
|
||||
|
||||
- [Activation events](https://code.visualstudio.com/api/references/activation-events) you can define in `package.json`.
|
||||
|
||||
- [The Full VSCode Extension API](https://code.visualstudio.com/api/references/vscode-api) - look on the right side for organization. The [bottom](https://code.visualstudio.com/api/references/vscode-api#api-patterns) of the page is easy to miss but is useful - cancellation tokens, events, disposables.
|
||||
|
||||
- [Activation events](https://code.visualstudio.com/api/references/activation-events) you can define in `package.json` (not the most useful)
|
||||
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ function createGitIndexVinyls(paths) {
|
||||
return pall(fns, { concurrency: 4 }).then((r) => r.filter((p) => !!p));
|
||||
}
|
||||
|
||||
// NO PRE COMMIT HOOKS!!!! for now... - LineMage team
|
||||
// NO PRE COMMIT HOOKS!!!! for now... - Void team
|
||||
|
||||
// // this allows us to run hygiene as a git pre-commit hook
|
||||
// if (require.main === module) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
],
|
||||
"workbench": [
|
||||
{
|
||||
"name": "vs/workbench/contrib/linemage",
|
||||
"name": "vs/workbench/contrib/void",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ const fs = require('fs');
|
||||
|
||||
// Complete list of directories where yarn should be executed to install node modules
|
||||
const dirs = [
|
||||
'extensions/linemage', // <-- linemage
|
||||
'extensions/void', // <-- Void
|
||||
|
||||
'',
|
||||
'build',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "linemage",
|
||||
"displayName": "LineMage",
|
||||
"name": "void",
|
||||
"displayName": "Void",
|
||||
"description": "",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
@@ -15,32 +15,32 @@
|
||||
"configuration": {
|
||||
"title": "API Keys",
|
||||
"properties": {
|
||||
"linemage.whichApi": {
|
||||
"void.whichApi": {
|
||||
"type": "string",
|
||||
"default": "anthropic",
|
||||
"description": "Choose a model to use (anthropic | openai | greptile | ollama)"
|
||||
},
|
||||
"linemage.anthropicApiKey": {
|
||||
"void.anthropicApiKey": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Anthropic API Key"
|
||||
},
|
||||
"linemage.openAIApiKey": {
|
||||
"void.openAIApiKey": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "OpenAI API Key"
|
||||
},
|
||||
"linemage.greptileApiKey": {
|
||||
"void.greptileApiKey": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Greptile API Key"
|
||||
},
|
||||
"linemage.githubPAT": {
|
||||
"void.githubPAT": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Greptile - Github PAT (gives Greptile access to your repo)"
|
||||
},
|
||||
"linemage.ollamaSettings": {
|
||||
"void.ollamaSettings": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Ollama settings (coming soon...)"
|
||||
@@ -49,48 +49,48 @@
|
||||
},
|
||||
"commands": [
|
||||
{
|
||||
"command": "linemage.ctrl+l",
|
||||
"command": "void.ctrl+l",
|
||||
"title": "Show Sidebar"
|
||||
},
|
||||
{
|
||||
"command": "linemage.ctrl+k",
|
||||
"command": "void.ctrl+k",
|
||||
"title": "Show Selection Lens"
|
||||
},
|
||||
{
|
||||
"command": "linemage.approveDiff",
|
||||
"command": "void.approveDiff",
|
||||
"title": "Approve Diff"
|
||||
},
|
||||
{
|
||||
"command": "linemage.discardDiff",
|
||||
"command": "void.discardDiff",
|
||||
"title": "Discard Diff"
|
||||
}
|
||||
],
|
||||
"viewsContainers": {
|
||||
"activitybar": [
|
||||
{
|
||||
"id": "linemageViewContainer",
|
||||
"id": "voidViewContainer",
|
||||
"title": "My Extension",
|
||||
"icon": "$(hubot)"
|
||||
}
|
||||
]
|
||||
},
|
||||
"views": {
|
||||
"linemageViewContainer": [
|
||||
"voidViewContainer": [
|
||||
{
|
||||
"type": "webview",
|
||||
"id": "linemage.viewnumberone",
|
||||
"name": "LineMage"
|
||||
"id": "void.viewnumberone",
|
||||
"name": "Void"
|
||||
}
|
||||
]
|
||||
},
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "linemage.ctrl+l",
|
||||
"command": "void.ctrl+l",
|
||||
"key": "ctrl+l",
|
||||
"mac": "cmd+l"
|
||||
},
|
||||
{
|
||||
"command": "linemage.ctrl+k",
|
||||
"command": "void.ctrl+k",
|
||||
"key": "ctrl+k",
|
||||
"mac": "cmd+k"
|
||||
}
|
||||
+9
-10
@@ -51,9 +51,7 @@ export class ApprovalCodeLensProvider implements vscode.CodeLensProvider {
|
||||
|
||||
constructor() {
|
||||
// this acts as a useEffect. Every time text changes, clear the diffs in this editor
|
||||
// TODO ideally we wouldn't clear the diffs, we would just re-draw them and update their ranges
|
||||
vscode.workspace.onDidChangeTextDocument((e) => {
|
||||
// TODO we need to move all the codelenses and ranges below this one up/down depending on the number of newlines added - this is a known bug
|
||||
const editor = vscode.window.activeTextEditor
|
||||
if (!editor)
|
||||
return
|
||||
@@ -83,6 +81,10 @@ export class ApprovalCodeLensProvider implements vscode.CodeLensProvider {
|
||||
const diffs: DiffType[] = []
|
||||
for (let suggestedEdit of suggestedEdits) {
|
||||
|
||||
// TODO we need to account for this case (deletions)
|
||||
if (suggestedEdit.startLine > suggestedEdit.endLine)
|
||||
continue
|
||||
|
||||
const selectedRange = new vscode.Range(suggestedEdit.startLine, 0, suggestedEdit.endLine, Number.MAX_SAFE_INTEGER)
|
||||
|
||||
// if any other codelens intersects with the selection, ignore this edit
|
||||
@@ -117,8 +119,8 @@ export class ApprovalCodeLensProvider implements vscode.CodeLensProvider {
|
||||
for (let diff of diffs) {
|
||||
const { range, diffid, lenses: codeLenses } = diff
|
||||
|
||||
let approveLens = new vscode.CodeLens(range, { title: 'Accept', command: 'linemage.approveDiff', arguments: [{ diffid }] })
|
||||
let discardLens = new vscode.CodeLens(range, { title: 'Reject', command: 'linemage.discardDiff', arguments: [{ diffid }] })
|
||||
let approveLens = new vscode.CodeLens(range, { title: 'Accept', command: 'void.approveDiff', arguments: [{ diffid }] })
|
||||
let discardLens = new vscode.CodeLens(range, { title: 'Reject', command: 'void.discardDiff', arguments: [{ diffid }] })
|
||||
|
||||
codeLenses.push(discardLens, approveLens)
|
||||
}
|
||||
@@ -126,9 +128,6 @@ export class ApprovalCodeLensProvider implements vscode.CodeLensProvider {
|
||||
// 3. apply green highlighting for each (+) diff
|
||||
editor.setDecorations(greenDecoration, this._diffsOfDocument[docUriStr].map(diff => diff.range))
|
||||
|
||||
// 4. TODO create a red placeholder for each (-) diff
|
||||
// TODO...
|
||||
|
||||
// recompute _computedLensesOfDocument (can optimize this later)
|
||||
this._computedLensesOfDocument[docUriStr] = this._diffsOfDocument[docUriStr].flatMap(diff => diff.lenses)
|
||||
|
||||
@@ -138,7 +137,7 @@ export class ApprovalCodeLensProvider implements vscode.CodeLensProvider {
|
||||
console.log('diffs after added:', this._diffsOfDocument[docUriStr])
|
||||
}
|
||||
|
||||
// called on linemage.approveDiff
|
||||
// called on void.approveDiff
|
||||
public async approveDiff({ diffid }: { diffid: number }) {
|
||||
const editor = vscode.window.activeTextEditor
|
||||
if (!editor)
|
||||
@@ -168,7 +167,7 @@ export class ApprovalCodeLensProvider implements vscode.CodeLensProvider {
|
||||
}
|
||||
|
||||
|
||||
// called on linemage.discardDiff
|
||||
// called on void.discardDiff
|
||||
public async discardDiff({ diffid }: { diffid: number }) {
|
||||
const editor = vscode.window.activeTextEditor
|
||||
if (!editor)
|
||||
@@ -180,7 +179,7 @@ export class ApprovalCodeLensProvider implements vscode.CodeLensProvider {
|
||||
// get index of this diff in diffsOfDocument
|
||||
const index = this._diffsOfDocument[docUriStr].findIndex(diff => diff.diffid === diffid);
|
||||
if (index === -1) {
|
||||
console.error('LineMage error: DiffID could not be found: ', diffid, this._diffsOfDocument[docUriStr])
|
||||
console.error('Void error: DiffID could not be found: ', diffid, this._diffsOfDocument[docUriStr])
|
||||
return
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ function getNonce() {
|
||||
}
|
||||
|
||||
export class SidebarWebviewProvider implements vscode.WebviewViewProvider {
|
||||
public static readonly viewId = 'linemage.viewnumberone';
|
||||
public static readonly viewId = 'void.viewnumberone';
|
||||
|
||||
public webview: Promise<vscode.Webview> // used to send messages to the webview
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ export type ApiConfig = {
|
||||
githubPAT: string,
|
||||
repoinfo: {
|
||||
remote: string, // e.g. 'github'
|
||||
repository: string, // e.g. 'linemagedev/linemage'
|
||||
repository: string, // e.g. 'voideditor/void'
|
||||
branch: string // e.g. 'main'
|
||||
}
|
||||
},
|
||||
@@ -13,11 +13,11 @@ const readFileContentOfUri = async (uri: vscode.Uri) => {
|
||||
|
||||
const getApiConfig = () => {
|
||||
const apiConfig: ApiConfig = {
|
||||
anthropic: { apikey: vscode.workspace.getConfiguration('linemage').get('anthropicApiKey') ?? '' },
|
||||
openai: { apikey: vscode.workspace.getConfiguration('linemage').get('openAIApiKey') ?? '' },
|
||||
anthropic: { apikey: vscode.workspace.getConfiguration('void').get('anthropicApiKey') ?? '' },
|
||||
openai: { apikey: vscode.workspace.getConfiguration('void').get('openAIApiKey') ?? '' },
|
||||
greptile: {
|
||||
apikey: vscode.workspace.getConfiguration('linemage').get('greptileApiKey') ?? '',
|
||||
githubPAT: vscode.workspace.getConfiguration('linemage').get('githubPAT') ?? '',
|
||||
apikey: vscode.workspace.getConfiguration('void').get('greptileApiKey') ?? '',
|
||||
githubPAT: vscode.workspace.getConfiguration('void').get('githubPAT') ?? '',
|
||||
repoinfo: {
|
||||
remote: 'github',
|
||||
repository: 'TODO',
|
||||
@@ -25,9 +25,9 @@ const getApiConfig = () => {
|
||||
}
|
||||
},
|
||||
ollama: {
|
||||
// apikey: vscode.workspace.getConfiguration('linemage').get('ollamaSettings') ?? '',
|
||||
// apikey: vscode.workspace.getConfiguration('void').get('ollamaSettings') ?? '',
|
||||
},
|
||||
whichApi: vscode.workspace.getConfiguration('linemage').get('whichApi') ?? ''
|
||||
whichApi: vscode.workspace.getConfiguration('void').get('whichApi') ?? ''
|
||||
}
|
||||
return apiConfig
|
||||
}
|
||||
@@ -42,14 +42,14 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
// 2. Activate the sidebar on ctrl+l
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand('linemage.ctrl+l', () => {
|
||||
vscode.commands.registerCommand('void.ctrl+l', () => {
|
||||
|
||||
const editor = vscode.window.activeTextEditor
|
||||
if (!editor)
|
||||
return
|
||||
|
||||
// show the sidebar
|
||||
vscode.commands.executeCommand('workbench.view.extension.linemageViewContainer');
|
||||
vscode.commands.executeCommand('workbench.view.extension.voidViewContainer');
|
||||
// vscode.commands.executeCommand('vscode.moveViewToPanel', CustomViewProvider.viewId); // move to aux bar
|
||||
|
||||
// get the text the user is selecting
|
||||
@@ -71,10 +71,10 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
context.subscriptions.push(vscode.languages.registerCodeLensProvider('*', approvalCodeLensProvider));
|
||||
|
||||
// 4. Add approve/reject commands
|
||||
context.subscriptions.push(vscode.commands.registerCommand('linemage.approveDiff', async (params) => {
|
||||
context.subscriptions.push(vscode.commands.registerCommand('void.approveDiff', async (params) => {
|
||||
approvalCodeLensProvider.approveDiff(params)
|
||||
}));
|
||||
context.subscriptions.push(vscode.commands.registerCommand('linemage.discardDiff', async (params) => {
|
||||
context.subscriptions.push(vscode.commands.registerCommand('void.discardDiff', async (params) => {
|
||||
approvalCodeLensProvider.discardDiff(params)
|
||||
}));
|
||||
|
||||
@@ -85,7 +85,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
// when config changes, send it to the sidebar
|
||||
vscode.workspace.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration('linemage')) {
|
||||
if (e.affectsConfiguration('void')) {
|
||||
const apiConfig = getApiConfig()
|
||||
webview.postMessage({ type: 'apiConfig', apiConfig } satisfies WebviewMessage)
|
||||
}
|
||||
@@ -140,7 +140,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
// const ctrlKCodeLensProvider = new CtrlKCodeLensProvider();
|
||||
// context.subscriptions.push(vscode.languages.registerCodeLensProvider('*', ctrlKCodeLensProvider));
|
||||
// context.subscriptions.push(
|
||||
// vscode.commands.registerCommand('linemage.ctrl+k', () => {
|
||||
// vscode.commands.registerCommand('void.ctrl+k', () => {
|
||||
// const editor = vscode.window.activeTextEditor;
|
||||
// if (!editor)
|
||||
// return
|
||||
+18
-3
@@ -12,7 +12,7 @@ import * as vscode from 'vscode'
|
||||
const filesStr = (fullFiles: File[]) => {
|
||||
return fullFiles.map(({ filepath, content }) =>
|
||||
`
|
||||
${filepath}
|
||||
${filepath.fsPath}
|
||||
\`\`\`
|
||||
${content}
|
||||
\`\`\``).join('\n')
|
||||
@@ -203,6 +203,7 @@ const Sidebar = () => {
|
||||
|
||||
// add message to chat history
|
||||
const content = userInstructionsStr(instructions, relevantFiles.files, selection)
|
||||
// console.log('prompt:\n', content)
|
||||
const newHistoryElt: ChatMessage = { role: 'user', content, displayContent: instructions, selection, files }
|
||||
setChatHistory(chatMessageHistory => [...chatMessageHistory, newHistoryElt])
|
||||
|
||||
@@ -240,6 +241,11 @@ const Sidebar = () => {
|
||||
|
||||
}, [messageStream])
|
||||
|
||||
//Clear code selection
|
||||
const clearSelection = () => {
|
||||
setSelection(null);
|
||||
};
|
||||
|
||||
return <>
|
||||
<div className="flex flex-col h-full w-full">
|
||||
<div className="flex-grow overflow-y-auto overflow-x-hidden p-4">
|
||||
@@ -258,8 +264,17 @@ const Sidebar = () => {
|
||||
<FilesSelector files={files} setFiles={setFiles} />
|
||||
{/* selected code */}
|
||||
{!selection?.selectionStr ? null
|
||||
: <BlockCode text={selection?.selectionStr} disableApplyButton={true} />
|
||||
}
|
||||
: (
|
||||
<div className="relative">
|
||||
<button
|
||||
onClick={clearSelection}
|
||||
className="absolute top-2 right-2 text-white hover:text-gray-300 z-10"
|
||||
>
|
||||
X
|
||||
</button>
|
||||
<BlockCode text={selection.selectionStr} disableApplyButton={true} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<form
|
||||
ref={formRef}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"nameShort": "LineMage",
|
||||
"nameLong": "LineMage",
|
||||
"nameShort": "Void",
|
||||
"nameLong": "Void",
|
||||
"applicationName": "code-oss",
|
||||
"dataFolderName": ".vscode-oss",
|
||||
"win32MutexName": "vscodeoss",
|
||||
|
||||
+1
-1
@@ -320,7 +320,7 @@ function configureCommandlineSwitchesSync(cliArgs) {
|
||||
app.commandLine.appendSwitch('disable-features', featuresToDisable);
|
||||
|
||||
// Blink features to configure.
|
||||
// `FontMatchingCTMigration` - Siwtch font matching on macOS to Appkit (Refs https://github.com/microsoft/vscode/issues/224496#issuecomment-2270418470).
|
||||
// `FontMatchingCTMigration` - Switch font matching on macOS to Appkit (Refs https://github.com/microsoft/vscode/issues/224496#issuecomment-2270418470).
|
||||
const blinkFeaturesToDisable =
|
||||
`FontMatchingCTMigration,${app.commandLine.getSwitchValue('disable-blink-features')}`;
|
||||
app.commandLine.appendSwitch('disable-blink-features', blinkFeaturesToDisable);
|
||||
|
||||
@@ -552,8 +552,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
},
|
||||
|
||||
|
||||
// LINEMAGE added this (I think will need to add this back when add ctrl+K)
|
||||
// registerLineMageCtrlKProvider(selector: vscode.DocumentSelector, provider: vscode.CodeLensProvider): vscode.Disposable {
|
||||
// VOID added this (I think will need to add this back when add ctrl+K)
|
||||
// registerVoidCtrlKProvider(selector: vscode.DocumentSelector, provider: vscode.CodeLensProvider): vscode.Disposable {
|
||||
// return extHostLanguageFeatures.registerCodeLensProvider(extension, checkSelector(selector), provider);
|
||||
// },
|
||||
|
||||
|
||||
@@ -304,16 +304,17 @@ const newCommands: ApiCommand[] = [
|
||||
})(value);
|
||||
})
|
||||
),
|
||||
// // --- LineMage code lens
|
||||
// // --- Void code lens
|
||||
// new ApiCommand(
|
||||
// 'vscode.executeLineMageCodeLensProvider', '_executeLineMageCodeLensProvider', 'Execute LineMage code lens provider.',
|
||||
// 'vscode.executeVoidCodeLensProvider', '_executeVoidCodeLensProvider', 'Execute Void code lens provider.',
|
||||
// [ApiCommandArgument.Uri, ApiCommandArgument.Number.with('itemResolveCount', 'Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)').optional()],
|
||||
// new ApiCommandResult<languages.CodeLens[], vscode.CodeLens[] | undefined>('A promise that resolves to an array of LineMageCodeLens-instances.', (value, _args, converter) => {
|
||||
// new ApiCommandResult<languages.CodeLens[], vscode.CodeLens[] | undefined>('A promise that resolves to an array of VoidCodeLens-instances.', (value, _args, converter) => {
|
||||
// return tryMapWith<languages.CodeLens, vscode.CodeLens>(item => {
|
||||
// return new types.CodeLens(typeConverters.Range.to(item.range), item.command && converter.fromInternal(item.command));
|
||||
// })(value);
|
||||
// })
|
||||
// ),
|
||||
|
||||
// --- code actions
|
||||
new ApiCommand(
|
||||
'vscode.executeCodeActionProvider', '_executeCodeActionProvider', 'Execute code action provider.',
|
||||
|
||||
+8
-8
@@ -7,7 +7,7 @@ import {
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
import { LineMageViewPane } from 'vs/workbench/contrib/linemage/browser/linemageViewPane'
|
||||
import { VoidViewPane } from 'vs/workbench/contrib/void/browser/voidViewPane'
|
||||
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -18,22 +18,22 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
|
||||
|
||||
const linemageViewIcon = registerIcon('linemage-view-icon', Codicon.search, localize('linemageViewIcon', 'View icon of the linemage chat view.'));
|
||||
const voidViewIcon = registerIcon('void-view-icon', Codicon.search, localize('voidViewIcon', 'View icon of the Void chat view.'));
|
||||
|
||||
|
||||
// compare against search.contribution.ts and https://app.greptile.com/chat/w1nsmt3lauwzculipycpn?repo=github%3Amain%3Amicrosoft%2Fvscode
|
||||
// and debug.contribution.ts, scm.contribution.ts (source control)
|
||||
|
||||
const VIEW_CONTAINER_ID = 'workbench.view.linemage' // called VIEWLET_ID in other places for some reason
|
||||
const VIEW_CONTAINER_ID = 'workbench.view.void' // called VIEWLET_ID in other places for some reason
|
||||
|
||||
// Register view container
|
||||
const viewContainerRegistry = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry);
|
||||
const viewContainer = viewContainerRegistry.registerViewContainer({
|
||||
id: VIEW_CONTAINER_ID,
|
||||
title: nls.localize2('linemage', 'LineMage'), // this is used to say LineMage (Ctrl + L)
|
||||
title: nls.localize2('void', 'Void'), // this is used to say "Void" (Ctrl + L)
|
||||
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [VIEW_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]),
|
||||
hideIfEmpty: false,
|
||||
icon: linemageViewIcon,
|
||||
icon: voidViewIcon,
|
||||
order: 1,
|
||||
}, ViewContainerLocation.AuxiliaryBar, { doNotRegisterOpenCommand: true });
|
||||
|
||||
@@ -45,9 +45,9 @@ const viewContainer = viewContainerRegistry.registerViewContainer({
|
||||
const VIEW_ID = VIEW_CONTAINER_ID // not sure if we can change this
|
||||
const viewDescriptor: IViewDescriptor = {
|
||||
id: VIEW_ID,
|
||||
containerIcon: linemageViewIcon,
|
||||
name: nls.localize2('linemage chat', "Chat"), // this says ... : CHAT
|
||||
ctorDescriptor: new SyncDescriptor(LineMageViewPane),
|
||||
containerIcon: voidViewIcon,
|
||||
name: nls.localize2('void chat', "Chat"), // this says ... : CHAT
|
||||
ctorDescriptor: new SyncDescriptor(VoidViewPane),
|
||||
canToggleVisibility: false,
|
||||
canMoveView: true,
|
||||
openCommandActionDescriptor: {
|
||||
+1
-1
@@ -16,7 +16,7 @@ import { ViewPane } from 'vs/workbench/browser/parts/views/viewPane';
|
||||
// import { IHoverService } from 'vs/platform/hover/browser/hover';
|
||||
|
||||
|
||||
export class LineMageViewPane extends ViewPane {
|
||||
export class VoidViewPane extends ViewPane {
|
||||
|
||||
// constructor(
|
||||
// options: IViewPaneOptions,
|
||||
@@ -3,8 +3,8 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
//#region --- linemage
|
||||
import 'vs/workbench/contrib/linemage/browser/linemage.contribution'
|
||||
//#region --- void
|
||||
import 'vs/workbench/contrib/void/browser/void.contribution'
|
||||
//#endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user