Skip to content

Commit

Permalink
[FIX] Bug fixes and optimizations (#253)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
2 people authored and nang-dev committed Feb 4, 2025
1 parent 3d9966b commit 8a80a23
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions core/util/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as JSONC from "comment-json";
import dotenv from "dotenv";
import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import path from "path";
import { defaultConfig, defaultConfigJetBrains } from "../config/default.js";
import Types from "../config/types.js";
import { IdeType, SerializedContinueConfig } from "../index.js";
Expand Down Expand Up @@ -92,12 +92,16 @@ export function getConfigTsPath(): string {
version: "1.0.0",
description: "My Continue Configuration",
main: "config.js",
type: "module"
}),
);
}

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

export function getConfigJsPath(): string {
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/src/autocomplete/lsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ export async function executeGotoProvider(
if (gotoCache.size >= MAX_CACHE_SIZE) {
// Remove the oldest item from the cache
const oldestKey = gotoCache.keys().next().value;
gotoCache.delete(oldestKey);
gotoCache.delete(oldestKey as string);
}
gotoCache.set(cacheKey, results);

return results;
} catch (e) {
console.warn(`Error executing %s:`, name);
console.warn(`Error executing ${input.name}:`);
console.warn(e);
return [];
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/src/extension/VsCodeExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export class VsCodeExtension {
this.sidebar.webviewProtocol.request("setActiveFilePath", filepath, [PEAR_CONTINUE_VIEW_ID]);
});

this.updateNewWindowActiveFilePath()
this.updateNewWindowActiveFilePath();
startAiderProcess(this.core);
}

Expand All @@ -401,4 +401,4 @@ export class VsCodeExtension {
registerCustomContextProvider(contextProvider: IContextProvider) {
this.configHandler.registerCustomContextProvider(contextProvider);
}
}
}
Empty file.
2 changes: 1 addition & 1 deletion gui/src/components/InventoryPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const InventoryPreview = () => {
<div className="flex gap-[6px] bg-clip-border bg-input p-[4px] cursor-pointer">
{menuItems.map((item, index) => (
<div
key={item.path}
key={`${item.command}-${index}`}
className="relative group w-6 h-6 rounded-lg"
title={item.tooltip}
>
Expand Down
4 changes: 2 additions & 2 deletions gui/src/components/markdown/StyledMarkdownPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ interface FadeInWordsProps extends StyledMarkdownPreviewProps {
}

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


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

const active = props.integrationSource === "continue"
Expand Down
2 changes: 1 addition & 1 deletion gui/src/pages/inventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default function Inventory() {
<TabsList className={` flex flex-col bg-background justify-between h-full ${currentTab === 'home' ? 'hidden' : ''}`}>
<div className="mt-2 p-3 flex flex-col gap-4">
{tabs.slice(2).filter(tab => tab.featureflag !== false).map((tab) => (
<TabButton {...tab} />
<TabButton key={tab.id} {...tab} />
))}
</div>

Expand Down

0 comments on commit 8a80a23

Please sign in to comment.