diff --git a/core/config/load.ts b/core/config/load.ts index 1a6c2929a2..69521ddaa6 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -144,12 +144,12 @@ function loadSerializedConfig( // Set defaults if undefined (this lets us keep config.json uncluttered for new users) config.contextProviders ??= ideType === "vscode" - ? defaultContextProvidersVsCode - : defaultContextProvidersJetBrains; + ? [...defaultContextProvidersVsCode] + : [...defaultContextProvidersJetBrains]; config.slashCommands ??= ideType === "vscode" - ? defaultSlashCommandsVscode - : defaultSlashCommandsJetBrains; + ? [...defaultSlashCommandsVscode] + : [...defaultSlashCommandsJetBrains]; return config; } diff --git a/core/core.ts b/core/core.ts index 043ce86d28..9dcfc13ea5 100644 --- a/core/core.ts +++ b/core/core.ts @@ -40,6 +40,9 @@ export class Core { indexingState: IndexingProgressUpdate; private globalContext = new GlobalContext(); private docsService = DocsService.getInstance(); + private readonly indexingPauseToken = new PauseToken( + this.globalContext.get("indexingPaused") === true, + ); private abortedMessageIds: Set = new Set(); @@ -79,9 +82,6 @@ export class Core { ); // Codebase Indexer and ContinueServerClient depend on IdeSettings - const indexingPauseToken = new PauseToken( - this.globalContext.get("indexingPaused") === true, - ); let codebaseIndexerResolve: (_: any) => void | undefined; this.codebaseIndexerPromise = new Promise( async (resolve) => (codebaseIndexerResolve = resolve), @@ -103,7 +103,7 @@ export class Core { new CodebaseIndexer( this.configHandler, this.ide, - new PauseToken(false), + this.indexingPauseToken, continueServerClient, ), ); @@ -569,7 +569,7 @@ export class Core { }); on("index/setPaused", (msg) => { new GlobalContext().update("indexingPaused", msg.data); - indexingPauseToken.paused = msg.data; + this.indexingPauseToken.paused = msg.data; }); on("index/indexingProgressBarInitialized", async (msg) => { // Triggered when progress bar is initialized. diff --git a/core/indexing/LanceDbIndex.ts b/core/indexing/LanceDbIndex.ts index c94e5f407e..faa9461c6a 100644 --- a/core/indexing/LanceDbIndex.ts +++ b/core/indexing/LanceDbIndex.ts @@ -105,10 +105,20 @@ export class LanceDbIndex implements CodebaseIndex { continue; } - // Calculate embeddings - const embeddings = await this.embeddingsProvider.embed( - chunks.map((c) => c.content), - ); + let embeddings: number[][]; + try { + // Calculate embeddings + embeddings = await this.embeddingsProvider.embed( + chunks.map((c) => c.content), + ); + } catch (e) { + // Rather than fail the entire indexing process, we'll just skip this file + // so that it may be picked up on the next indexing attempt + console.warn( + `Failed to generate embedding for ${chunks[0]?.filepath} with provider: ${this.embeddingsProvider.id}: ${e}`, + ); + continue; + } if (embeddings.some((emb) => emb === undefined)) { throw new Error( diff --git a/core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts b/core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts index 2936ff434c..8ba07a7282 100644 --- a/core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts +++ b/core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts @@ -32,6 +32,9 @@ class FreeTrialEmbeddingsProvider extends BaseEmbeddingsProvider { return ( await Promise.all( batchedChunks.map(async (batch) => { + if (batch.length === 0) { + return []; + } const fetchWithBackoff = () => withExponentialBackoff(async () => this.fetch(new URL("embeddings", constants.a), { diff --git a/core/indexing/embeddings/OpenAIEmbeddingsProvider.ts b/core/indexing/embeddings/OpenAIEmbeddingsProvider.ts index bd7cb8665b..01a85ee5e9 100644 --- a/core/indexing/embeddings/OpenAIEmbeddingsProvider.ts +++ b/core/indexing/embeddings/OpenAIEmbeddingsProvider.ts @@ -47,6 +47,10 @@ class OpenAIEmbeddingsProvider extends BaseEmbeddingsProvider { return ( await Promise.all( batchedChunks.map(async (batch) => { + if (batch.length === 0) { + return []; + } + const fetchWithBackoff = () => withExponentialBackoff(() => this.fetch(this._getEndpoint(), { diff --git a/core/indexing/indexCodebase.ts b/core/indexing/indexCodebase.ts index b63c0a3cc4..d34f7b90a4 100644 --- a/core/indexing/indexCodebase.ts +++ b/core/indexing/indexCodebase.ts @@ -149,7 +149,8 @@ export class CodebaseIndexer { progress = (completedDirs + (completedRelativeExpectedTime + - indexProgress * codebaseIndex.relativeExpectedTime) / + Math.min(1.0, indexProgress) * + codebaseIndex.relativeExpectedTime) / totalRelativeExpectedTime) / workspaceDirs.length; yield { diff --git a/docs/docs/troubleshooting.md b/docs/docs/troubleshooting.md index 95600c98b9..aff152cbbd 100644 --- a/docs/docs/troubleshooting.md +++ b/docs/docs/troubleshooting.md @@ -27,7 +27,7 @@ To solve many problems, the first step is reading the logs to find the relevant If you're getting a response from the LLM that doesn't seem to make sense, you can 1. Open the "Output" panel (right next to the terminal) -2. In the dropdown, select "Continue - LLM Prompts/Completions +2. In the dropdown, select "Continue - LLM Prompts/Completions" 3. View the exact prompts that were sent to the LLM and the completions recieved ### JetBrains diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index fe3290c86e..874ef6b2d3 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/icon.png", - "version": "0.9.169", + "version": "0.9.170", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" diff --git a/extensions/vscode/scripts/prepackage-cross-platform.js b/extensions/vscode/scripts/prepackage-cross-platform.js index c4893dd334..59089dd620 100644 --- a/extensions/vscode/scripts/prepackage-cross-platform.js +++ b/extensions/vscode/scripts/prepackage-cross-platform.js @@ -142,7 +142,7 @@ async function package(target, os, arch, exe) { // Validate the all of the necessary files are present validateFilesPresent([ // Queries used to create the index for @code context provider - "tree-sitter/code-snippet-queries/tree-sitter-c_sharp-tags.scm", + "tree-sitter/code-snippet-queries/c_sharp.scm", // Queries used for @outline and @highlights context providers "tag-qry/tree-sitter-c_sharp-tags.scm", diff --git a/gui/src/components/loaders/IndexingProgressBar.tsx b/gui/src/components/loaders/IndexingProgressBar.tsx index 254510f900..1142913a55 100644 --- a/gui/src/components/loaders/IndexingProgressBar.tsx +++ b/gui/src/components/loaders/IndexingProgressBar.tsx @@ -183,7 +183,7 @@ const IndexingProgressBar = ({ }} > - Click to resume indexing ({Math.trunc(indexingState.progress * 100)} + Indexing paused ({Math.trunc(indexingState.progress * 100)} %) diff --git a/gui/src/pages/onboarding/Onboarding.tsx b/gui/src/pages/onboarding/Onboarding.tsx index e661aefe8f..827fec0f06 100644 --- a/gui/src/pages/onboarding/Onboarding.tsx +++ b/gui/src/pages/onboarding/Onboarding.tsx @@ -1,17 +1,24 @@ import { CheckBadgeIcon, - GiftIcon, Cog6ToothIcon, ComputerDesktopIcon, + GiftIcon, } from "@heroicons/react/24/outline"; import { ToCoreFromIdeOrWebviewProtocol } from "core/protocol/core"; import { useContext, useState } from "react"; +import { useDispatch } from "react-redux"; import { useNavigate } from "react-router-dom"; +import { lightGray } from "../../components"; +import ConfirmationDialog from "../../components/dialogs/ConfirmationDialog"; import GitHubSignInButton from "../../components/modelSelection/quickSetup/GitHubSignInButton"; import { IdeMessengerContext } from "../../context/IdeMessenger"; +import { + setDialogMessage, + setShowDialog, +} from "../../redux/slices/uiStateSlice"; import { isJetBrains } from "../../util"; -import { Div, StyledButton } from "./components"; import { FREE_TRIAL_LIMIT_REQUESTS, hasPassedFTL } from "../../util/freeTrial"; +import { Div, StyledButton } from "./components"; import { useOnboarding } from "./utils"; type OnboardingMode = @@ -19,6 +26,7 @@ type OnboardingMode = function Onboarding() { const navigate = useNavigate(); + const dispatch = useDispatch(); const ideMessenger = useContext(IdeMessengerContext); const [hasSignedIntoGh, setHasSignedIntoGh] = useState(false); @@ -173,9 +181,30 @@ function Onboarding() {
- - Continue - +
+
{ + dispatch(setShowDialog(true)); + dispatch( + setDialogMessage( + { + completeOnboarding(); + }} + />, + ), + ); + }} + > + Skip +
+ + Continue + +
); diff --git a/gui/src/pages/onboarding/utils.ts b/gui/src/pages/onboarding/utils.ts index d701c1b825..15b9e71783 100644 --- a/gui/src/pages/onboarding/utils.ts +++ b/gui/src/pages/onboarding/utils.ts @@ -10,6 +10,7 @@ export type OnboardingStatus = "Started" | "Completed"; // If there is no value in local storage for "onboardingStatus", // it implies that the user has not begun or completed onboarding. export function shouldBeginOnboarding() { + // We used to use "onboardingComplete", but switched to "onboardingStatus" const onboardingCompleteLegacyValue = localStorage.getItem("onboardingComplete"); if (onboardingCompleteLegacyValue === "true") {