Skip to content

Commit 8a80a23

Browse files
charlwillia6cwilliams
authored andcommitted
[FIX] Bug fixes and optimizations (#253)
* Fix: Improve path handling, LSP error logging, and React component keys * Refactor: Add `isLast` prop to markdown preview components --------- Co-authored-by: cwilliams <[email protected]>
1 parent 3d9966b commit 8a80a23

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

core/util/paths.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as JSONC from "comment-json";
22
import dotenv from "dotenv";
33
import * as fs from "fs";
44
import * as os from "os";
5-
import * as path from "path";
5+
import path from "path";
66
import { defaultConfig, defaultConfigJetBrains } from "../config/default.js";
77
import Types from "../config/types.js";
88
import { IdeType, SerializedContinueConfig } from "../index.js";
@@ -92,12 +92,16 @@ export function getConfigTsPath(): string {
9292
version: "1.0.0",
9393
description: "My Continue Configuration",
9494
main: "config.js",
95+
type: "module"
9596
}),
9697
);
9798
}
9899

99100
fs.writeFileSync(path.join(corePath, "index.d.ts"), Types);
100-
return p;
101+
// Convert Windows path to proper file URL format
102+
return process.platform === "win32"
103+
? "file:///" + p.replace(/\\/g, "/")
104+
: p;
101105
}
102106

103107
export function getConfigJsPath(): string {

extensions/vscode/src/autocomplete/lsp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ export async function executeGotoProvider(
5959
if (gotoCache.size >= MAX_CACHE_SIZE) {
6060
// Remove the oldest item from the cache
6161
const oldestKey = gotoCache.keys().next().value;
62-
gotoCache.delete(oldestKey);
62+
gotoCache.delete(oldestKey as string);
6363
}
6464
gotoCache.set(cacheKey, results);
6565

6666
return results;
6767
} catch (e) {
68-
console.warn(`Error executing %s:`, name);
68+
console.warn(`Error executing ${input.name}:`);
6969
console.warn(e);
7070
return [];
7171
}

extensions/vscode/src/extension/VsCodeExtension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export class VsCodeExtension {
380380
this.sidebar.webviewProtocol.request("setActiveFilePath", filepath, [PEAR_CONTINUE_VIEW_ID]);
381381
});
382382

383-
this.updateNewWindowActiveFilePath()
383+
this.updateNewWindowActiveFilePath();
384384
startAiderProcess(this.core);
385385
}
386386

@@ -401,4 +401,4 @@ export class VsCodeExtension {
401401
registerCustomContextProvider(contextProvider: IContextProvider) {
402402
this.configHandler.registerCustomContextProvider(contextProvider);
403403
}
404-
}
404+
}

extensions/vscode/src/extension/autocomplete.ts

Whitespace-only changes.

gui/src/components/InventoryPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const InventoryPreview = () => {
6060
<div className="flex gap-[6px] bg-clip-border bg-input p-[4px] cursor-pointer">
6161
{menuItems.map((item, index) => (
6262
<div
63-
key={item.path}
63+
key={`${item.command}-${index}`}
6464
className="relative group w-6 h-6 rounded-lg"
6565
title={item.tooltip}
6666
>

gui/src/components/markdown/StyledMarkdownPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ interface FadeInWordsProps extends StyledMarkdownPreviewProps {
113113
}
114114

115115
const FadeInWords: React.FC<FadeInWordsProps> = (props: FadeInWordsProps) => {
116-
const { children, integrationSource, isStreaming, messageIndex, ...otherProps } = props;
116+
const { children, integrationSource, isStreaming, messageIndex, showCodeBorder, isLast, ...otherProps } = props;
117117
const active = props.integrationSource === "continue"
118118
? useSelector((store: RootState) => store.state.active)
119119
: props.integrationSource === "perplexity"
@@ -164,7 +164,7 @@ interface FadeInElementProps extends StyledMarkdownPreviewProps {
164164

165165

166166
const FadeInElement: React.FC<FadeInElementProps> = (props: FadeInElementProps) => {
167-
const { children, integrationSource, isStreaming, messageIndex, as = 'p', ...otherProps } = props;
167+
const { children, integrationSource, isStreaming, messageIndex, showCodeBorder, isLast, as = 'p', ...otherProps } = props;
168168
const ElementType = as;
169169

170170
const active = props.integrationSource === "continue"

gui/src/pages/inventory.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default function Inventory() {
138138
<TabsList className={` flex flex-col bg-background justify-between h-full ${currentTab === 'home' ? 'hidden' : ''}`}>
139139
<div className="mt-2 p-3 flex flex-col gap-4">
140140
{tabs.slice(2).filter(tab => tab.featureflag !== false).map((tab) => (
141-
<TabButton {...tab} />
141+
<TabButton key={tab.id} {...tab} />
142142
))}
143143
</div>
144144

0 commit comments

Comments
 (0)