diff --git a/.vscode/launch.json b/.vscode/launch.json
index 54d282cc8a..8967930402 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -17,10 +17,7 @@
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode"
],
"pauseForSourceMap": false,
- "outFiles": [
- "${workspaceFolder}/extensions/vscode/out/extension.js",
- "/Users/natesesti/.continue/config.ts"
- ],
+ "outFiles": ["${workspaceFolder}/extensions/vscode/out/extension.js"],
"preLaunchTask": "vscode-extension:build",
"env": {
// "CONTROL_PLANE_ENV": "local"
diff --git a/core/commands/slash/comment.ts b/core/commands/slash/comment.ts
index 929763bf3e..e3b601c04d 100644
--- a/core/commands/slash/comment.ts
+++ b/core/commands/slash/comment.ts
@@ -1,5 +1,5 @@
-import { SlashCommand } from "../../index.js";
-import EditSlashCommand from "./edit.js";
+import { SlashCommand } from "../../";
+import EditSlashCommand from "./edit";
const CommentSlashCommand: SlashCommand = {
name: "comment",
diff --git a/core/commands/slash/edit.ts b/core/commands/slash/edit.ts
index a0fbfdd26a..a3c3ed91ce 100644
--- a/core/commands/slash/edit.ts
+++ b/core/commands/slash/edit.ts
@@ -5,18 +5,18 @@ import {
fixCodeLlamaFirstLineIndentation,
stopAtLines,
streamWithNewLines,
-} from "../../autocomplete/lineStream.js";
-import { streamLines } from "../../diff/util.js";
-import { ContextItemWithId, ILLM, SlashCommand } from "../../index.js";
-import { stripImages } from "../../llm/images.js";
+} from "../../autocomplete/lineStream";
+import { streamLines } from "../../diff/util";
+import { ContextItemWithId, ILLM, SlashCommand } from "../../";
+import { stripImages } from "../../llm/images";
import {
dedentAndGetCommonWhitespace,
getMarkdownLanguageTagForFile,
-} from "../../util/index.js";
+} from "../../util/";
import {
contextItemToRangeInFileWithContents,
type RangeInFileWithContents,
-} from "../util.js";
+} from "../util";
const PROMPT = `Take the file prefix and suffix into account, but only rewrite the code_to_edit as specified in the user_request. The code you write in modified_code_to_edit will replace the code between the code_to_edit tags. Do NOT preface your answer or write anything other than code. The tag should be written to indicate the end of the modified code section. Do not ever use nested tags.
@@ -62,13 +62,6 @@ export async function getPromptParts(
) {
const maxTokens = Math.floor(model.contextLength / 2);
- const TOKENS_TO_BE_CONSIDERED_LARGE_RANGE = tokenLimit ?? 1200;
- // if (model.countTokens(rif.contents) > TOKENS_TO_BE_CONSIDERED_LARGE_RANGE) {
- // throw new Error(
- // "\n\n**It looks like you've selected a large range to edit, which may take a while to complete. If you'd like to cancel, click the 'X' button above. If you highlight a more specific range, Continue will only edit within it.**"
- // );
- // }
-
const BUFFER_FOR_FUNCTIONS = 400;
let totalTokens =
model.countTokens(fullFileContents + PROMPT + input) +
diff --git a/gui/src/components/markdown/CodeBlockToolbar.tsx b/gui/src/components/markdown/CodeBlockToolbar.tsx
index 84e5211928..c7f695f00c 100644
--- a/gui/src/components/markdown/CodeBlockToolbar.tsx
+++ b/gui/src/components/markdown/CodeBlockToolbar.tsx
@@ -72,8 +72,6 @@ function isTerminalCodeBlock(language: string | undefined, text: string) {
function CodeBlockToolBar(props: CodeBlockToolBarProps) {
const ideMessenger = useContext(IdeMessengerContext);
-
- const [copied, setCopied] = useState(false);
const [applying, setApplying] = useState(false);
return (
@@ -85,8 +83,8 @@ function CodeBlockToolBar(props: CodeBlockToolBarProps) {
isTerminalCodeBlock(props.language, props.text)
? "Run in terminal"
: applying
- ? "Applying..."
- : "Apply to current file"
+ ? "Applying..."
+ : "Apply to current file"
}
disabled={applying}
style={{ backgroundColor: vscEditorBackground }}
diff --git a/gui/src/components/markdown/PreWithToolbar.tsx b/gui/src/components/markdown/PreWithToolbar.tsx
index a5df415f10..3731109f51 100644
--- a/gui/src/components/markdown/PreWithToolbar.tsx
+++ b/gui/src/components/markdown/PreWithToolbar.tsx
@@ -19,10 +19,7 @@ function childrenToText(children: any) {
return children.map((child: any) => childToText(child)).join("");
}
-function PreWithToolbar(props: {
- children: any;
- language: string | undefined;
-}) {
+function PreWithToolbar(props: { children: any; language: string | null }) {
const uiConfig = useUIConfig();
const toolbarBottom = uiConfig?.codeBlockToolbarPosition == "bottom";
diff --git a/gui/src/components/markdown/StyledCode.tsx b/gui/src/components/markdown/StyledCode.tsx
deleted file mode 100644
index c5ed010147..0000000000
--- a/gui/src/components/markdown/StyledCode.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
-import { vscDarkPlus as highlightStyle } from "react-syntax-highlighter/dist/esm/styles/prism";
-
-interface StyledCodeProps {
- children: string;
- language?: string;
-}
-
-const StyledCode = (props: StyledCodeProps) => (
-
{words}
- ) : ( -{children}
- ); + return language; }; const StyledMarkdownPreview = memo(function StyledMarkdownPreview( @@ -147,7 +114,21 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview( }; }, ], - rehypePlugins: [rehypeHighlight as any, {}, rehypeKatex as any, {}], + rehypePlugins: [ + rehypeKatex as any, + {}, + [ + rehypeHighlight as any, + { + // Note: This is the default behavior, but leaving this here for scaffolding to + // add unsupported languages in the future. + // https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md + languages: { ...common }, + } as Options, + + , + ], + ], rehypeReactOptions: { components: { a: ({ node, ...props }) => { @@ -158,12 +139,12 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview( ); }, pre: ({ node, ...preProps }) => { - const language = preProps?.children?.[0]?.props?.className - ?.split(" ") - .find((word) => word.startsWith("language-")) - ?.split("-")[1]; + const childrenClassName = preProps?.children?.[0]?.props?.className; + return props.showCodeBorder ? ( -