Skip to content

Commit 2362d21

Browse files
Merge branch 'dev' of https://github.com/vijaisivakumar/continue into vijai/update-context-for-slash-commands
2 parents cfac639 + fe586f8 commit 2362d21

File tree

85 files changed

+1139
-455
lines changed

Some content is hidden

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

85 files changed

+1139
-455
lines changed

.changes/extensions/vscode/0.8.45.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## 0.8.45 - 2024-08-05
2+
### Added
3+
* Support for Llama 3.1 and gpt-4o-mini
4+
* Support for WatsonX+Granite models
5+
### Changed
6+
* Significant improvements to indexing performance
7+
* Improved @codebase quality by more accurately searching over file names and paths
8+
* Improved @codebase accuracy
9+
* Further improvements to indexing performance
10+
### Fixed
11+
* Improved docs indexing and management
12+
* Fixed Gemini embeddings provider

.changes/extensions/vscode/0.8.46.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## 0.8.46 - 2024-08-11
2+
### Added
3+
* new /onboard slash command
4+
### Fixed
5+
* Fixed problem loading config.ts
6+
* Fixed bug causing duplicate indexing work

.changes/unreleased/Added-20240726-153514.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/unreleased/Added-20240809-155609.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/unreleased/Changed-20240726-153458.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/unreleased/Changed-20240726-153542.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changes/unreleased/Fixed-20240809-155531.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/unreleased/Fixed-20240809-155551.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/jetbrains-build.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
## JBIJPPTPL
1414

1515
name: Build
16-
on:
17-
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
18-
push:
19-
branches: [main, preview]
20-
# Trigger the workflow on any pull request
21-
# pull_request:
16+
# on:
17+
# # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
18+
# push:
19+
# branches: [main, preview]
20+
# Trigger the workflow on any pull request
21+
# pull_request:
2222

2323
concurrency:
2424
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

.github/workflows/jetbrains-release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information.
44

55
name: Release
6-
on:
7-
release:
8-
types: [prereleased, released]
6+
# on:
7+
# release:
8+
# types: [prereleased, released]
99

1010
defaults:
1111
run:

.github/workflows/main.yaml

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
name: Publish Extension
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
types: [closed]
4+
create:
5+
tags:
6+
- "v0.8.*-vscode"
97
branches:
108
- main
119

@@ -49,8 +47,13 @@ jobs:
4947
runs-on: ${{ matrix.os }}
5048
steps:
5149
# 1. Check-out repository
52-
- name: Check-out repository
50+
- name: Checkout
5351
uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0 # This ensures all tags are fetched
54+
55+
- name: Checkout tag
56+
run: git checkout ${GITHUB_REF#refs/tags/}
5457

5558
- name: Make sure version isn't odd
5659
run: |
@@ -99,7 +102,6 @@ jobs:
99102
cd core
100103
npm ci
101104
102-
# 2.25 Run core tests
103105
- name: Run core tests
104106
run: |
105107
cd core
@@ -125,19 +127,19 @@ jobs:
125127
126128
# 4. Run tests for the extension
127129
# - name: Install Xvfb for Linux and run tests
128-
# run: |
129-
# sudo apt-get install -y xvfb # Install Xvfb
130-
# Xvfb :99 & # Start Xvfb
131-
# export DISPLAY=:99 # Export the display number to the environment
132-
# cd extensions/vscode
133-
# npm run test
134-
# if: matrix.os == 'ubuntu-latest'
135-
136-
- name: Run extension tests
137-
run: |
138-
cd extensions/vscode
139-
npm run test
140-
if: matrix.os != 'ubuntu-latest'
130+
# run: |
131+
# sudo apt-get install -y xvfb # Install Xvfb
132+
# Xvfb :99 & # Start Xvfb
133+
# export DISPLAY=:99 # Export the display number to the environment
134+
# cd extensions/vscode
135+
# npm run test
136+
# if: matrix.os == 'ubuntu-latest'
137+
138+
# - name: Run extension tests
139+
# run: |
140+
# cd extensions/vscode
141+
# npm run test
142+
# if: matrix.os != 'ubuntu-latest'
141143

142144
# 5. Package the extension
143145
- name: Package the extension
@@ -167,20 +169,10 @@ jobs:
167169
# Download the .vsix artifacts
168170
- uses: actions/download-artifact@v3
169171

170-
- name: Tag the repository
171-
id: tag
172-
run: |
173-
# See https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names
174-
TAG=v$(grep -o '"version": "[^"]*' extensions/vscode/package.json | cut -d'"' -f4)-vscode
175-
echo "$TAG"
176-
echo "tag=$TAG" >> $GITHUB_OUTPUT
177-
git tag -a $TAG -m "Published version $TAG" ${GITHUB_SHA}
178-
git push origin $TAG
179-
180172
- name: Release
181173
uses: softprops/action-gh-release@v2
182174
with:
183-
tag_name: ${{ steps.tag.outputs.tag }}
175+
tag_name: ${{ github.ref_name }}
184176
files: |
185177
alpine-x64/*.vsix
186178
darwin-arm64/*.vsix

.github/workflows/preview.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish Preview Extension
33
on:
44
create:
55
tags:
6-
- "v*"
6+
- "v0.9.*-vscode"
77
branches:
88
- dev
99

@@ -97,6 +97,13 @@ jobs:
9797
cd core
9898
npm ci
9999
100+
- name: Run core tests
101+
run: |
102+
cd core
103+
npm run test
104+
env:
105+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
106+
100107
# 2.5. Pre package
101108
- name: Set var for environment info
102109
shell: pwsh
@@ -107,14 +114,6 @@ jobs:
107114
cd extensions/vscode
108115
npm run prepackage -- --target ${{ env.target }}
109116
110-
# 2.75 Run core tests
111-
- name: Run core tests
112-
run: |
113-
cd core
114-
npm run test
115-
env:
116-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
117-
118117
# 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js)
119118
- name: Re-install esbuild
120119
run: |

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ For the sake of rapid development, it is also possible to configure this communi
163163

164164
If you make changes to Kotlin code, they can often be hot-reloaded with "Run -> Debugging Actions -> Reload Changed Classes".
165165

166+
### Our Git Workflow
167+
168+
We keep two permanent branches: `main` and `dev`. All contributions should be made as pull requests to the `dev` branch. When we are ready to create a "pre-release" version, we create a tag on the `dev` branch, which automatically triggers the workflow in [preview.yaml](./.github/workflows/preview.yaml), which builds and releases a version of the VS Code extension. When a release has been sufficiently tested, we will merge its tag into the `main` branch. Creating a tag on the `main` branch will then trigger a similar workflow in [main.yaml](./.github/workflows/main.yaml), which will build and release a main release of the VS Code extension. Any hotfixes can be made by creating a feature branch from the tag for the release in question.
169+
166170
### Formatting
167171

168172
Continue uses [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) to format JavaScript/TypeScript. Please install the Prettier extension in VS Code and enable "Format on Save" in your settings.

core/autocomplete/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Follow these steps to ensure that everything is set up correctly:
131131
3. Run `ollama run starcoder:3b` to verify that the model is downloaded.
132132
4. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere.
133133
5. Make sure that you aren't also using another Ollama model for chat. This will cause Ollama to constantly load and unload the models from memory, resulting in slow responses (or none at all) for both.
134-
6. Check the output of the logs to find any potential errors (cmd/ctrl+shift+p -> "Toggle Developer Tools" -> "Console" tab in VS Code, ~/.continue/core.log in JetBrains).
134+
6. Check the output of the logs to find any potential errors (cmd/ctrl+shift+p -> "Toggle Developer Tools" -> "Console" tab in VS Code, ~/.continue/logs/core.log in JetBrains).
135135
7. If you are still having issues, please let us know in our [Discord](https://discord.gg/vapESyrFmJ) and we'll help as soon as possible.
136136

137137
### Completions are slow

core/config/ConfigHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export class ConfigHandler {
258258
const newConfig = await this.currentProfile.reloadConfig();
259259
this.inactiveProfiles.forEach((profile) => profile.clearConfig());
260260
this.notifyConfigListeners(newConfig);
261+
return newConfig;
261262
}
262263

263264
getSerializedConfig(): Promise<BrowserSerializedContinueConfig> {

core/config/types.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
11
const Types = `
22
declare global {
3-
declare global {
4-
interface Window {
5-
ide?: "vscode";
6-
windowId: string;
7-
serverUrl: string;
8-
vscMachineId: string;
9-
vscMediaUrl: string;
10-
fullColorTheme?: {
11-
rules?: {
12-
token?: string;
13-
foreground?: string;
14-
}[];
15-
};
16-
colorThemeName?: string;
17-
workspacePaths?: string[];
18-
postIntellijMessage?: (
19-
messageType: string,
20-
data: any,
21-
messageIde: string,
22-
) => void;
23-
}
24-
}
25-
263
export interface ChunkWithoutID {
274
content: string;
285
startLine: number;

core/context/providers/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ContextProviderName } from "../../index.js";
22
import { BaseContextProvider } from "../index.js";
33
import CodeContextProvider from "./CodeContextProvider.js";
4-
import CodebaseContextProvider from "./CodebaseContextProvider.js";
54
import ContinueProxyContextProvider from "./ContinueProxyContextProvider.js";
65
import CurrentFileContextProvider from "./CurrentFileContextProvider.js";
76
import DatabaseContextProvider from "./DatabaseContextProvider.js";

core/context/retrieval/pipelines/BaseRetrievalPipeline.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from "../../../index.js";
88
import { chunkDocument } from "../../../indexing/chunk/chunk.js";
99
import { LanceDbIndex } from "../../../indexing/LanceDbIndex.js";
10-
import { MAX_CHUNK_SIZE } from "../../../llm/constants.js";
1110
import { retrieveFts } from "../fullTextSearch.js";
1211
import { recentlyEditedFilesCache } from "../recentlyEditedFilesCache.js";
1312

@@ -34,7 +33,7 @@ export default class BaseRetrievalPipeline implements IRetrievalPipeline {
3433
this.lanceDbIndex = new LanceDbIndex(
3534
options.embeddingsProvider,
3635
(path) => options.ide.readFile(path),
37-
options.pathSep
36+
options.pathSep,
3837
);
3938
}
4039

@@ -63,7 +62,7 @@ export default class BaseRetrievalPipeline implements IRetrievalPipeline {
6362
const fileChunks = chunkDocument({
6463
filepath,
6564
contents,
66-
maxChunkSize: MAX_CHUNK_SIZE,
65+
maxChunkSize: this.options.embeddingsProvider.maxChunkSize,
6766
digest: filepath,
6867
});
6968

core/core.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export class Core {
173173
console.error(err);
174174
Telemetry.capture("core_messenger_error", {
175175
message: err.message,
176+
stack: err.stack,
176177
});
177178
this.messenger.request("errorPopup", { message: err.message });
178179
});
@@ -638,8 +639,13 @@ export class Core {
638639
const rows = await DevDataSqliteDb.getTokensPerModel();
639640
return rows;
640641
});
641-
on("index/forceReIndex", async (msg) => {
642-
const dirs = msg.data ? [msg.data] : await this.ide.getWorkspaceDirs();
642+
on("index/forceReIndex", async ({ data }) => {
643+
if (data?.shouldClearIndexes) {
644+
const codebaseIndexer = await this.codebaseIndexerPromise;
645+
await codebaseIndexer.clearIndexes();
646+
}
647+
648+
const dirs = data?.dir ? [data.dir] : await this.ide.getWorkspaceDirs();
643649
await this.refreshCodebaseIndex(dirs);
644650
});
645651
on("index/setPaused", (msg) => {
@@ -690,6 +696,7 @@ export class Core {
690696
"indexing_error",
691697
{
692698
error: update.desc,
699+
stack: update.debugInfo,
693700
},
694701
false,
695702
);

core/index.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export interface Chunk extends ChunkWithoutID {
3737
export interface IndexingProgressUpdate {
3838
progress: number;
3939
desc: string;
40+
shouldClearIndexes?: boolean;
4041
status: "loading" | "indexing" | "done" | "failed" | "paused" | "disabled";
42+
debugInfo?: string;
4143
}
4244

4345
export type PromptTemplate =
@@ -871,10 +873,14 @@ interface QuickActionConfig {
871873
sendToChat: boolean;
872874
}
873875

876+
export type DefaultContextProvider = ContextProviderWithParams & {
877+
query?: string;
878+
};
879+
874880
interface ExperimentalConfig {
875881
contextMenuPrompts?: ContextMenuConfig;
876882
modelRoles?: ModelRoles;
877-
defaultContext?: "activeFile"[];
883+
defaultContext?: DefaultContextProvider[];
878884
promptPath?: string;
879885

880886
/**

core/indexing/CodeSnippetsIndex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
201201

202202
for (const snippet of snippets) {
203203
const { lastID } = await db.run(
204-
"INSERT INTO code_snippets (path, cacheKey, content, title, startLine, endLine) VALUES (?, ?, ?, ?, ?, ?)",
204+
"REPLACE INTO code_snippets (path, cacheKey, content, title, startLine, endLine) VALUES (?, ?, ?, ?, ?, ?)",
205205
[
206206
addTag.path,
207207
addTag.cacheKey,
@@ -212,7 +212,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
212212
],
213213
);
214214
await db.run(
215-
"INSERT INTO code_snippets_tags (snippetId, tag) VALUES (?, ?)",
215+
"REPLACE INTO code_snippets_tags (snippetId, tag) VALUES (?, ?)",
216216
[lastID, tagString],
217217
);
218218
}

0 commit comments

Comments
 (0)