voideditor / void

https://voideditor.com
MIT License
8.12k stars 407 forks source link

Why not a vscode plugin? #70

Closed y-nk closed 1 month ago

y-nk commented 1 month ago

I've searched the entire repo but it's not mentioned. I'm sure there should be some limitations of vscode, but could we get an official explanation?

I'm rather attached to the frequent updates of vscode and switching IDE is not really an option, but at the same time this looks v. promising so it's something i consider trying. A plugin would be the perfect sweet spot.

SnowerII commented 1 month ago

@y-nk infact, its about vscode extension development, you can see this artical, i learn from it, https://juejin.cn/post/7411804720127803431

i tried vsce package command to make a VSIX package. but it doesnt work, the webview cant show,it keep loading.

i dont know its because i upgrate my vscode to 1.93, or its because Void using react..

SnowerII commented 1 month ago

before i tried vsce command, i did add "compile" command at "scripts" in package.json, and change its vscode requirement from "^1.8.9" to "^1.9.3"(because im using 1.9.3). then it can make VSIX package

SnowerII commented 1 month ago

@y-nk i succeed, before you package VSIX, you need edit package.json , i'll paste mine

{ "name": "void", "displayName": "Void", "description": "", "version": "0.0.1", "engines": { "vscode": "^1.93.0" }, "categories": [ "Other" ], "activationEvents": [], "main": "./out/extension.js", "contributes": { "configuration": { "title": "API Keys", "properties": { "void.whichApi": { "type": "string", "default": "anthropic", "description": "Choose a model to use (anthropic | openai | greptile | ollama)" }, "void.anthropicApiKey": { "type": "string", "default": "", "description": "Anthropic API Key" }, "void.openAIApiKey": { "type": "string", "default": "", "description": "OpenAI API Key" }, "void.greptileApiKey": { "type": "string", "default": "", "description": "Greptile API Key" }, "void.githubPAT": { "type": "string", "default": "", "description": "Greptile - Github PAT (gives Greptile access to your repo)" }, "void.ollamaSettings": { "type": "string", "default": "", "description": "Ollama settings (coming soon...)" } } }, "commands": [ { "command": "void.ctrl+l", "title": "Show Sidebar" }, { "command": "void.ctrl+k", "title": "Show Selection Lens" }, { "command": "void.approveDiff", "title": "Approve Diff" }, { "command": "void.discardDiff", "title": "Discard Diff" } ], "viewsContainers": { "activitybar": [ { "id": "voidViewContainer", "title": "Chat", "icon": "$(hubot)" } ] }, "views": { "voidViewContainer": [ { "type": "webview", "id": "void.viewnumberone", "name": "Void" } ] }, "keybindings": [ { "command": "void.ctrl+l", "key": "ctrl+l", "mac": "cmd+l" }, { "command": "void.ctrl+k", "key": "ctrl+k", "mac": "cmd+k" } ] }, "scripts": { "vscode:prepublish": "npm run compile", "watch": "tsc -watch -p ./", "compile": "tsc -p ./", "build": "rimraf dist && node build-tsx.js && node build-css.js", "pretest": "tsc -p ./ && eslint src --ext ts", "test": "vscode-test" }, "devDependencies": { "@eslint/js": "^9.9.1", "@types/diff": "^5.2.2", "@types/jest": "^29.5.12", "@types/mocha": "^10.0.8", "@types/node": "^22.5.1", "@types/react": "^18.3.4", "@types/react-dom": "^18.3.0", "@types/vscode": "1.92.0", "@typescript-eslint/eslint-plugin": "^8.3.0", "@typescript-eslint/parser": "^8.3.0", "@vscode/test-cli": "^0.0.10", "@vscode/test-electron": "2.4.1", "autoprefixer": "^10.4.20", "esbuild": "^0.23.1", "eslint": "^8.57.0", "eslint-plugin-react": "^7.35.1", "eslint-plugin-react-hooks": "^4.6.2", "globals": "^15.9.0", "marked": "^14.1.0", "ollama": "^0.5.8", "postcss": "^8.4.41", "react": "^18.3.1", "react-dom": "^18.3.1", "react-markdown": "^9.0.1", "rimraf": "^6.0.1", "tailwindcss": "^3.4.10", "typescript": "5.5.4", "typescript-eslint": "^8.3.0" }, "dependencies": { "@anthropic-ai/sdk": "^0.27.1", "diff": "^7.0.0", "openai": "^4.57.0" } }

then, delete package.lock.json , and then:

  1. use YARN , yarn install
  2. npm run build
  3. vsce package

then works. other details you need check VSCODE offical API , like how to package, how to develop WebView-View extension https://code.visualstudio.com/api/working-with-extensions/publishing-extension

y-nk commented 1 month ago

then why repo owner not doing this?

SnowerII commented 1 month ago

maybe they are busy, i check the commit activity, seems this repo just began in month, haha Anyway, we finally figured out how to package the vscode plug-in package. Others can do secondary development of AI code plug-in types based on this

andrewpareles commented 1 month ago

Extensions are missing a lot of UI needed for a great developer experience. For example, a lot of extensions feel jumpy, or make users enter their prompt in the quick pick menu, or don't have convenient ways of viewing diffs. These things break the flow of the editor.

Void uses an extension to implement its core functionality (see /extensions/void), but we also let the extension hook into custom UI not available to extensions by default.