diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index fde20fbb2..7392a3ead 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -1515,7 +1515,11 @@ "then": { "properties": { "model": { - "enum": ["llama3.1-8b", "llama3.1-70b", "llama-4-scout-17b-16e-instruct"] + "enum": [ + "llama3.1-8b", + "llama3.1-70b", + "llama-4-scout-17b-16e-instruct" + ] } } } diff --git a/extensions/vscode/scripts/package-all.js b/extensions/vscode/scripts/package-all.js index 7f1047110..0a49403d2 100644 --- a/extensions/vscode/scripts/package-all.js +++ b/extensions/vscode/scripts/package-all.js @@ -2,12 +2,12 @@ const { execSync } = require("child_process"); const PLATFORMS = [ "win32-x64", -// "win32-arm64", can't be built due to no sqlite3 binaries + // "win32-arm64", can't be built due to no sqlite3 binaries "linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", -] +]; const args = process.argv.slice(2); const isPreRelease = args.includes("--pre-release"); @@ -18,16 +18,9 @@ const isPreRelease = args.includes("--pre-release"); ? "node scripts/package.js --pre-release --target " + platform // --yarn" : "node scripts/package.js --target " + platform; // --yarn"; - execSync( - "node scripts/prepackage-cross-platform.js --target "+ platform, - {stdio: 'inherit'} - - ); - execSync( - pkgCommand, - {stdio: 'inherit'} - ); + execSync("node scripts/prepackage-cross-platform.js --target " + platform, { + stdio: "inherit", + }); + execSync(pkgCommand, { stdio: "inherit" }); } })(); - - \ No newline at end of file diff --git a/extensions/vscode/scripts/utils.js b/extensions/vscode/scripts/utils.js index c61a59510..451fde407 100644 --- a/extensions/vscode/scripts/utils.js +++ b/extensions/vscode/scripts/utils.js @@ -302,7 +302,7 @@ async function copyNodeModules() { ); // delete esbuild/bin because platform-specific @esbuild is downloaded - fs.rmdirSync(`out/node_modules/esbuild/bin`, {recursive: true}); + fs.rmdirSync(`out/node_modules/esbuild/bin`, { recursive: true }); console.log(`[info] Copied ${NODE_MODULES_TO_COPY.join(", ")}`); } diff --git a/extensions/vscode/scripts/versionCheck.js b/extensions/vscode/scripts/versionCheck.js index 6fc148f46..8d3621d1e 100644 --- a/extensions/vscode/scripts/versionCheck.js +++ b/extensions/vscode/scripts/versionCheck.js @@ -7,6 +7,6 @@ const version = packageJsonJson.version; const minor = parseInt(version.split(".")[1]); if (minor % 2 !== 0) { throw new Error( - "Do not publish odd-numbered version to main VS Code release!" + "Do not publish odd-numbered version to main VS Code release!", ); } diff --git a/extensions/vscode/src/VsCodeIde.ts b/extensions/vscode/src/VsCodeIde.ts index 4a553ef60..48a35fa69 100644 --- a/extensions/vscode/src/VsCodeIde.ts +++ b/extensions/vscode/src/VsCodeIde.ts @@ -335,7 +335,10 @@ class VsCodeIde implements IDE { const pathToLastModified: FileStatsMap = {}; await Promise.all( files.map(async (file) => { - const stat = await this.ideUtils.stat(vscode.Uri.parse(file), false /* No need to catch ENOPRO exceptions */); + const stat = await this.ideUtils.stat( + vscode.Uri.parse(file), + false /* No need to catch ENOPRO exceptions */, + ); pathToLastModified[file] = { lastModified: stat!.mtime, size: stat!.size, @@ -401,7 +404,8 @@ class VsCodeIde implements IDE { const configs: ContinueRcJson[] = []; for (const workspaceDir of workspaceDirs) { const files = await this.ideUtils.readDirectory(workspaceDir); - if (files === null) {//Unlikely, but just in case... + if (files === null) { + //Unlikely, but just in case... continue; } for (const [filename, type] of files) { @@ -753,7 +757,7 @@ class VsCodeIde implements IDE { async listDir(dir: string): Promise<[string, FileType][]> { const entries = await this.ideUtils.readDirectory(vscode.Uri.parse(dir)); - return entries === null? [] : entries as any; + return entries === null ? [] : (entries as any); } private getIdeSettingsSync(): IdeSettings { diff --git a/extensions/vscode/src/activation/InlineTipManager.ts b/extensions/vscode/src/activation/InlineTipManager.ts index b5158758a..98fa4ed32 100644 --- a/extensions/vscode/src/activation/InlineTipManager.ts +++ b/extensions/vscode/src/activation/InlineTipManager.ts @@ -49,7 +49,7 @@ const SVG_CONFIG = { return this.fontSize; }, get textY() { - return (this.tipHeight + this.fontSize)/2; + return (this.tipHeight + this.fontSize) / 2; }, get chatLabelX() { return this.paddingX; @@ -58,7 +58,11 @@ const SVG_CONFIG = { return this.chatLabelX + this.getEstimatedTextWidth(this.chatLabel + " "); }, get editLabelX() { - return this.chatShortcutX + this.getEstimatedTextWidth(this.chatShortcut) + this.gap; + return ( + this.chatShortcutX + + this.getEstimatedTextWidth(this.chatShortcut) + + this.gap + ); }, get editShortcutX() { return this.editLabelX + this.getEstimatedTextWidth(this.editLabel + " "); diff --git a/extensions/vscode/src/apply/utils.ts b/extensions/vscode/src/apply/utils.ts index 69ea37a3e..4c89eba21 100644 --- a/extensions/vscode/src/apply/utils.ts +++ b/extensions/vscode/src/apply/utils.ts @@ -10,6 +10,6 @@ export const FAST_APPLY_MODELS: Array = ["Fast-Apply"]; */ export function isFastApplyModel(llm: ILLM): boolean { return FAST_APPLY_MODELS?.some((fastApplyModel) => - llm.model.toLowerCase().includes(fastApplyModel.toLowerCase()) + llm.model.toLowerCase().includes(fastApplyModel.toLowerCase()), ); } diff --git a/extensions/vscode/src/autocomplete/RecentlyVisitedRangesService.ts b/extensions/vscode/src/autocomplete/RecentlyVisitedRangesService.ts index a20e88ac3..bd55278d6 100644 --- a/extensions/vscode/src/autocomplete/RecentlyVisitedRangesService.ts +++ b/extensions/vscode/src/autocomplete/RecentlyVisitedRangesService.ts @@ -113,10 +113,16 @@ export class RecentlyVisitedRangesService { } return allSnippets - .filter((s) => !currentFilepath || (s.filepath !== currentFilepath && - // Exclude Continue's own output as it makes it super-hard for users to test the autocomplete feature - // while looking at the prompts in the Continue's output - !s.filepath.startsWith("output:extension-output-Continue.continue"))) + .filter( + (s) => + !currentFilepath || + (s.filepath !== currentFilepath && + // Exclude Continue's own output as it makes it super-hard for users to test the autocomplete feature + // while looking at the prompts in the Continue's output + !s.filepath.startsWith( + "output:extension-output-Continue.continue", + )), + ) .sort((a, b) => b.timestamp - a.timestamp) .map(({ timestamp, ...snippet }) => snippet); } diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts index a2688d886..b77b4de40 100644 --- a/extensions/vscode/src/autocomplete/completionProvider.ts +++ b/extensions/vscode/src/autocomplete/completionProvider.ts @@ -31,7 +31,8 @@ interface VsCodeCompletionInput { } export class ContinueCompletionProvider - implements vscode.InlineCompletionItemProvider { + implements vscode.InlineCompletionItemProvider +{ private async onError(e: any) { if (await handleLLMError(e)) { return; @@ -88,7 +89,6 @@ export class ContinueCompletionProvider _lastShownCompletion: AutocompleteOutcome | undefined; - public async provideInlineCompletionItems( document: vscode.TextDocument, position: vscode.Position, @@ -254,7 +254,7 @@ export class ContinueCompletionProvider const result = processSingleLineCompletion( lastLineOfCompletionText, currentText, - startPos.character + startPos.character, ); if (result === undefined) { @@ -265,10 +265,9 @@ export class ContinueCompletionProvider if (result.range) { range = new vscode.Range( new vscode.Position(startPos.line, result.range.start), - new vscode.Position(startPos.line, result.range.end) + new vscode.Position(startPos.line, result.range.end), ); } - } else { // Extend the range to the end of the line for multiline completions range = new vscode.Range(startPos, document.lineAt(startPos).range.end); diff --git a/extensions/vscode/src/autocomplete/recentlyEdited.ts b/extensions/vscode/src/autocomplete/recentlyEdited.ts index a9ac75ab7..9fa48cd98 100644 --- a/extensions/vscode/src/autocomplete/recentlyEdited.ts +++ b/extensions/vscode/src/autocomplete/recentlyEdited.ts @@ -48,7 +48,6 @@ export class RecentlyEditedTracker { private async insertRange( editedRange: Omit, ): Promise { - if (editedRange.uri.scheme !== "file") { return; } @@ -119,10 +118,10 @@ export class RecentlyEditedTracker { return ""; } return content - .toString() - .split("\n") - .slice(entry.range.start.line, entry.range.end.line + 1) - .join("\n"); + .toString() + .split("\n") + .slice(entry.range.start.line, entry.range.end.line + 1) + .join("\n"); } public async getRecentlyEditedRanges(): Promise { diff --git a/extensions/vscode/src/diff/vertical/handler.ts b/extensions/vscode/src/diff/vertical/handler.ts index 2a159a64f..743b277c9 100644 --- a/extensions/vscode/src/diff/vertical/handler.ts +++ b/extensions/vscode/src/diff/vertical/handler.ts @@ -174,10 +174,7 @@ export class VerticalDiffHandler implements vscode.Disposable { await this.reapplyWithMyersDiff(diffLines); const range = new vscode.Range(this.startLine, 0, this.startLine, 0); - this.editor.revealRange( - range, - vscode.TextEditorRevealType.Default, - ); + this.editor.revealRange(range, vscode.TextEditorRevealType.Default); this.options.onStatusUpdate( "done", @@ -423,11 +420,13 @@ export class VerticalDiffHandler implements vscode.Disposable { private incrementCurrentLineIndex() { this.currentLineIndex++; this.updateIndexLineDecorations(); - const range = new vscode.Range(this.currentLineIndex, 0, this.currentLineIndex, 0); - this.editor.revealRange( - range, - vscode.TextEditorRevealType.Default, + const range = new vscode.Range( + this.currentLineIndex, + 0, + this.currentLineIndex, + 0, ); + this.editor.revealRange(range, vscode.TextEditorRevealType.Default); } private async insertTextAboveLine(index: number, text: string) { diff --git a/extensions/vscode/src/quickEdit/EditDecorationManager.ts b/extensions/vscode/src/quickEdit/EditDecorationManager.ts index 18991ac49..9df5acabc 100644 --- a/extensions/vscode/src/quickEdit/EditDecorationManager.ts +++ b/extensions/vscode/src/quickEdit/EditDecorationManager.ts @@ -31,10 +31,12 @@ class EditDecorationManager { // Checks if two ranges are adjacent or overlapping private rangesCoincide(range1: vscode.Range, range2: vscode.Range): boolean { - return range1.start.isEqual(range2.start) - || range1.end.isEqual(range2.start) - || range2.end.isEqual(range1.start) - || !!range1.intersection(range2); + return ( + range1.start.isEqual(range2.start) || + range1.end.isEqual(range2.start) || + range2.end.isEqual(range1.start) || + !!range1.intersection(range2) + ); } // Merges new range with existing ranges in the map @@ -43,7 +45,7 @@ class EditDecorationManager { const rangesToPrune: string[] = []; for (const [key, existingRange] of this.activeRangesMap.entries()) { - if (!this.rangesCoincide(mergedRange, existingRange)) continue; + if (!this.rangesCoincide(mergedRange, existingRange)) continue; mergedRange = mergedRange.union(existingRange); rangesToPrune.push(key); } diff --git a/extensions/vscode/src/util/FileSearch.ts b/extensions/vscode/src/util/FileSearch.ts index a1f419e73..10bf0977c 100644 --- a/extensions/vscode/src/util/FileSearch.ts +++ b/extensions/vscode/src/util/FileSearch.ts @@ -18,7 +18,13 @@ export class FileSearch { private miniSearch = new MiniSearch({ fields: ["relativePath", "id"], storeFields: ["relativePath", "id"], - tokenize: text => deduplicateArray(MiniSearch.getDefault('tokenize')(text).concat(splitCamelCaseAndNonAlphaNumeric(text)), (a, b) => a === b), + tokenize: (text) => + deduplicateArray( + MiniSearch.getDefault("tokenize")(text).concat( + splitCamelCaseAndNonAlphaNumeric(text), + ), + (a, b) => a === b, + ), searchOptions: { prefix: true, fuzzy: 2, diff --git a/extensions/vscode/src/util/addCode.ts b/extensions/vscode/src/util/addCode.ts index 0b602811a..524d77e88 100644 --- a/extensions/vscode/src/util/addCode.ts +++ b/extensions/vscode/src/util/addCode.ts @@ -89,18 +89,18 @@ export async function addHighlightedCodeToContext( export async function addEntireFileToContext( uri: vscode.Uri, webviewProtocol: VsCodeWebviewProtocol | undefined, - ideUtils: VsCodeIdeUtils + ideUtils: VsCodeIdeUtils, ) { // If a directory, add all files in the directory const stat = await ideUtils.stat(uri); if (stat?.type === vscode.FileType.Directory) { - const files = (await ideUtils.readDirectory(uri))!;//files can't be null if we reached this point + const files = (await ideUtils.readDirectory(uri))!; //files can't be null if we reached this point for (const [filename, type] of files) { if (type === vscode.FileType.File) { addEntireFileToContext( vscode.Uri.joinPath(uri, filename), webviewProtocol, - ideUtils + ideUtils, ); } } diff --git a/extensions/vscode/src/util/getTheme.ts b/extensions/vscode/src/util/getTheme.ts index 7d7cb2407..e47dbccfe 100644 --- a/extensions/vscode/src/util/getTheme.ts +++ b/extensions/vscode/src/util/getTheme.ts @@ -11,20 +11,20 @@ import * as vscode from "vscode"; function stripInLineComment(line: string): string { let inString = false; - let pCh = ''; + let pCh = ""; - for (let i = 0; i < line.length-1; i++) { + for (let i = 0; i < line.length - 1; i++) { const ch = line[i]; const nCh = line[i + 1]; // If we're not in a string and we see '//' this is a comment. - if (!inString && ch === '/' && nCh === '/') { + if (!inString && ch === "/" && nCh === "/") { // Stop processing this line from here. return line.substring(0, i); } // Toggle inString state if we see a double quote not escaped by a backslash. - if (ch === '"' && pCh !== '\\') { + if (ch === '"' && pCh !== "\\") { inString = !inString; } diff --git a/extensions/vscode/src/util/ideUtils.ts b/extensions/vscode/src/util/ideUtils.ts index 3494ec29f..85c710fc1 100644 --- a/extensions/vscode/src/util/ideUtils.ts +++ b/extensions/vscode/src/util/ideUtils.ts @@ -292,7 +292,7 @@ export class VsCodeIdeUtils { async readRangeInFile(uri: vscode.Uri, range: vscode.Range): Promise { const buffer = await this.readFile(uri); if (buffer === null) { - return ''; + return ""; } const contents = new TextDecoder().decode(buffer); const lines = contents.split("\n"); @@ -608,7 +608,6 @@ export class VsCodeIdeUtils { try { if (repos) { for (const repo of repos) { - const staged = await repo.diff(true); diffs.push(staged); @@ -620,11 +619,9 @@ export class VsCodeIdeUtils { } return diffs.flatMap((diff) => this.splitDiff(diff)); - } catch (e) { console.error(e); return []; } - } } diff --git a/extensions/vscode/textmate-syntaxes/Handlebars.json b/extensions/vscode/textmate-syntaxes/Handlebars.json index b354cb6f2..222ce2960 100644 --- a/extensions/vscode/textmate-syntaxes/Handlebars.json +++ b/extensions/vscode/textmate-syntaxes/Handlebars.json @@ -1,854 +1,854 @@ { - "name": "Handlebars", - "repository": { - "html_tags": { - "patterns": [ - { - "begin": "(<)([a-zA-Z0-9:-]+)(?=[^>]*>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.html" - } - }, - "end": "(>(<)/)(\\2)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "meta.scope.between-tag-pair.html" - }, - "3": { - "name": "entity.name.tag.html" - }, - "4": { - "name": "punctuation.definition.tag.html" - } - }, - "name": "meta.tag.any.html", - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "begin": "(<\\?)(xml)", - "captures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.xml.html" - } - }, - "end": "(\\?>)", - "name": "meta.tag.preprocessor.xml.html", - "patterns": [ - { - "include": "#tag_generic_attribute" - }, - { - "include": "#string" - } - ] - }, - { - "begin": "