clean up logs

This commit is contained in:
Nate 2024-12-06 18:57:30 -08:00
parent 7c6fc903fa
commit 2d09fdcb29
9 changed files with 28 additions and 14 deletions

View file

@ -66,7 +66,6 @@ This is the question that you should select relevant files for: "${input}"`;
new AbortController().signal,
);
const content = renderChatMessage(response);
console.debug("Repo map retrieval response: ", content);
if (!content.includes("\n")) {
return [];

1
core/util/constants.ts Normal file
View file

@ -0,0 +1 @@
export const NEW_SESSION_TITLE = "New Session";

View file

@ -3,8 +3,8 @@ import * as fs from "fs";
import { Session, SessionMetadata } from "../index.js";
import { ListHistoryOptions } from "../protocol/core.js";
import { NEW_SESSION_TITLE } from "./constants.js";
import { getSessionFilePath, getSessionsListPath } from "./paths.js";
function safeParseArray<T>(
value: string,
errorMessage: string = "Error parsing array",
@ -80,7 +80,7 @@ class HistoryManager {
console.log(`Error loading session: ${e}`);
return {
history: [],
title: "Failed to load session",
title: NEW_SESSION_TITLE,
workspaceDirectory: "",
sessionId: sessionId,
};

View file

@ -231,7 +231,13 @@ export async function getSymbolsForFile(
return;
}
const tree = parser.parse(contents);
let tree: Parser.Tree;
try {
tree = parser.parse(contents);
} catch (e) {
console.log(`Error parsing file: ${filepath}`);
return;
}
// console.log(`file: ${filepath}`);
// Function to recursively find all named nodes (classes and functions)

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "0.9.244",
"version": "0.9.240",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "0.9.244",
"version": "0.9.240",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",

View file

@ -31,9 +31,15 @@ export default function FileIcon({ filename, height, width }: FileIconProps) {
const sanitizedSVG = DOMPurify.sanitize(svg);
return (
<div
<span
dangerouslySetInnerHTML={{ __html: sanitizedSVG }}
style={{ width: width, height: height, fill: color, flexShrink: 0 }}
style={{
width: width,
height: height,
fill: color,
flexShrink: 0,
display: "block",
}}
/>
);
}

View file

@ -9,11 +9,11 @@ import { getBasename } from "core/util";
import { useContext, useMemo, useState } from "react";
import { AnimatedEllipsis, lightGray, vscBackground } from "..";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { useAppSelector } from "../../redux/hooks";
import { selectIsGatheringContext } from "../../redux/slices/sessionSlice";
import FileIcon from "../FileIcon";
import SafeImg from "../SafeImg";
import { getIconFromDropdownItem } from "./MentionList";
import { useAppSelector } from "../../redux/hooks";
import { selectIsGatheringContext } from "../../redux/slices/sessionSlice";
interface ContextItemsPeekProps {
contextItems?: ContextItemWithId[];
@ -172,7 +172,7 @@ function ContextItemsPeek({
<span className="ml-1 text-xs text-gray-400 transition-colors duration-200">
{isGatheringContext ? (
<>
Gathering context...
Gathering context
<AnimatedEllipsis />
</>
) : (

View file

@ -1,5 +1,6 @@
import { Dispatch } from "@reduxjs/toolkit";
import { Session, SessionMetadata } from "core";
import { NEW_SESSION_TITLE } from "core/util/constants";
import { renderChatMessage } from "core/util/messageContent";
import { useCallback, useContext } from "react";
import { IdeMessengerContext } from "../context/IdeMessenger";
@ -65,7 +66,7 @@ function useHistory(dispatch: Dispatch) {
}
let currentTitle = title;
if (config?.ui?.getChatTitles && currentTitle === "New Session") {
if (config?.ui?.getChatTitles && currentTitle === NEW_SESSION_TITLE) {
try {
// Check if we have first assistant response
let assistantResponse = history
@ -82,7 +83,7 @@ function useHistory(dispatch: Dispatch) {
// Fallback if we get an error above or if the user has not set getChatTitles
let newTitle =
currentTitle === "New Session"
currentTitle === NEW_SESSION_TITLE
? truncateText(
renderChatMessage(history[0].message)
.split("\n")

View file

@ -19,6 +19,7 @@ import {
Session,
ToolCall,
} from "core";
import { NEW_SESSION_TITLE } from "core/util/constants";
import { incrementalParseJson } from "core/util/incrementalParseJson";
import { renderChatMessage } from "core/util/messageContent";
import { v4 as uuidv4 } from "uuid";
@ -86,7 +87,7 @@ function getBaseHistoryItem(): ChatHistoryItemWithMessageId {
const initialState: SessionState = {
history: [],
isStreaming: false,
title: "New Session",
title: NEW_SESSION_TITLE,
id: uuidv4(),
selectedProfileId: "local",
curCheckpointIndex: 0,