Skip to content

Commit

Permalink
Merge pull request #205 from sourcery-ai/ben/sou-1699-feat-deploy-the…
Browse files Browse the repository at this point in the history
…-coding-assistant-application-in-vscode

feat: deploy the coding assistant application in vscode
  • Loading branch information
bm424 authored Aug 22, 2023
2 parents bb43bf8 + 1ce9f7a commit 60e81fc
Show file tree
Hide file tree
Showing 14 changed files with 3,583 additions and 2,971 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# Except src and media:
!/src
!/media

# But do ignore resource webview assets
/src/resources/webview/assets/*
173 changes: 173 additions & 0 deletions media/ide-styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
:root {
--background: var(--vscode-sideBar-background); /* main background */
--foreground: var(--vscode-foreground); /* foreground text */
--editor: var(--vscode-editor-background); /* editor background */
--chat: var(
--vscode-settings-textInputBackground
); /* chat bubble background */
--error: var(--vscode-inputValidation-errorBackground); /* error background */
--disabled: var(--vscode-disabledForeground); /* disabled foreground */
--border: var(--vscode-panel-border); /* border */
--primary: var(--vscode-button-background);
--highlight: orange;
}

html {
font-size: var(--vscode-font-size);
}

body.vscode-light .hljs {
color: #24292e;
background: #fff;
}
body.vscode-light .hljs-doctag,
body.vscode-light .hljs-keyword,
body.vscode-light .hljs-meta body.vscode-light .hljs-keyword,
body.vscode-light .hljs-template-tag,
body.vscode-light .hljs-template-variable,
body.vscode-light .hljs-type,
body.vscode-light .hljs-variable.language_ {
color: #d73a49;
}
body.vscode-light .hljs-title,
body.vscode-light .hljs-title.class_,
body.vscode-light .hljs-title.class_.inherited__,
body.vscode-light .hljs-title.function_ {
color: #6f42c1;
}
body.vscode-light .hljs-attr,
body.vscode-light .hljs-attribute,
body.vscode-light .hljs-literal,
body.vscode-light .hljs-meta,
body.vscode-light .hljs-number,
body.vscode-light .hljs-operator,
body.vscode-light .hljs-selector-attr,
body.vscode-light .hljs-selector-class,
body.vscode-light .hljs-selector-id,
body.vscode-light .hljs-variable {
color: #005cc5;
}
body.vscode-light .hljs-meta body.vscode-light .hljs-string,
body.vscode-light .hljs-regexp,
body.vscode-light .hljs-string {
color: #032f62;
}
body.vscode-light .hljs-built_in,
body.vscode-light .hljs-symbol {
color: #e36209;
}
body.vscode-light .hljs-code,
body.vscode-light .hljs-comment,
body.vscode-light .hljs-formula {
color: #6a737d;
}
body.vscode-light .hljs-name,
body.vscode-light .hljs-quote,
body.vscode-light .hljs-selector-pseudo,
body.vscode-light .hljs-selector-tag {
color: #22863a;
}
body.vscode-light .hljs-subst {
color: #24292e;
}
body.vscode-light .hljs-section {
color: #005cc5;
font-weight: 700;
}
body.vscode-light .hljs-bullet {
color: #735c0f;
}
body.vscode-light .hljs-emphasis {
color: #24292e;
font-style: italic;
}
body.vscode-light .hljs-strong {
color: #24292e;
font-weight: 700;
}
body.vscode-light .hljs-addition {
color: #22863a;
background-color: #f0fff4;
}
body.vscode-light .hljs-deletion {
color: #b31d28;
background-color: #ffeef0;
}

body.vscode-dark .hljs {
color: #c9d1d9;
background: #0d1117;
}
body.vscode-dark .hljs-doctag,
body.vscode-dark .hljs-keyword,
body.vscode-dark .hljs-meta body.vscode-dark .hljs-keyword,
body.vscode-dark .hljs-template-tag,
body.vscode-dark .hljs-template-variable,
body.vscode-dark .hljs-type,
body.vscode-dark .hljs-variable.language_ {
color: #ff7b72;
}
body.vscode-dark .hljs-title,
body.vscode-dark .hljs-title.class_,
body.vscode-dark .hljs-title.class_.inherited__,
body.vscode-dark .hljs-title.function_ {
color: #d2a8ff;
}
body.vscode-dark .hljs-attr,
body.vscode-dark .hljs-attribute,
body.vscode-dark .hljs-literal,
body.vscode-dark .hljs-meta,
body.vscode-dark .hljs-number,
body.vscode-dark .hljs-operator,
body.vscode-dark .hljs-selector-attr,
body.vscode-dark .hljs-selector-class,
body.vscode-dark .hljs-selector-id,
body.vscode-dark .hljs-variable {
color: #79c0ff;
}
body.vscode-dark .hljs-meta body.vscode-dark .hljs-string,
body.vscode-dark .hljs-regexp,
body.vscode-dark .hljs-string {
color: #a5d6ff;
}
body.vscode-dark .hljs-built_in,
body.vscode-dark .hljs-symbol {
color: #ffa657;
}
body.vscode-dark .hljs-code,
body.vscode-dark .hljs-comment,
body.vscode-dark .hljs-formula {
color: #8b949e;
}
body.vscode-dark .hljs-name,
body.vscode-dark .hljs-quote,
body.vscode-dark .hljs-selector-pseudo,
body.vscode-dark .hljs-selector-tag {
color: #7ee787;
}
body.vscode-dark .hljs-subst {
color: #c9d1d9;
}
body.vscode-dark .hljs-section {
color: #1f6feb;
font-weight: 700;
}
body.vscode-dark .hljs-bullet {
color: #f2cc60;
}
body.vscode-dark .hljs-emphasis {
color: #c9d1d9;
font-style: italic;
}
body.vscode-dark .hljs-strong {
color: #c9d1d9;
font-weight: 700;
}
body.vscode-dark .hljs-addition {
color: #aff5b4;
background-color: #033a16;
}
body.vscode-dark .hljs-deletion {
color: #ffdcd7;
background-color: #67060c;
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 1 addition & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,6 @@
"contextualTitle": "Troubleshooting",
"when": "sourcery.features.coding_assistant_troubleshooting"
},
{
"id": "sourcery.recipes",
"name": "Recipes",
"type": "webview",
"icon": "sourcery-icon.png",
"contextualTitle": "Recipes",
"when": "sourcery.features.coding_assistant"
},
{
"id": "sourcery.code_review",
"name": "Code Review",
"type": "webview",
"icon": "sourcery-icon.png",
"contextualTitle": "Code Review",
"when": "sourcery.features.code_review"
},
{
"id": "sourcery.rules",
"name": "Rules",
Expand Down Expand Up @@ -248,11 +232,6 @@
"title": "Toggle Advanced Mode",
"category": "Sourcery"
},
{
"command": "sourcery.chat.clearChat",
"title": "Clear",
"category": "Sourcery"
},
{
"command": "sourcery.chat.clearCodeReview",
"title": "Clear",
Expand Down Expand Up @@ -316,16 +295,6 @@
"when": "view == sourcery.rules",
"group": "navigation"
},
{
"command": "sourcery.chat.clearChat",
"when": "view == sourcery.chat",
"group": "navigation"
},
{
"command": "sourcery.chat.clearCodeReview",
"when": "view == sourcery.code_review",
"group": "navigation"
},
{
"command": "sourcery.troubleshoot.reset",
"when": "view == sourcery.troubleshooting",
Expand Down Expand Up @@ -400,10 +369,6 @@
"command": "sourcery.scan.toggleAdvanced",
"when": "false"
},
{
"command": "sourcery.chat.clearChat",
"when": "false"
},
{
"command": "sourcery.chat.clearCodeReview",
"when": "false"
Expand Down Expand Up @@ -485,7 +450,7 @@
"compile": "tsc -watch -p ./",
"compile-webviews": "tsc -watch ./src/webview/*.ts",
"vscode": "npm run vscode:prepublish && VSCODE=$(which code-insiders || which code || echo echo ERROR: neither the code nor code-insiders vscode executable is installed); USER=dummy-dont-share-vscode-instance \"$VSCODE\" --user-data-dir=$PWD/.vscode-dev/user-data --verbose --extensionHomePath=$PWD/.vscode-dev/extensions --extensionDevelopmentPath=$PWD $*",
"vscode_local": "SOURCERY_EXECUTABLE=../core/run-sourcery.sh yarn run vscode",
"vscode_local": "SOURCERY_EXECUTABLE=/home/ben/Documents/dev/sourcery-ai/core/run-sourcery.sh yarn run vscode",
"format": "prettier --write .",
"lint:format": "prettier --check .",
"vscode:prepublish": "npm run esbuild-base -- --minify",
Expand Down
9 changes: 4 additions & 5 deletions src/ask-sourcery.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import * as vscode from "vscode";
import { Recipe, RecipeProvider } from "./recipes";
import { ChatRequest } from "./chat";
import { Recipe, ServerRequest } from "./chat";

export function askSourceryCommand(recipes: Recipe[], contextRange?) {
showAskSourceryQuickPick(recipes).then((result: any) => {
let request: ChatRequest;
let request: ServerRequest;
if ("id" in result) {
request = {
type: "recipe_request",
type: "recipeRequest",
data: {
kind: "recipe_request",
name: result.label,
Expand All @@ -17,7 +16,7 @@ export function askSourceryCommand(recipes: Recipe[], contextRange?) {
};
} else {
request = {
type: "chat_request",
type: "chatRequest",
data: { kind: "user_message", message: result.label },
context_range: contextRange,
};
Expand Down
Loading

0 comments on commit 60e81fc

Please sign in to comment.