Dev (#1643)
* docs: add docs and schema for "OS" provider (#1536) * ignore .env * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * add voyage rerank-1 * import Handlebars * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * small UI tweaks * media query * feat: add best experience onboarding * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * chore: add telemetry for full screen toggle (#1618) * rerank-lite-1 * basic tests for VS Code extension * chore: onboarding metrics (#1626) * fix: pageview tracking * feat: add onboarding telemetry * create single `onboardingStatus` type * improved var naming * remove console logs * fix double adding of context providers * fix cross-platform build validation * Update troubleshooting.md (#1637) * add back skip onboarding button * fix free trial embeddings error * Nate/indexing fixes (#1642) * fix pausing of indexing * don't send empty array to openai embeddings * catch embeddings errors without stopping entire indexing process * update version --------- Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com> Co-authored-by: Jonah Wagner <jonahwagner231@gmail.com>
This commit is contained in:
parent
b770863906
commit
a96f7a7484
12 changed files with 71 additions and 23 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
10
core/core.ts
10
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<string> = 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.
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ class FreeTrialEmbeddingsProvider extends BaseEmbeddingsProvider {
|
|||
return (
|
||||
await Promise.all(
|
||||
batchedChunks.map(async (batch) => {
|
||||
if (batch.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const fetchWithBackoff = () =>
|
||||
withExponentialBackoff<Response>(async () =>
|
||||
this.fetch(new URL("embeddings", constants.a), {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ class OpenAIEmbeddingsProvider extends BaseEmbeddingsProvider {
|
|||
return (
|
||||
await Promise.all(
|
||||
batchedChunks.map(async (batch) => {
|
||||
if (batch.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const fetchWithBackoff = () =>
|
||||
withExponentialBackoff<Response>(() =>
|
||||
this.fetch(this._getEndpoint(), {
|
||||
|
|
|
|||
|
|
@ -149,7 +149,8 @@ export class CodebaseIndexer {
|
|||
progress =
|
||||
(completedDirs +
|
||||
(completedRelativeExpectedTime +
|
||||
indexProgress * codebaseIndex.relativeExpectedTime) /
|
||||
Math.min(1.0, indexProgress) *
|
||||
codebaseIndex.relativeExpectedTime) /
|
||||
totalRelativeExpectedTime) /
|
||||
workspaceDirs.length;
|
||||
yield {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ const IndexingProgressBar = ({
|
|||
}}
|
||||
></BlinkingDot>
|
||||
<StatusHeading>
|
||||
Click to resume indexing ({Math.trunc(indexingState.progress * 100)}
|
||||
Indexing paused ({Math.trunc(indexingState.progress * 100)}
|
||||
%)
|
||||
</StatusHeading>
|
||||
</FlexDiv>
|
||||
|
|
|
|||
|
|
@ -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() {
|
|||
</div>
|
||||
|
||||
<div className="flex justify-end">
|
||||
<StyledButton disabled={!selectedOnboardingMode} onClick={onSubmit}>
|
||||
Continue
|
||||
</StyledButton>
|
||||
<div className="flex items-center gap-4 ml-auto">
|
||||
<div
|
||||
className="cursor-pointer"
|
||||
style={{ color: lightGray }}
|
||||
onClick={(e) => {
|
||||
dispatch(setShowDialog(true));
|
||||
dispatch(
|
||||
setDialogMessage(
|
||||
<ConfirmationDialog
|
||||
text="Are you sure you want to skip onboarding? Unless you are an existing user or already have a config.json we don't recommend this."
|
||||
onConfirm={() => {
|
||||
completeOnboarding();
|
||||
}}
|
||||
/>,
|
||||
),
|
||||
);
|
||||
}}
|
||||
>
|
||||
Skip
|
||||
</div>
|
||||
<StyledButton disabled={!selectedOnboardingMode} onClick={onSubmit}>
|
||||
Continue
|
||||
</StyledButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue