Compare commits

...

73 Commits

Author SHA1 Message Date
Andrew Pareles 04fd13f473 Update CONTRIBUTING.md
Clarifications in contributing
2024-09-18 14:21:57 -07:00
Andrew Pareles 085e622c1b Merge pull request #25 from sunmorgan/mdev 2024-09-18 09:42:55 -07:00
Morgan Sun 4cd40ca312 Update Sidebar.tsx 2024-09-17 22:20:58 -04:00
Morgan Sun aada99d55b Revert "Create an x that clears selection"
This reverts commit 0b09b3621f.
2024-09-17 22:17:51 -04:00
Morgan Sun 0b09b3621f Create an x that clears selection 2024-09-17 22:11:48 -04:00
Mathew Pareles a299cd58c7 Update CONTRIBUTING.md 2024-09-17 18:18:59 -07:00
Mathew Pareles bdc3e7927a Update CONTRIBUTING.md 2024-09-17 18:18:47 -07:00
Mathew Pareles c2d131da7b Update CONTRIBUTING.md 2024-09-17 18:18:27 -07:00
Mathew Pareles 78c7374bd9 Update CONTRIBUTING.md 2024-09-17 17:10:01 -07:00
Andrew Pareles 7acca7e9c9 Update CONTRIBUTING.md 2024-09-17 17:00:48 -07:00
Mathew Pareles ac7581a14a Update CONTRIBUTING.md 2024-09-17 16:34:23 -07:00
Andrew Pareles fbd94a84d4 Update CONTRIBUTING.md 2024-09-17 16:19:38 -07:00
Andrew Pareles 0e55713e55 Update README.md 2024-09-17 16:16:33 -07:00
Andrew Pareles fe578eb6e8 Update README.md 2024-09-17 16:15:59 -07:00
Andrew Pareles fc3aec52bb Update README.md 2024-09-17 15:42:39 -07:00
Andrew Pareles a03e845275 Update README.md 2024-09-17 15:42:16 -07:00
Andrew Pareles 81f836de4f Update CONTRIBUTING.md 2024-09-17 15:40:05 -07:00
Andrew Pareles 0455606ec6 Update CONTRIBUTING.md 2024-09-17 15:39:34 -07:00
Andrew Pareles 8de0f9d87b Update CONTRIBUTING.md 2024-09-17 15:35:59 -07:00
Andrew Pareles 4137df7843 Update CONTRIBUTING.md 2024-09-17 15:31:41 -07:00
Andrew Pareles c1355f0e68 Update CONTRIBUTING.md 2024-09-17 15:30:52 -07:00
Andrew Pareles 3bef1800da Update CONTRIBUTING.md 2024-09-17 15:30:08 -07:00
Andrew Pareles 8dd68351bc Update CONTRIBUTING.md 2024-09-17 15:28:25 -07:00
Andrew fa977d7c9a Merge branch 'main' of https://github.com/voideditor/void 2024-09-17 14:43:20 -07:00
Andrew 25c2c177b2 deletions comment 2024-09-17 14:43:15 -07:00
Andrew Pareles 2264e08c55 Update README.md 2024-09-17 14:06:32 -07:00
Mathew Pareles 6b92e6b218 Update CONTRIBUTING.md 2024-09-17 13:30:40 -07:00
Andrew Pareles 448203213c Merge pull request #1 from joshuajerin/patch-1
Add Discord Link
2024-09-17 13:11:15 -07:00
Andrew Pareles 866505ac84 Update README.md 2024-09-17 12:23:00 -07:00
Andrew Pareles 79358e1d15 Update CONTRIBUTING.md 2024-09-17 12:00:46 -07:00
Andrew Pareles 44106b0333 Merge pull request #3 from eltociear/patch-1
chore: update main.js
2024-09-17 09:26:49 -07:00
Ikko Eltociear Ashimine f23897480b chore: update main.js
Siwtch -> Switch
2024-09-17 23:22:00 +09:00
Andrew Pareles 8914d1e028 Update CONTRIBUTING.md 2024-09-16 20:34:10 -07:00
Andrew Pareles 309687c189 Update CONTRIBUTING.md 2024-09-16 20:15:45 -07:00
Andrew Pareles a8adaab1fd Update CONTRIBUTING.md 2024-09-16 20:15:36 -07:00
Andrew Pareles ac9fbce495 Update CONTRIBUTING.md 2024-09-16 20:14:04 -07:00
Andrew Pareles f5ada67ca7 Update README.md 2024-09-16 20:12:14 -07:00
Joshua Jerin 22d2ef1813 Update README.md 2024-09-16 08:07:21 -04:00
Mathew Pareles 8eea041a1e Update CONTRIBUTING.md 2024-09-15 21:29:09 -07:00
Mathew Pareles e3dd062950 Update CONTRIBUTING.md 2024-09-15 21:28:27 -07:00
Mathew Pareles 5f05405280 Update CONTRIBUTING.md 2024-09-15 21:28:00 -07:00
Andrew Pareles 50b79bab3d Update CONTRIBUTING.md 2024-09-15 19:12:44 -07:00
Andrew Pareles ba639ae108 Update CONTRIBUTING.md 2024-09-15 19:10:53 -07:00
Andrew Pareles b8ccb80e71 Update CONTRIBUTING.md 2024-09-15 19:08:28 -07:00
Andrew Pareles cab499581e Update VOID_USEFUL_LINKS.md 2024-09-15 19:07:46 -07:00
Andrew Pareles b44f575713 Update CONTRIBUTING.md 2024-09-15 03:30:43 -07:00
Andrew Pareles ff97a34d54 Update CONTRIBUTING.md 2024-09-15 03:29:01 -07:00
Andrew Pareles ae658dfc74 Update CONTRIBUTING.md 2024-09-15 03:28:36 -07:00
Andrew Pareles 8a780dcfab Update CONTRIBUTING.md 2024-09-15 03:26:46 -07:00
Andrew Pareles 78b2d0e0dd Update README.md 2024-09-13 11:20:18 -07:00
Mathew Pareles 5f8fe11d0c Update CONTRIBUTING.md 2024-09-13 11:08:33 -07:00
Mathew Pareles d30e686c03 Update CONTRIBUTING.md 2024-09-13 11:07:15 -07:00
Mathew Pareles efddc17ad8 Update CONTRIBUTING.md 2024-09-13 11:04:26 -07:00
Mathew Pareles 2c059587ac Update CONTRIBUTING.md 2024-09-12 08:39:16 -07:00
Andrew 3f132ca9e5 add comment 2024-09-12 07:59:35 -07:00
Andrew Pareles 58c57e5768 Update README.md 2024-09-12 03:41:24 -07:00
Andrew Pareles 436fc6d068 Update README.md 2024-09-12 03:41:15 -07:00
Andrew Pareles a23e0f1376 Update README.md 2024-09-12 03:41:02 -07:00
Andrew a893ecd380 rename contrib/linemage -> contrib/void, and extensions/linemage -> extensions/void 2024-09-12 03:37:25 -07:00
Andrew 2b4652499d rename linemage -> void, LineMage -> Void (partial) 2024-09-12 03:35:24 -07:00
Andrew Pareles 210b2a5759 Update CONTRIBUTING.md 2024-09-11 22:56:01 -07:00
Andrew 8698908881 + 2024-09-11 22:33:53 -07:00
Mathew Pareles 715278ebbf Update CONTRIBUTING.md 2024-09-11 21:26:19 -07:00
Mathew Pareles 796ca4f696 Update CONTRIBUTING.md 2024-09-11 21:26:09 -07:00
Mathew Pareles 363b98a55e Update CONTRIBUTING.md 2024-09-11 21:25:30 -07:00
Mathew Pareles f5bccdd4cb Update CONTRIBUTING.md 2024-09-11 21:23:04 -07:00
Mathew Pareles 4b24dee1a9 Update CONTRIBUTING.md 2024-09-11 21:21:42 -07:00
Mathew Pareles a50b53a461 Update CONTRIBUTING.md 2024-09-11 21:20:13 -07:00
Mathew Pareles 0166de1d81 Update CONTRIBUTING.md 2024-09-11 21:19:46 -07:00
Mathew Pareles c78d19473f Update CONTRIBUTING.md 2024-09-11 21:18:42 -07:00
Mathew Pareles cf36aef12d Update CONTRIBUTING.md 2024-09-11 21:17:49 -07:00
Mathew Pareles 2f1f5e0267 Update CONTRIBUTING.md 2024-09-11 20:28:25 -07:00
Andrew Pareles a772adee4b Update CONTRIBUTING.md 2024-09-11 06:27:22 -07:00
43 changed files with 194 additions and 232 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "LineMage",
"name": "Void",
"build": {
"dockerfile": "Dockerfile"
},
+2 -2
View File
@@ -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",
+1 -1
View File
@@ -93,7 +93,7 @@
}
],
"git.ignoreLimitWarning": true,
// we removed this for LineMage:
// we removed this for Void:
// "git.branchProtection": [
// "main",
// "distro",
+93 -148
View File
@@ -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. This is where most of Void's code lives, and it's where you should get started if you're new.
1. Clone the repository:
```
git clone https://github.com/voideditor/void
```
2. Open the folder `/extensions/void` in VS Code (open it in a new workspace, *don't* just cd into it):
```
open /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.
+10 -8
View File
@@ -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
View File
@@ -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) {
+1 -1
View File
@@ -19,7 +19,7 @@
],
"workbench": [
{
"name": "vs/workbench/contrib/linemage",
"name": "vs/workbench/contrib/void",
"project": "vscode-workbench"
},
{
+1 -1
View File
@@ -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"
}
@@ -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
}
@@ -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
@@ -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
@@ -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
View File
@@ -1,6 +1,6 @@
{
"nameShort": "LineMage",
"nameLong": "LineMage",
"nameShort": "Void",
"nameLong": "Void",
"applicationName": "code-oss",
"dataFolderName": ".vscode-oss",
"win32MutexName": "vscodeoss",
+1 -1
View File
@@ -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.',
@@ -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: {
@@ -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,
+2 -2
View File
@@ -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