Skip to content

Commit ec2aa19

Browse files
sestinjPatrick-ErichsenpriyashpatildevbyjonahYohannZe
authored
Dev (#1740)
* Nate/control plane client (#1691) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * fix(gui): ctx rendering w/ renderInlineAs: "" (#1541) * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * fix codeqwen autocomplete leading space * add voyage rerank-1 * feat: `--noEmit` for tsc checks in CI (#1559) * docs: update CustomContextProvider docs (#1557) * add stop tokens to qwen prompt * update docs to reflect 3.5 sonnet being best * docs: comment out unused providers (#1561) * import Handlebars * feat: toast notification for config updates (#1560) * feat: toast notification for config updates * feat: only trigger toast on config.json save * displayRawMarkdown option * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * update to reflect 16 stop words limit for deepseek * feat: only trigger config update toast in vscode (#1571) * docs(prompt-files): fix typos + clarify (#1575) * doc: prompt file typo + clarifications * fix: add back correct docs * chore: add telemetry for pageviews (#1576) * 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 * docs(telemetry): add pageviews to tracking list (#1581) * Add reranker configuration options to codebase embedding docs (#1584) - Introduce reranker concept - List available reranker options - Provide configuration instructions - Update keywords to include "reranker" * chore: update pr template with screenshots (#1590) * Refactor ConfirmationDialog to use SecondaryButton for cancel action (#1586) * Added instructions for running docs server locally (#1578) - Added NPM script method - Added VS Code task method - Update contributing guidelines * Update branch policy (#1577) - Change PR target to `dev` branch - Update `CONTRIBUTING.md` instructions * Consolidate example configurations into the main configuration guide (#1579) - Moved examples to configuration.md - Deleted the separate examples.md file - Updated sidebar order and links - Improved readability and structure in configuration.md * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * Update completionProvider.ts (warning tab-autocomplete models) (#1566) * feat: enhanced IndexingProgressBar with blinking dot feature - Integrated BlinkingDot component - Added STATUS_COLORS for various states - Replaced CircleDiv with BlinkingDot in UI - Updated status messages and layout * small UI tweaks * feat(gui): enhance ModelCard, ModelProviderTag, and Toggle components (#1595) - add styling and adjustments to ModelCard - update ModelProviderTag font size - remove box shadow from Toggle component - tweak icon styles in ModelCard - improve alignment and spacing * media query * feat: add best experience onboarding * fix: file rename * stop movement on button hover by keeping same border thickness * fix mistake in setting cursor: pointer * fix when free trial option is shown * Support Node.js versions below 20 for streaming response handling (#1591) - Add fallback for Node < 20 - Implement toAsyncIterable for streaming - Use TextDecoder for manual decoding - Maintain existing streaming for Node 20+ * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * fix hasPassedFTL * fix /edit cancellation from UI * feat: add `applyCodeBlock` experimental prop (#1601) * feat: add new model styling improvements (#1609) * feat: add new model styling improvements * better gap size * feat: update bug_report.yml (#1610) * chore: update bug_report.yml * typo fix * feat: add labels to "Add docs" dialog (#1612) * feat: add labels to "Add docs" dialog * remove autofocus * don't double load config * small fixes * speed up directory traversal, and use correct native path module * option not to show config update toast * merge air-gapped and recommended setup pages * chore: add telemetry for full screen toggle (#1618) * Fix headings in codebase-embeddings.md (#1617) * mention jetbrains * docs: update changie (#1619) * feat: updated changie config * hide toc and autogenerate * Update changelog.mdx * link to deeper explanation of embeddings models * ensure target="_blank" for all links in sidebar * fix gif links in intellij README.md * don't require rust in dependency installation * chore: fix padding on gh button (#1620) * chore: adjust button padding * Update tasks.json * escape colons in diff path * smoother lancedb indexing reporting * smooth progress updates for indexing * fix tsc err * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * docs: add docs and schema for "OS" provider (#1536) * ignore .env * 🚑 fix constant warnings when onboarding with Ollama * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * team analytics * apply control plane settings * workos auth * ide protocol get session info * UI for auth * profile switching * small fixes * updates * refresh tokens * updates * fix tsc errs * model select in toolbar to make room for profile selector * prod client id * link to prod URL * internal beta option * profiles change listener --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Priyash <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: YohannZe <[email protected]> Co-authored-by: Dan Dascalescu <[email protected]> * temporary patch for type errs * Dev (#1689) * Fix an issue where CMD+K does not clear the terminal when the terminal has focus (#1671) On MacOS, ⌘+K is bound, by default, to Terminal:Clear. Without this change ⌘+K does not clear the terminal but instead iniates a chord sequence and waits for the next stroke of the chord. Co-authored-by: Rob Leidle <[email protected]> * Change treeSitter to cache the Language objects it loads from wasm (#1672) Without this change, for a repository with 600 typescript files, the indexer would fail to finish correctly and there would be many of the following errors in the webview console log: 'Unable to load language for file ${path} RuntimeError: table index is out of bounds' The following bash will create a repo that reproduces the problem: current_path="." for ((i=1; i<=20; i++)); do new_folder="folder-$i" mkdir -p "$current_path/$new_folder" current_path="$current_path/$new_folder" for ((a=1; a<=30; a++)); do head -c 10000 /dev/urandom | base64 > "$current_path/file-$a.ts" done done Co-authored-by: Rob Leidle <[email protected]> * acknowledge sourcemap flag in esbuild.js * don't run jetbrains-release.yaml on vscode releases * further testing for walkDir * chore: add telemetry to commands (#1673) * test: Add basic unit test to baseLLM (#1668) * update version * test: Add basic unit test to baseLLM --------- Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: inimaz <[email protected]> * feat: add Quick Actions CodeLens feature (#1674) * 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: open pane on install (#1564) * feat: open pane on activation * comment out testing code * chore: add telemetry for pageviews (#1576) * 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 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * manually implement stop tokens for hf inference api * chore: onboarding metrics (#1626) * fix: pageview tracking * feat: add onboarding telemetry * create single `onboardingStatus` type * improved var naming * remove console logs * fix windows performance issue * rename vscodeExtension.ts * migration of onboarding variables * "stash" instead of "delete" in indexing progress * fix preview.yaml * also fix main.yaml * Update troubleshooting.md (#1637) * feat: add quick actions * Update index.d.ts * quick actions mvp * update docs * subscribe to vscode change settings * Update commands.ts * cleanup * Update quick-actions.md * Update VerticalPerLineCodeLensProvider.ts * resolve feedback --------- Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> * chore: add `isCommandEvent` to command telemetry (#1675) * chore: add `isCommandEvent` to command telemetry * Update commands.ts * Nate/better retrieval (#1677) * deduplicatearray tests * break out separate retrieval pipelines * IConfigHandler * tests for codebase indexer * better .continueignore for continue * indexing fixes * ignore .gitignore and .continueignore when indexing * retrieval pipeline improvements * fix formatting err in out .continueignore * add necessary filter to lance_db_cache * update package.json version * skip unused tests * don't ignore .prompt files * update version * Update pull_request_template.md * don't use multi-media format when there are multiple text items * add free trial experience (#1685) * fix: add code range for quick actions/fixes (#1687) * fix: add code range for quick actions/fixes * Update test.js * add pathSep message type * docs improvements * jetbrains fix * update package.json version --------- Co-authored-by: Rob Leidle <[email protected]> Co-authored-by: Rob Leidle <[email protected]> Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: inimaz <[email protected]> Co-authored-by: inimaz <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: Priyash <[email protected]> * update package.json version * skip extension tests * update package.json version * handlebars import * don't push package.json version change from CI * fix: scroll issues w/ code blocks (#1688) * fix: scroll issues w/ code blocks * chore: name offset * chore: remove docs start * chore: update headings on troubleshooting.md (#1696) * ignore .svn folder for indexing (#1699) * chore: clearer naming for `useSuffix` (#1702) * chore: clearer naming for `useSuffix` * schema updates * fix: cmd+shft+l closes sidebar if focused (#1638) * 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: open pane on install (#1564) * feat: open pane on activation * comment out testing code * chore: add telemetry for pageviews (#1576) * 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 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * manually implement stop tokens for hf inference api * chore: onboarding metrics (#1626) * fix: pageview tracking * feat: add onboarding telemetry * create single `onboardingStatus` type * improved var naming * remove console logs * fix windows performance issue * rename vscodeExtension.ts * migration of onboarding variables * "stash" instead of "delete" in indexing progress * fix preview.yaml * also fix main.yaml * Update troubleshooting.md (#1637) * feat: close panel if main input is focused * add skip param * Update TipTapEditor.tsx * merge dev * Update commands.ts --------- Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> * bugfix: quick actions undefined array (#1704) * feat: add rich quick pick for quick edit (#1706) * feat: multistep quick pick * fix: multi step for context provider * Update test.js * Create deepseek.md (#1708) * style: add max height to model selector (#1712) * update styling * remove testing code * remove comments * feat: add tutorial card (#1716) * feat: create tutorial card * Update TutorialCard.tsx * feat: add file search to quick edit (#1714) * feat: multistep quick pick * fix: multi step for context provider * Update test.js * add file search * complete file search * remove unused import * add comments * Update utils.ts * update naming * chore: move quick pick instantiation (#1723) * Break out into NPM modules (#1726) * config.json types * export all schemas * break out request logic into packages * update openai adapters to export body types * update packaging of npm modules * update packages * continue proxy * mistral * Fix typo in documentation (#1722) In set-up-codestral.md "Trobleshooting" -> "Troubleshooting" * update package.json version * 🪄 model dropdown, control plane (#1692) * Nate/control plane client (#1691) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * fix(gui): ctx rendering w/ renderInlineAs: "" (#1541) * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * fix codeqwen autocomplete leading space * add voyage rerank-1 * feat: `--noEmit` for tsc checks in CI (#1559) * docs: update CustomContextProvider docs (#1557) * add stop tokens to qwen prompt * update docs to reflect 3.5 sonnet being best * docs: comment out unused providers (#1561) * import Handlebars * feat: toast notification for config updates (#1560) * feat: toast notification for config updates * feat: only trigger toast on config.json save * displayRawMarkdown option * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * update to reflect 16 stop words limit for deepseek * feat: only trigger config update toast in vscode (#1571) * docs(prompt-files): fix typos + clarify (#1575) * doc: prompt file typo + clarifications * fix: add back correct docs * chore: add telemetry for pageviews (#1576) * 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 * docs(telemetry): add pageviews to tracking list (#1581) * Add reranker configuration options to codebase embedding docs (#1584) - Introduce reranker concept - List available reranker options - Provide configuration instructions - Update keywords to include "reranker" * chore: update pr template with screenshots (#1590) * Refactor ConfirmationDialog to use SecondaryButton for cancel action (#1586) * Added instructions for running docs server locally (#1578) - Added NPM script method - Added VS Code task method - Update contributing guidelines * Update branch policy (#1577) - Change PR target to `dev` branch - Update `CONTRIBUTING.md` instructions * Consolidate example configurations into the main configuration guide (#1579) - Moved examples to configuration.md - Deleted the separate examples.md file - Updated sidebar order and links - Improved readability and structure in configuration.md * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * Update completionProvider.ts (warning tab-autocomplete models) (#1566) * feat: enhanced IndexingProgressBar with blinking dot feature - Integrated BlinkingDot component - Added STATUS_COLORS for various states - Replaced CircleDiv with BlinkingDot in UI - Updated status messages and layout * small UI tweaks * feat(gui): enhance ModelCard, ModelProviderTag, and Toggle components (#1595) - add styling and adjustments to ModelCard - update ModelProviderTag font size - remove box shadow from Toggle component - tweak icon styles in ModelCard - improve alignment and spacing * media query * feat: add best experience onboarding * fix: file rename * stop movement on button hover by keeping same border thickness * fix mistake in setting cursor: pointer * fix when free trial option is shown * Support Node.js versions below 20 for streaming response handling (#1591) - Add fallback for Node < 20 - Implement toAsyncIterable for streaming - Use TextDecoder for manual decoding - Maintain existing streaming for Node 20+ * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * fix hasPassedFTL * fix /edit cancellation from UI * feat: add `applyCodeBlock` experimental prop (#1601) * feat: add new model styling improvements (#1609) * feat: add new model styling improvements * better gap size * feat: update bug_report.yml (#1610) * chore: update bug_report.yml * typo fix * feat: add labels to "Add docs" dialog (#1612) * feat: add labels to "Add docs" dialog * remove autofocus * don't double load config * small fixes * speed up directory traversal, and use correct native path module * option not to show config update toast * merge air-gapped and recommended setup pages * chore: add telemetry for full screen toggle (#1618) * Fix headings in codebase-embeddings.md (#1617) * mention jetbrains * docs: update changie (#1619) * feat: updated changie config * hide toc and autogenerate * Update changelog.mdx * link to deeper explanation of embeddings models * ensure target="_blank" for all links in sidebar * fix gif links in intellij README.md * don't require rust in dependency installation * chore: fix padding on gh button (#1620) * chore: adjust button padding * Update tasks.json * escape colons in diff path * smoother lancedb indexing reporting * smooth progress updates for indexing * fix tsc err * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * docs: add docs and schema for "OS" provider (#1536) * ignore .env * 🚑 fix constant warnings when onboarding with Ollama * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * team analytics * apply control plane settings * workos auth * ide protocol get session info * UI for auth * profile switching * small fixes * updates * refresh tokens * updates * fix tsc errs * model select in toolbar to make room for profile selector * prod client id * link to prod URL * internal beta option * profiles change listener --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Priyash <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: YohannZe <[email protected]> Co-authored-by: Dan Dascalescu <[email protected]> * temporary patch for type errs --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Priyash <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: YohannZe <[email protected]> Co-authored-by: Dan Dascalescu <[email protected]> * skip extension tests * JetBrains status bar spinner for autocomplete * Remove unused images * partial accept jetbrains * fix double-rendering of jetbrains completions * fix offset of multi-line jetbrains completions * enable/disable actions * upgrade to version 0.0.54 * fix: wrap editor buttons when out of space (#1727) * Add .continuerc file to config directory on activation to prevent it's indexing. (#1733) * Updated the content links that were deprecated in the document (#1709) Co-authored-by: Ihe Fan <[email protected]> * Nate/dev (#1739) * JetBrains status bar spinner for autocomplete * Remove unused images * partial accept jetbrains * fix double-rendering of jetbrains completions * fix offset of multi-line jetbrains completions * enable/disable actions * upgrade to version 0.0.54 * llm-info package * small profile switching improvements * instruct cmd+I not to leave placeholders * @ files in context-providers docs * onboarding fix * update jetbrains ci to build gui * feat: single default quick pick to edit (#1743) * feat: single default quick pick to edit * Update quick-actions.md * Update quick-actions.md * use defaultQuickAction * quick fixes * fix: handle line removal diff (#1744) * fix: handle line removal diff * remove comments * Configurable `maxChunkSize` for embedding providers (#1746) * Add `maxChunkSize` to `EmbeddingsProvider` * Add `maxChunkSize` to schema * add support for docs via config (#1594) * mistral mamba (#1748) * 🐍 mistral mamba * autoscale retrieval based on context length * autoscale retrieval based on context length * fix input box movement * update jetbrains build --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Priyash <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: YohannZe <[email protected]> Co-authored-by: Dan Dascalescu <[email protected]> Co-authored-by: Rob Leidle <[email protected]> Co-authored-by: Rob Leidle <[email protected]> Co-authored-by: inimaz <[email protected]> Co-authored-by: inimaz <[email protected]> Co-authored-by: Anaël Bonnafous <[email protected]> Co-authored-by: Huy Tran <[email protected]> Co-authored-by: Gabriel Gordbegli <[email protected]> Co-authored-by: Raven-1027 <[email protected]> Co-authored-by: Ihe Fan <[email protected]> Co-authored-by: Lukas Kreussel <[email protected]>
1 parent ed37dcf commit ec2aa19

File tree

94 files changed

+1487
-746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1487
-746
lines changed

.github/workflows/jetbrains-build.yaml

+19-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name: Build
1616
on:
1717
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
1818
push:
19-
branches: [main]
19+
branches: [main, preview]
2020
# Trigger the workflow on any pull request
2121
# pull_request:
2222

@@ -97,6 +97,12 @@ jobs:
9797
path: binary/node_modules
9898
key: ${{ runner.os }}-node-${{ hashFiles('binary/package-lock.json') }}
9999

100+
- name: Cache gui node_modules
101+
uses: actions/cache@v3
102+
with:
103+
path: gui/node_modules
104+
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
105+
100106
# npm install core
101107
- name: Install core node_modules
102108
run: |
@@ -109,6 +115,18 @@ jobs:
109115
cd ../../binary
110116
npm ci
111117
118+
# npm install gui
119+
- name: Install gui node_modules
120+
run: |
121+
cd ../../gui
122+
npm ci
123+
124+
# build gui
125+
- name: Build gui
126+
run: |
127+
cd ../../gui
128+
npm run build
129+
112130
# Run prepackage.js script
113131
- name: Run prepackage script
114132
run: |

.github/workflows/jetbrains-release.yaml

+24-6
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ jobs:
8787
path: binary/node_modules
8888
key: ${{ runner.os }}-node-${{ hashFiles('binary/package-lock.json') }}
8989

90+
- name: Cache gui node_modules
91+
uses: actions/cache@v3
92+
with:
93+
path: gui/node_modules
94+
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
95+
9096
# npm install core
9197
- name: Install core node_modules
9298
run: |
@@ -99,6 +105,18 @@ jobs:
99105
cd ../../binary
100106
npm ci
101107
108+
# npm install gui
109+
- name: Install gui node_modules
110+
run: |
111+
cd ../../gui
112+
npm ci
113+
114+
# build gui
115+
- name: Build gui
116+
run: |
117+
cd ../../gui
118+
npm run build
119+
102120
# Run prepackage.js script
103121
- name: Run prepackage script
104122
run: |
@@ -120,6 +138,12 @@ jobs:
120138
run: |
121139
./gradlew patchChangelog --release-note="$CHANGELOG"
122140
141+
# Upload artifact as a release asset
142+
- name: Upload Release Asset
143+
env:
144+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145+
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
146+
123147
# Publish the plugin to JetBrains Marketplace
124148
- name: Publish Plugin
125149
env:
@@ -129,12 +153,6 @@ jobs:
129153
PRIVATE_KEY_PASSWORD: ${{ secrets.JETBRAINS_PRIVATE_KEY_PASSWORD }}
130154
run: ./gradlew publishPlugin
131155

132-
# Upload artifact as a release asset
133-
- name: Upload Release Asset
134-
env:
135-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136-
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
137-
138156
# Create a pull request
139157
- name: Create Pull Request
140158
if: ${{ steps.properties.outputs.changelog != '' }}

.vscode/launch.json

+16
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@
9595
// Avoid timing out when stopping on breakpoints during debugging in VSCode
9696
"MOCHA_TIMEOUT": "0"
9797
}
98+
},
99+
{
100+
"name": "[Core] Jest Test Debugger, Current Open File",
101+
"type": "node",
102+
"request": "launch",
103+
"runtimeArgs": [
104+
"--inspect-brk",
105+
"${workspaceRoot}/core/node_modules/jest/bin/jest.js",
106+
"--runInBand",
107+
"--config",
108+
"${workspaceRoot}/core/jest.config.js",
109+
"${relativeFile}"
110+
],
111+
"cwd": "${workspaceRoot}/core",
112+
"console": "integratedTerminal",
113+
"internalConsoleOptions": "neverOpen"
98114
}
99115
]
100116
}

.vscode/tasks.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
// To bundle the code the same way we do for publishing
1313
"vscode-extension:esbuild",
1414
// Start the React app that is used in the extension
15-
"gui:dev",
16-
// Start the docs site, without opening the browser
17-
"docs:start"
15+
"gui:dev"
1816
],
1917
"group": {
2018
"kind": "build",

binary/package-lock.json

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/config/ConfigHandler.ts

+7
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ export class ConfigHandler {
188188
this.selectedProfileId = profileId;
189189
const newConfig = await this.loadConfig();
190190
this.notifyConfigListerners(newConfig);
191+
const selectedProfiles =
192+
this.globalContext.get("lastSelectedProfileForWorkspace") ?? {};
193+
selectedProfiles[await this.getWorkspaceId()] = profileId;
194+
this.globalContext.update(
195+
"lastSelectedProfileForWorkspace",
196+
selectedProfiles,
197+
);
191198
}
192199

193200
// A unique ID for the current workspace, built from folder names

core/config/onboarding.ts

-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ export function setupApiKeysMode(
1010
return {
1111
...config,
1212
models: config.models.filter((model) => model.provider !== "free-trial"),
13-
tabAutocompleteModel: {
14-
title: "Tab Autocomplete",
15-
provider: "free-trial",
16-
model: TRIAL_FIM_MODEL,
17-
},
1813
embeddingsProvider: {
1914
provider: "free-trial",
2015
},

core/config/profile/LocalProfileLoader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { IProfileLoader } from "./IProfileLoader";
66
export default class LocalProfileLoader implements IProfileLoader {
77
static ID = "local";
88
profileId = LocalProfileLoader.ID;
9-
profileTitle = "config.json";
9+
profileTitle = "Local Config";
1010

1111
constructor(
1212
private ide: IDE,

core/context/providers/DocsContextProvider.ts

+31-26
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ContextProviderExtras,
66
ContextSubmenuItem,
77
LoadSubmenuItemsArgs,
8+
SiteIndexingConfig,
89
} from "../../index.js";
910
import { DocsService } from "../../indexing/docs/DocsService.js";
1011
import configs from "../../indexing/docs/preIndexedDocs.js";
@@ -108,40 +109,44 @@ class DocsContextProvider extends BaseContextProvider {
108109
];
109110
}
110111

111-
async loadSubmenuItems(
112-
args: LoadSubmenuItemsArgs,
113-
): Promise<ContextSubmenuItem[]> {
114-
const docs = await this.docsService.list();
115-
const submenuItems: ContextSubmenuItem[] = docs.map((doc) => ({
112+
// Get combined site configs from preIndexedDocs and options.sites.
113+
private _getDocsSitesConfig(): SiteIndexingConfig[] {
114+
return [...configs, ...(this.options?.sites || [])];
115+
}
116+
117+
// Get indexed docs as ContextSubmenuItems from database.
118+
private async _getIndexedDocsContextSubmenuItems(): Promise<ContextSubmenuItem[]> {
119+
return (await this.docsService.list()).map((doc) => ({
116120
title: doc.title,
117121
description: new URL(doc.baseUrl).hostname,
118122
id: doc.baseUrl,
119-
metadata: {
120-
preIndexed: !!configs.find((config) => config.title === doc.title),
121-
},
122123
}));
124+
}
123125

124-
submenuItems.push(
125-
...configs
126-
// After it's actually downloaded, we don't want to show twice
127-
.filter(
128-
(config) => !submenuItems.some((item) => item.id === config.startUrl),
129-
)
130-
.map((config) => ({
131-
title: config.title,
132-
description: new URL(config.startUrl).hostname,
133-
id: config.startUrl,
134-
metadata: {
135-
preIndexed: true,
136-
},
137-
// iconUrl: config.faviconUrl,
138-
})),
139-
);
126+
async loadSubmenuItems(
127+
args: LoadSubmenuItemsArgs,
128+
): Promise<ContextSubmenuItem[]> {
129+
const submenuItemsMap = new Map<string, ContextSubmenuItem>();
130+
131+
for (const item of await this._getIndexedDocsContextSubmenuItems()) {
132+
submenuItemsMap.set(item.id, item);
133+
}
134+
135+
for (const config of this._getDocsSitesConfig()) {
136+
submenuItemsMap.set(config.startUrl, {
137+
id: config.startUrl,
138+
title: config.title,
139+
description: new URL(config.startUrl).hostname,
140+
metadata: { preIndexed: !!configs.find((cnf) => cnf.title === config.title), },
141+
});
142+
}
143+
144+
const submenuItems = Array.from(submenuItemsMap.values());
140145

141146
// Sort submenuItems such that the objects with titles which don't occur in configs occur first, and alphabetized
142147
submenuItems.sort((a, b) => {
143-
const aTitleInConfigs = a.metadata?.preIndexed;
144-
const bTitleInConfigs = b.metadata?.preIndexed;
148+
const aTitleInConfigs = a.metadata?.preIndexed ?? false;
149+
const bTitleInConfigs = b.metadata?.preIndexed ?? false;
145150

146151
// Primary criterion: Items not in configs come first
147152
if (!aTitleInConfigs && bTitleInConfigs) {

core/context/retrieval/retrieval.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
} from "../../index.js";
66

77
import { getRelativePath } from "../../util/index.js";
8-
import { RETRIEVAL_PARAMS } from "../../util/parameters.js";
98
import { RetrievalPipelineOptions } from "./pipelines/BaseRetrievalPipeline.js";
109
import NoRerankerRetrievalPipeline from "./pipelines/NoRerankerRetrievalPipeline.js";
1110
import RerankerRetrievalPipeline from "./pipelines/RerankerRetrievalPipeline.js";
@@ -29,12 +28,14 @@ export async function retrieveContextItemsFromEmbeddings(
2928
);
3029
}
3130

32-
const nFinal = options?.nFinal || RETRIEVAL_PARAMS.nFinal;
31+
// Fill half of the context length, up to a max of 100 snippets
32+
const contextLength = extras.llm.contextLength;
33+
const tokensPerSnippet = 512;
34+
const nFinal =
35+
options?.nFinal ?? Math.min(50, contextLength / tokensPerSnippet / 2);
3336
const useReranking = extras.reranker !== undefined;
3437
const nRetrieve =
35-
useReranking === false
36-
? nFinal
37-
: options?.nRetrieve || RETRIEVAL_PARAMS.nRetrieve;
38+
useReranking === false ? nFinal : options?.nRetrieve || 2 * nFinal;
3839

3940
// Get tags to retrieve for
4041
const workspaceDirs = await extras.ide.getWorkspaceDirs();

core/core.ts

+25
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,19 @@ export class Core {
242242
await this.docsService.delete(baseUrl);
243243
this.messenger.send("refreshSubmenuItems", undefined);
244244
});
245+
on("context/indexDocs", async (msg) => {
246+
const config = await this.config();
247+
const provider: any = config.contextProviders?.find(
248+
(provider) => provider.description.title === "docs",
249+
);
250+
251+
const siteIndexingOptions: SiteIndexingConfig[] = provider ?
252+
(mProvider => mProvider?.options?.sites || [])({ ...provider }) :
253+
[];
254+
255+
await this.indexDocs(siteIndexingOptions, msg.data.reIndex);
256+
this.ide.infoPopup("Docs indexing completed");
257+
});
245258
on("context/loadSubmenuItems", async (msg) => {
246259
const config = await this.config();
247260
const items = config.contextProviders
@@ -623,4 +636,16 @@ export class Core {
623636
this.indexingState = update;
624637
}
625638
}
639+
640+
private async indexDocs(sites: SiteIndexingConfig[], reIndex: boolean): Promise<void> {
641+
for (const site of sites) {
642+
for await (const update of this.docsService.indexAndAdd(site, new TransformersJsEmbeddingsProvider(), reIndex)) {
643+
// Temporary disabled posting progress updates to the UI due to
644+
// possible collision with code indexing progress updates.
645+
646+
// this.messenger.request("indexProgress", update);
647+
// this.indexingState = update;
648+
}
649+
}
650+
}
626651
}

0 commit comments

Comments
 (0)