🎨 run biome check in vscode
This commit is contained in:
parent
5635722e4e
commit
235cf41f37
33 changed files with 346 additions and 157 deletions
15
extensions/vscode/biome.json
Normal file
15
extensions/vscode/biome.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
}
|
||||
},
|
||||
"formatter": {
|
||||
"indentStyle": "space"
|
||||
}
|
||||
}
|
||||
157
extensions/vscode/package-lock.json
generated
157
extensions/vscode/package-lock.json
generated
|
|
@ -51,6 +51,7 @@
|
|||
"yarn": "^1.22.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.6.4",
|
||||
"@nestjs/common": "^8.4.7",
|
||||
"@openapitools/openapi-generator-cli": "^2.5.2",
|
||||
"@types/cors": "^2.8.17",
|
||||
|
|
@ -127,6 +128,7 @@
|
|||
"web-tree-sitter": "^0.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.6.4",
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/handlebars": "^4.1.0",
|
||||
"@types/jest": "^29.5.11",
|
||||
|
|
@ -236,6 +238,161 @@
|
|||
"url": "https://github.com/sponsors/philsturgeon"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/biome": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.6.4.tgz",
|
||||
"integrity": "sha512-3groVd2oWsLC0ZU+XXgHSNbq31lUcOCBkCcA7sAQGBopHcmL+jmmdoWlY3S61zIh+f2mqQTQte1g6PZKb3JJjA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
"biome": "bin/biome"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/biome"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@biomejs/cli-darwin-arm64": "1.6.4",
|
||||
"@biomejs/cli-darwin-x64": "1.6.4",
|
||||
"@biomejs/cli-linux-arm64": "1.6.4",
|
||||
"@biomejs/cli-linux-arm64-musl": "1.6.4",
|
||||
"@biomejs/cli-linux-x64": "1.6.4",
|
||||
"@biomejs/cli-linux-x64-musl": "1.6.4",
|
||||
"@biomejs/cli-win32-arm64": "1.6.4",
|
||||
"@biomejs/cli-win32-x64": "1.6.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-arm64": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.6.4.tgz",
|
||||
"integrity": "sha512-2WZef8byI9NRzGajGj5RTrroW9BxtfbP9etigW1QGAtwu/6+cLkdPOWRAs7uFtaxBNiKFYA8j/BxV5zeAo5QOQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-darwin-x64": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.6.4.tgz",
|
||||
"integrity": "sha512-uo1zgM7jvzcoDpF6dbGizejDLCqNpUIRkCj/oEK0PB0NUw8re/cn1EnxuOLZqDpn+8G75COLQTOx8UQIBBN/Kg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.6.4.tgz",
|
||||
"integrity": "sha512-wAOieaMNIpLrxGc2/xNvM//CIZg7ueWy3V5A4T7gDZ3OL/Go27EKE59a+vMKsBCYmTt7jFl4yHz0TUkUbodA/w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.6.4.tgz",
|
||||
"integrity": "sha512-Hp8Jwt6rjj0wCcYAEN6/cfwrrPLLlGOXZ56Lei4Pt4jy39+UuPeAVFPeclrrCfxyL1wQ2xPrhd/saTHSL6DoJg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.6.4.tgz",
|
||||
"integrity": "sha512-qTWhuIw+/ePvOkjE9Zxf5OqSCYxtAvcTJtVmZT8YQnmY2I62JKNV2m7tf6O5ViKZUOP0mOQ6NgqHKcHH1eT8jw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-linux-x64-musl": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.6.4.tgz",
|
||||
"integrity": "sha512-wqi0hr8KAx5kBO0B+m5u8QqiYFFBJOSJVSuRqTeGWW+GYLVUtXNidykNqf1JsW6jJDpbkSp2xHKE/bTlVaG2Kg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-arm64": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.6.4.tgz",
|
||||
"integrity": "sha512-Wp3FiEeF6v6C5qMfLkHwf4YsoNHr/n0efvoC8jCKO/kX05OXaVExj+1uVQ1eGT7Pvx0XVm/TLprRO0vq/V6UzA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@biomejs/cli-win32-x64": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.6.4.tgz",
|
||||
"integrity": "sha512-mz183Di5hTSGP7KjNWEhivcP1wnHLGmOxEROvoFsIxMYtDhzJDad4k5gI/1JbmA0xe4n52vsgqo09tBhrMT/Zg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.21.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@electron/rebuild": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-3.6.0.tgz",
|
||||
|
|
|
|||
|
|
@ -466,6 +466,7 @@
|
|||
"build-release:rust": "npm run build:rust -- --release"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.6.4",
|
||||
"@nestjs/common": "^8.4.7",
|
||||
"@openapitools/openapi-generator-cli": "^2.5.2",
|
||||
"@types/cors": "^2.8.17",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import path from "path";
|
||||
import { getTsConfigPath, migrate } from "core/util/paths";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { VsCodeExtension } from "../extension/vscodeExtension";
|
||||
import registerQuickFixProvider from "../lang-server/codeActions";
|
||||
|
|
@ -43,7 +43,7 @@ function showRefactorMigrationMessage(
|
|||
// Ideally the only global variable
|
||||
// Used in test/test-suites
|
||||
let resolveVsCodeExtension: (value: VsCodeExtension) => void;
|
||||
export let vscodeExtensionPromise: Promise<VsCodeExtension> = new Promise(
|
||||
export const vscodeExtensionPromise: Promise<VsCodeExtension> = new Promise(
|
||||
(resolve) => {
|
||||
resolveVsCodeExtension = resolve;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
*/
|
||||
|
||||
import * as path from "path";
|
||||
import { ExtensionContext, extensions, workspace } from "vscode";
|
||||
import { type ExtensionContext, extensions, workspace } from "vscode";
|
||||
|
||||
import {
|
||||
LanguageClient,
|
||||
LanguageClientOptions,
|
||||
ServerOptions,
|
||||
type LanguageClientOptions,
|
||||
type ServerOptions,
|
||||
State,
|
||||
StateChangeEvent,
|
||||
type StateChangeEvent,
|
||||
TransportKind,
|
||||
} from "vscode-languageclient/node";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
|
|
@ -18,7 +18,7 @@ import { getExtensionUri } from "../util/vscode";
|
|||
let client: LanguageClient;
|
||||
|
||||
export async function startLanguageClient(context: ExtensionContext) {
|
||||
let pythonLS = startPythonLanguageServer(context);
|
||||
const pythonLS = startPythonLanguageServer(context);
|
||||
pythonLS.start();
|
||||
}
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ export async function makeRequest(method: string, param: any): Promise<any> {
|
|||
return;
|
||||
} else if (client.state === State.Starting) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let stateListener = client.onDidChangeState((e: StateChangeEvent) => {
|
||||
const stateListener = client.onDidChangeState((e: StateChangeEvent) => {
|
||||
if (e.newState === State.Running) {
|
||||
stateListener.dispose();
|
||||
resolve(client.sendRequest(method, param));
|
||||
|
|
@ -50,7 +50,7 @@ export function deactivate(): Thenable<void> | undefined {
|
|||
}
|
||||
|
||||
function startPythonLanguageServer(context: ExtensionContext): LanguageClient {
|
||||
let extensionPath = getExtensionUri().fsPath;
|
||||
const extensionPath = getExtensionUri().fsPath;
|
||||
const command = `cd ${path.join(
|
||||
extensionPath,
|
||||
"scripts",
|
||||
|
|
@ -69,22 +69,22 @@ function startPythonLanguageServer(context: ExtensionContext): LanguageClient {
|
|||
}
|
||||
|
||||
async function startPylance(context: ExtensionContext) {
|
||||
let pylance = extensions.getExtension("ms-python.vscode-pylance");
|
||||
const pylance = extensions.getExtension("ms-python.vscode-pylance");
|
||||
await pylance?.activate();
|
||||
if (!pylance) {
|
||||
return;
|
||||
}
|
||||
let { path: lsPath } = await pylance.exports.languageServerFolder();
|
||||
const { path: lsPath } = await pylance.exports.languageServerFolder();
|
||||
|
||||
// The server is implemented in node
|
||||
let serverModule = context.asAbsolutePath(lsPath);
|
||||
const serverModule = context.asAbsolutePath(lsPath);
|
||||
// The debug options for the server
|
||||
// --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
|
||||
let debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] };
|
||||
const debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] };
|
||||
|
||||
// If the extension is launched in debug mode then the debug server options are used
|
||||
// Otherwise the run options are used
|
||||
let serverOptions: ServerOptions = {
|
||||
const serverOptions: ServerOptions = {
|
||||
run: { module: serverModule, transport: TransportKind.ipc },
|
||||
debug: {
|
||||
module: serverModule,
|
||||
|
|
@ -94,7 +94,7 @@ async function startPylance(context: ExtensionContext) {
|
|||
};
|
||||
|
||||
// Options to control the language client
|
||||
let clientOptions: LanguageClientOptions = {
|
||||
const clientOptions: LanguageClientOptions = {
|
||||
// Register the server for plain text documents
|
||||
documentSelector: [{ scheme: "file", language: "python" }],
|
||||
synchronize: {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { IDE } from "core";
|
||||
import type { IDE } from "core";
|
||||
import {
|
||||
AutocompleteInput,
|
||||
type AutocompleteInput,
|
||||
CompletionProvider,
|
||||
} from "core/autocomplete/completionProvider";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import type { ConfigHandler } from "core/config/handler";
|
||||
import { logDevData } from "core/util/devdata";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import { TabAutocompleteModel } from "../util/loadAutocompleteModel";
|
||||
import type { TabAutocompleteModel } from "../util/loadAutocompleteModel";
|
||||
import { getDefinitionsFromLsp } from "./lsp";
|
||||
import { setupStatusBar, stopStatusBarLoading } from "./statusBar";
|
||||
|
||||
|
|
@ -20,8 +20,8 @@ export class ContinueCompletionProvider
|
|||
if (val === "Documentation") {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete"
|
||||
)
|
||||
"https://continue.dev/docs/walkthroughs/tab-autocomplete",
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
@ -32,14 +32,14 @@ export class ContinueCompletionProvider
|
|||
constructor(
|
||||
private readonly configHandler: ConfigHandler,
|
||||
private readonly ide: IDE,
|
||||
private readonly tabAutocompleteModel: TabAutocompleteModel
|
||||
private readonly tabAutocompleteModel: TabAutocompleteModel,
|
||||
) {
|
||||
this.completionProvider = new CompletionProvider(
|
||||
this.configHandler,
|
||||
this.ide,
|
||||
this.tabAutocompleteModel.get.bind(this.tabAutocompleteModel),
|
||||
this.onError.bind(this),
|
||||
getDefinitionsFromLsp
|
||||
getDefinitionsFromLsp,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ export class ContinueCompletionProvider
|
|||
document: vscode.TextDocument,
|
||||
position: vscode.Position,
|
||||
context: vscode.InlineCompletionContext,
|
||||
token: vscode.CancellationToken
|
||||
token: vscode.CancellationToken,
|
||||
//@ts-ignore
|
||||
): ProviderResult<InlineCompletionItem[] | InlineCompletionList> {
|
||||
const enableTabAutocomplete =
|
||||
|
|
@ -75,14 +75,14 @@ export class ContinueCompletionProvider
|
|||
pos: { line: position.line, character: position.character },
|
||||
recentlyEditedFiles: [],
|
||||
recentlyEditedRanges: [],
|
||||
clipboardText: clipboardText
|
||||
clipboardText: clipboardText,
|
||||
};
|
||||
|
||||
setupStatusBar(true, true);
|
||||
const outcome =
|
||||
await this.completionProvider.provideInlineCompletionItems(
|
||||
input,
|
||||
signal
|
||||
signal,
|
||||
);
|
||||
|
||||
if (!outcome || !outcome.completion) {
|
||||
|
|
@ -107,13 +107,13 @@ export class ContinueCompletionProvider
|
|||
outcome.completion,
|
||||
new vscode.Range(
|
||||
position,
|
||||
position.translate(0, outcome.completion.length)
|
||||
position.translate(0, outcome.completion.length),
|
||||
),
|
||||
{
|
||||
title: "Log Autocomplete Outcome",
|
||||
command: "continue.logAutocompleteOutcome",
|
||||
arguments: [outcome, logRejectionTimeout],
|
||||
}
|
||||
},
|
||||
),
|
||||
];
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { IDE, RangeInFile } from "core";
|
||||
import type { IDE, RangeInFile } from "core";
|
||||
import { getAst, getTreePathAtCursor } from "core/autocomplete/ast";
|
||||
import { AutocompleteSnippet } from "core/autocomplete/ranking";
|
||||
import { RangeInFileWithContents } from "core/commands/util";
|
||||
import type { AutocompleteSnippet } from "core/autocomplete/ranking";
|
||||
import type { RangeInFileWithContents } from "core/commands/util";
|
||||
import * as vscode from "vscode";
|
||||
import Parser from "web-tree-sitter";
|
||||
import type Parser from "web-tree-sitter";
|
||||
|
||||
type GotoProviderName =
|
||||
| "vscode.executeDefinitionProvider"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { RecentlyEditedRange } from "core/autocomplete/recentlyEdited";
|
||||
import { RangeInFileWithContents } from "core/commands/util";
|
||||
import type { RecentlyEditedRange } from "core/autocomplete/recentlyEdited";
|
||||
import type { RangeInFileWithContents } from "core/commands/util";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
interface VsCodeRecentlyEditedRange {
|
||||
|
|
|
|||
|
|
@ -3,21 +3,21 @@ import * as os from "os";
|
|||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
import { IDE } from "core";
|
||||
import { AutocompleteOutcome } from "core/autocomplete/completionProvider";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import type { IDE } from "core";
|
||||
import type { AutocompleteOutcome } from "core/autocomplete/completionProvider";
|
||||
import type { ConfigHandler } from "core/config/handler";
|
||||
import { logDevData } from "core/util/devdata";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import { ContinueGUIWebviewViewProvider } from "./debugPanel";
|
||||
import { DiffManager } from "./diff/horizontal";
|
||||
import { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import type { ContinueGUIWebviewViewProvider } from "./debugPanel";
|
||||
import type { DiffManager } from "./diff/horizontal";
|
||||
import type { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import { getPlatform } from "./util/util";
|
||||
import { VsCodeWebviewProtocol } from "./webviewProtocol";
|
||||
import type { VsCodeWebviewProtocol } from "./webviewProtocol";
|
||||
|
||||
function getFullScreenTab() {
|
||||
const tabs = vscode.window.tabGroups.all.flatMap((tabGroup) => tabGroup.tabs);
|
||||
return tabs.find(
|
||||
(tab) => (tab.input as any)?.viewType?.endsWith("continue.continueGUIView"),
|
||||
return tabs.find((tab) =>
|
||||
(tab.input as any)?.viewType?.endsWith("continue.continueGUIView"),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ const commandsMap: (
|
|||
];
|
||||
}
|
||||
|
||||
let text = await vscode.window.showInputBox(textInputOptions);
|
||||
const text = await vscode.window.showInputBox(textInputOptions);
|
||||
|
||||
if (text === undefined) {
|
||||
return;
|
||||
|
|
@ -451,7 +451,7 @@ const commandsMap: (
|
|||
// vscode.commands.executeCommand("workbench.action.toggleZenMode");
|
||||
|
||||
//create the full screen panel
|
||||
let panel = vscode.window.createWebviewPanel(
|
||||
const panel = vscode.window.createWebviewPanel(
|
||||
"continue.continueGUIView",
|
||||
"Continue",
|
||||
vscode.ViewColumn.One,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import * as vscode from "vscode";
|
||||
import { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
import { VsCodeIde } from "../ideProtocol";
|
||||
import type { VsCodeIde } from "../ideProtocol";
|
||||
import type { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
|
||||
export const threadStopped: Map<number, boolean> = new Map();
|
||||
// Arrays has better perf but you probably won't have thousands of threads in a single debug session
|
||||
|
||||
export function registerDebugTracker(
|
||||
webviewProtocol: VsCodeWebviewProtocol,
|
||||
ide: VsCodeIde
|
||||
ide: VsCodeIde,
|
||||
) {
|
||||
vscode.debug.registerDebugAdapterTrackerFactory("*", {
|
||||
createDebugAdapterTracker(_session: vscode.DebugSession) {
|
||||
|
|
@ -35,17 +35,17 @@ export function registerDebugTracker(
|
|||
if (typeof message.body.threadId !== "undefined")
|
||||
threadStopped.set(
|
||||
Number(message.body.threadId),
|
||||
message.event == "stopped"
|
||||
message.event == "stopped",
|
||||
);
|
||||
|
||||
if (message.body.allThreadsStopped)
|
||||
threadStopped.forEach((_, key) =>
|
||||
threadStopped.set(key, true)
|
||||
threadStopped.set(key, true),
|
||||
);
|
||||
|
||||
if (message.body.allThreadsContinued)
|
||||
threadStopped.forEach((_, key) =>
|
||||
threadStopped.set(key, false)
|
||||
threadStopped.set(key, false),
|
||||
);
|
||||
|
||||
updateThreads();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { FileEdit, IDE } from "core";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import type { FileEdit, IDE } from "core";
|
||||
import type { ConfigHandler } from "core/config/handler";
|
||||
import * as vscode from "vscode";
|
||||
import { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import type { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import { getTheme } from "./util/getTheme";
|
||||
import { getExtensionUri, getNonce, getUniqueId } from "./util/vscode";
|
||||
import { VsCodeWebviewProtocol } from "./webviewProtocol";
|
||||
|
|
@ -34,10 +34,10 @@ export class ContinueGUIWebviewViewProvider
|
|||
}
|
||||
|
||||
public resetWebviewProtocolWebview(): void {
|
||||
if (this._webview) {
|
||||
if (this._webview) {
|
||||
this.webviewProtocol.webview = this._webview;
|
||||
} else{
|
||||
console.warn("no webview found during reset")
|
||||
} else {
|
||||
console.warn("no webview found during reset");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -70,12 +70,12 @@ export class ContinueGUIWebviewViewProvider
|
|||
verticalDiffManager: VerticalPerLineDiffManager,
|
||||
page: string | undefined = undefined,
|
||||
edits: FileEdit[] | undefined = undefined,
|
||||
isFullScreen: boolean = false,
|
||||
isFullScreen = false,
|
||||
): string {
|
||||
let extensionUri = getExtensionUri();
|
||||
const extensionUri = getExtensionUri();
|
||||
let scriptUri: string;
|
||||
let styleMainUri: string;
|
||||
let vscMediaUrl: string = panel.webview
|
||||
const vscMediaUrl: string = panel.webview
|
||||
.asWebviewUri(vscode.Uri.joinPath(extensionUri, "gui"))
|
||||
.toString();
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export function showAnswerInTextEditor(
|
|||
vscode.TextEditorRevealType.InCenter,
|
||||
);
|
||||
|
||||
let decorationType = vscode.window.createTextEditorDecorationType({
|
||||
const decorationType = vscode.window.createTextEditorDecorationType({
|
||||
after: {
|
||||
contentText: answer + "\n",
|
||||
color: "rgb(0, 255, 0, 0.8)",
|
||||
|
|
@ -112,7 +112,7 @@ class DecorationManager {
|
|||
}
|
||||
|
||||
deleteDecoration(key: DecorationKey) {
|
||||
let decorationTypes = this.editorToDecorations.get(key.editorUri);
|
||||
const decorationTypes = this.editorToDecorations.get(key.editorUri);
|
||||
if (!decorationTypes) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -128,12 +128,12 @@ class DecorationManager {
|
|||
}
|
||||
|
||||
deleteAllDecorations(editorUri: string) {
|
||||
let decorationTypes = this.editorToDecorations.get(editorUri)?.keys();
|
||||
const decorationTypes = this.editorToDecorations.get(editorUri)?.keys();
|
||||
if (!decorationTypes) {
|
||||
return;
|
||||
}
|
||||
this.editorToDecorations.delete(editorUri);
|
||||
for (let decorationType of decorationTypes) {
|
||||
for (const decorationType of decorationTypes) {
|
||||
this.rerenderDecorations(editorUri, decorationType);
|
||||
}
|
||||
}
|
||||
|
|
@ -198,7 +198,7 @@ export function showLintMessage(
|
|||
export function highlightCode(
|
||||
editor: vscode.TextEditor,
|
||||
range: vscode.Range,
|
||||
removeOnClick: boolean = true,
|
||||
removeOnClick = true,
|
||||
): DecorationKey {
|
||||
const decorationType = vscode.window.createTextEditorDecorationType({
|
||||
backgroundColor: "rgb(255, 255, 0, 0.1)",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { devDataPath } from "core/util/paths";
|
||||
import * as fs from "fs";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import { devDataPath } from "core/util/paths";
|
||||
import * as vscode from "vscode";
|
||||
import { getMetaKeyLabel, getPlatform } from "../util/util";
|
||||
import { uriFromFilePath } from "../util/vscode";
|
||||
import { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
import type { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
|
||||
interface DiffInfo {
|
||||
originalFilepath: string;
|
||||
|
|
@ -67,7 +67,7 @@ export class DiffManager {
|
|||
return filepath.replace(/\//g, "_f_").replace(/\\/g, "_b_");
|
||||
}
|
||||
|
||||
private remoteTmpDir: string = "/tmp/continue";
|
||||
private remoteTmpDir = "/tmp/continue";
|
||||
private getNewFilepath(originalFilepath: string): string {
|
||||
if (vscode.env.remoteName) {
|
||||
// If we're in a remote, use the remote's temp directory
|
||||
|
|
@ -199,7 +199,7 @@ export class DiffManager {
|
|||
return newFilepath;
|
||||
}
|
||||
|
||||
cleanUpDiff(diffInfo: DiffInfo, hideEditor: boolean = true) {
|
||||
cleanUpDiff(diffInfo: DiffInfo, hideEditor = true) {
|
||||
// Close the editor, remove the record, delete the file
|
||||
if (hideEditor && diffInfo.editor) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ async function* streamVerticalPerLineDiff(
|
|||
newLine: line,
|
||||
};
|
||||
|
||||
let nextLine = remainingLines.shift();
|
||||
const nextLine = remainingLines.shift();
|
||||
nextLine && accumulatedDeletedLines.push();
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ async function* streamDiffEvents(
|
|||
completionStream: AsyncGenerator<string>,
|
||||
oldCode: string,
|
||||
): AsyncGenerator<DiffEvent> {
|
||||
let remainingLines = oldCode.split("\n");
|
||||
const remainingLines = oldCode.split("\n");
|
||||
let i = 0;
|
||||
let oldLine = remainingLines.shift();
|
||||
let newLine = "";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { DiffLine } from "core";
|
||||
import type { DiffLine } from "core";
|
||||
import * as vscode from "vscode";
|
||||
import {
|
||||
DecorationTypeRangeManager,
|
||||
|
|
@ -7,14 +7,14 @@ import {
|
|||
indexDecorationType,
|
||||
redDecorationType,
|
||||
} from "./decorations";
|
||||
import { VerticalDiffCodeLens } from "./manager";
|
||||
import type { VerticalDiffCodeLens } from "./manager";
|
||||
|
||||
export class VerticalPerLineDiffHandler {
|
||||
private editor: vscode.TextEditor;
|
||||
private startLine: number;
|
||||
private endLine: number;
|
||||
private currentLineIndex: number;
|
||||
private cancelled: boolean = false;
|
||||
private cancelled = false;
|
||||
|
||||
public get range(): vscode.Range {
|
||||
const startLine = Math.min(this.startLine, this.endLine);
|
||||
|
|
@ -22,7 +22,7 @@ export class VerticalPerLineDiffHandler {
|
|||
return new vscode.Range(startLine, 0, endLine, Number.MAX_SAFE_INTEGER);
|
||||
}
|
||||
|
||||
private newLinesAdded: number = 0;
|
||||
private newLinesAdded = 0;
|
||||
|
||||
public input?: string;
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ export class VerticalPerLineDiffHandler {
|
|||
this.newLinesAdded++;
|
||||
}
|
||||
|
||||
private async deleteLinesAt(index: number, numLines: number = 1) {
|
||||
private async deleteLinesAt(index: number, numLines = 1) {
|
||||
const startLine = new vscode.Position(index, 0);
|
||||
await this.editor.edit(
|
||||
(editBuilder) => {
|
||||
|
|
@ -305,7 +305,7 @@ export class VerticalPerLineDiffHandler {
|
|||
// As an indicator of loading
|
||||
this.updateIndexLineDecorations();
|
||||
|
||||
for await (let diffLine of diffLineGenerator) {
|
||||
for await (const diffLine of diffLineGenerator) {
|
||||
if (this.isCancelled) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ConfigHandler } from "core/config/handler";
|
||||
import type { ConfigHandler } from "core/config/handler";
|
||||
import { pruneLinesFromBottom, pruneLinesFromTop } from "core/llm/countTokens";
|
||||
import { getMarkdownLanguageTagForFile } from "core/util";
|
||||
import { streamDiffLines } from "core/util/verticalEdit";
|
||||
|
|
@ -114,7 +114,7 @@ export class VerticalPerLineDiffManager {
|
|||
index = 0;
|
||||
}
|
||||
|
||||
let blocks = this.filepathToCodeLens.get(filepath);
|
||||
const blocks = this.filepathToCodeLens.get(filepath);
|
||||
const block = blocks?.[index];
|
||||
if (!blocks || !block) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ConfigHandler } from "core/config/handler";
|
||||
import { CodebaseIndexer, PauseToken } from "core/indexing/indexCodebase";
|
||||
import { IdeSettings } from "core/protocol";
|
||||
import type { IdeSettings } from "core/protocol";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import { ContinueCompletionProvider } from "../autocomplete/completionProvider";
|
||||
|
|
@ -15,7 +15,7 @@ import { registerAllCodeLensProviders } from "../lang-server/codeLens";
|
|||
import { setupRemoteConfigSync } from "../stubs/activation";
|
||||
import { getUserToken } from "../stubs/auth";
|
||||
import { TabAutocompleteModel } from "../util/loadAutocompleteModel";
|
||||
import { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
import type { VsCodeWebviewProtocol } from "../webviewProtocol";
|
||||
|
||||
export class VsCodeExtension {
|
||||
// Currently some of these are public so they can be used in testing (test/test-suites)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import * as child_process from "child_process";
|
||||
import { exec } from "child_process";
|
||||
import {
|
||||
import * as path from "path";
|
||||
import type {
|
||||
ContinueRcJson,
|
||||
IDE,
|
||||
IdeInfo,
|
||||
|
|
@ -10,9 +11,8 @@ import {
|
|||
Thread,
|
||||
} from "core";
|
||||
import { getContinueGlobalPath } from "core/util/paths";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { DiffManager } from "./diff/horizontal";
|
||||
import type { DiffManager } from "./diff/horizontal";
|
||||
import { VsCodeIdeUtils } from "./util/ideUtils";
|
||||
import { traverseDirectory } from "./util/traverseDirectory";
|
||||
import {
|
||||
|
|
@ -88,7 +88,7 @@ class VsCodeIde implements IDE {
|
|||
const pathToLastModified: { [path: string]: number } = {};
|
||||
await Promise.all(
|
||||
files.map(async (file) => {
|
||||
let stat = await vscode.workspace.fs.stat(uriFromFilePath(file));
|
||||
const stat = await vscode.workspace.fs.stat(uriFromFilePath(file));
|
||||
pathToLastModified[file] = stat.mtime;
|
||||
}),
|
||||
);
|
||||
|
|
@ -300,8 +300,8 @@ class VsCodeIde implements IDE {
|
|||
}
|
||||
|
||||
async getSearchResults(query: string): Promise<string> {
|
||||
let results = [];
|
||||
for (let dir of await this.getWorkspaceDirs()) {
|
||||
const results = [];
|
||||
for (const dir of await this.getWorkspaceDirs()) {
|
||||
results.push(await this._searchDir(query, dir));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { DIFF_DIRECTORY, DiffManager } from "../diff/horizontal";
|
||||
import { VerticalDiffCodeLens } from "../diff/verticalPerLine/manager";
|
||||
import { DIFF_DIRECTORY, type DiffManager } from "../diff/horizontal";
|
||||
import type { VerticalDiffCodeLens } from "../diff/verticalPerLine/manager";
|
||||
import { editorSuggestionsLocked, editorToSuggestions } from "../suggestions";
|
||||
import { getAltOrOption, getMetaKeyLabel } from "../util/util";
|
||||
import { getExtensionUri } from "../util/vscode";
|
||||
|
|
@ -188,7 +188,9 @@ class ConfigPyCodeLensProvider implements vscode.CodeLensProvider {
|
|||
}
|
||||
|
||||
const lines = document.getText().split(os.EOL);
|
||||
let lineOfModels = lines.findIndex((line) => line.includes('"models": ['));
|
||||
const lineOfModels = lines.findIndex((line) =>
|
||||
line.includes('"models": ['),
|
||||
);
|
||||
|
||||
if (lineOfModels >= 0) {
|
||||
const range = new vscode.Range(lineOfModels, 0, lineOfModels + 1, 0);
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ function selectSuggestion(
|
|||
}
|
||||
if (idx === undefined) return;
|
||||
|
||||
let [suggestion] = suggestions.splice(idx, 1);
|
||||
const [suggestion] = suggestions.splice(idx, 1);
|
||||
|
||||
var rangeToDelete: vscode.Range;
|
||||
switch (accept) {
|
||||
|
|
@ -217,8 +217,8 @@ function selectSuggestion(
|
|||
});
|
||||
|
||||
// Shift the below suggestions up
|
||||
let linesToShift = rangeToDelete.end.line - rangeToDelete.start.line;
|
||||
for (let below of suggestions) {
|
||||
const linesToShift = rangeToDelete.end.line - rangeToDelete.start.line;
|
||||
for (const below of suggestions) {
|
||||
// Assumes there should be no crossover between suggestions. Might want to enforce this.
|
||||
if (
|
||||
below.oldRange.union(below.newRange).start.line >
|
||||
|
|
@ -302,15 +302,15 @@ export async function showSuggestion(
|
|||
if (success) {
|
||||
const suggestionLinesLength =
|
||||
suggestion === "" ? 0 : suggestion.split("\n").length;
|
||||
let suggestionRange = new vscode.Range(
|
||||
const suggestionRange = new vscode.Range(
|
||||
new vscode.Position(range.end.line, 0),
|
||||
new vscode.Position(range.end.line + suggestionLinesLength, 0),
|
||||
);
|
||||
let content = editor!.document.getText(suggestionRange);
|
||||
const content = editor!.document.getText(suggestionRange);
|
||||
|
||||
const filename = editor!.document.uri.toString();
|
||||
if (editorToSuggestions.has(filename)) {
|
||||
let suggestions = editorToSuggestions.get(filename)!;
|
||||
const suggestions = editorToSuggestions.get(filename)!;
|
||||
suggestions.push({
|
||||
oldRange: range,
|
||||
newRange: suggestionRange,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export class CapturedTerminal {
|
|||
private readonly ptyProcess: any;
|
||||
|
||||
private shellPrompt: string | undefined = undefined;
|
||||
private dataBuffer: string = "";
|
||||
private dataBuffer = "";
|
||||
|
||||
private onDataListeners: ((data: string) => void)[] = [];
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ export class CapturedTerminal {
|
|||
}
|
||||
|
||||
private commandQueue: [string, (output: string) => void][] = [];
|
||||
private hasRunCommand: boolean = false;
|
||||
private hasRunCommand = false;
|
||||
|
||||
private dataEndsInPrompt(strippedData: string): boolean {
|
||||
const lines = strippedData.split("\n");
|
||||
|
|
@ -128,7 +128,7 @@ export class CapturedTerminal {
|
|||
|
||||
private readonly writeEmitter: vscode.EventEmitter<string>;
|
||||
|
||||
private splitByCommandsBuffer: string = "";
|
||||
private splitByCommandsBuffer = "";
|
||||
private readonly onCommandOutput: ((output: string) => void) | undefined;
|
||||
|
||||
splitByCommandsListener(data: string) {
|
||||
|
|
@ -144,8 +144,8 @@ export class CapturedTerminal {
|
|||
}
|
||||
}
|
||||
|
||||
private runningClearToGetPrompt: boolean = false;
|
||||
private seenClear: boolean = false;
|
||||
private runningClearToGetPrompt = false;
|
||||
private seenClear = false;
|
||||
private commandPromptString: string | undefined = undefined;
|
||||
private resolveMeWhenCommandPromptStringFound:
|
||||
| ((_: unknown) => void)
|
||||
|
|
@ -240,7 +240,7 @@ export class CapturedTerminal {
|
|||
this.writeEmitter.fire(data);
|
||||
|
||||
this.splitByCommandsListener(data);
|
||||
for (let listener of this.onDataListeners) {
|
||||
for (const listener of this.onDataListeners) {
|
||||
listener(data);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import * as path from "path";
|
||||
import * as glob from "glob";
|
||||
import Mocha from "mocha";
|
||||
import * as path from "path";
|
||||
|
||||
export function run() {
|
||||
// Avoid timing out when stopping on breakpoints during debugging in VSCode
|
||||
const timeoutOption = process.env.MOCHA_TIMEOUT
|
||||
? parseInt(process.env.MOCHA_TIMEOUT)
|
||||
? Number.parseInt(process.env.MOCHA_TIMEOUT)
|
||||
: // : undefined;
|
||||
30_000;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { runTests } from "@vscode/test-electron";
|
||||
import * as path from "path";
|
||||
import { runTests } from "@vscode/test-electron";
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Chunk, IDE } from "core";
|
||||
import type { Chunk, IDE } from "core";
|
||||
import { DEFAULT_IGNORE_DIRS } from "core/indexing/ignore";
|
||||
import { deduplicateArray } from "core/util";
|
||||
import { getParserForFile } from "core/util/treeSitter";
|
||||
import { SyntaxNode } from "web-tree-sitter";
|
||||
import type { SyntaxNode } from "web-tree-sitter";
|
||||
import { getDefinitionsForNode } from "../autocomplete/lsp";
|
||||
|
||||
export async function expandSnippet(
|
||||
|
|
@ -20,8 +20,8 @@ export async function expandSnippet(
|
|||
const root: SyntaxNode = parser.parse(fullFileContents).rootNode;
|
||||
|
||||
// Find all nodes contained in the range
|
||||
let containedInRange: SyntaxNode[] = [];
|
||||
let toExplore: SyntaxNode[] = [root];
|
||||
const containedInRange: SyntaxNode[] = [];
|
||||
const toExplore: SyntaxNode[] = [root];
|
||||
while (toExplore.length > 0) {
|
||||
const node = toExplore.pop()!;
|
||||
for (const child of node.namedChildren) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import mergeJson from "core/util/merge";
|
||||
import * as fs from "fs";
|
||||
import { convertTheme } from "monaco-vscode-textmate-theme-converter/lib/cjs";
|
||||
import * as path from "path";
|
||||
import mergeJson from "core/util/merge";
|
||||
import { convertTheme } from "monaco-vscode-textmate-theme-converter/lib/cjs";
|
||||
import * as vscode from "vscode";
|
||||
import { getExtensionUri } from "./vscode";
|
||||
|
||||
|
|
@ -84,8 +84,8 @@ export function getTheme() {
|
|||
["vs", "hc-black"].includes(converted.base)
|
||||
? converted.base
|
||||
: colorTheme.includes("Light")
|
||||
? "vs"
|
||||
: "vs-dark"
|
||||
? "vs"
|
||||
: "vs-dark"
|
||||
) as any;
|
||||
|
||||
return converted;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { FileEdit, RangeInFile, Thread } from "core";
|
||||
import { defaultIgnoreFile } from "core/indexing/ignore";
|
||||
import path from "path";
|
||||
import type { FileEdit, RangeInFile, Thread } from "core";
|
||||
import { defaultIgnoreFile } from "core/indexing/ignore";
|
||||
import * as vscode from "vscode";
|
||||
import { threadStopped } from "../debug/debug";
|
||||
import { VsCodeExtension } from "../extension/vscodeExtension";
|
||||
import {
|
||||
SuggestionRanges,
|
||||
type SuggestionRanges,
|
||||
acceptSuggestionCommand,
|
||||
editorSuggestionsLocked,
|
||||
rejectSuggestionCommand,
|
||||
|
|
@ -340,7 +340,7 @@ export class VsCodeIdeUtils {
|
|||
);
|
||||
}
|
||||
|
||||
async getTerminalContents(commands: number = -1): Promise<string> {
|
||||
async getTerminalContents(commands = -1): Promise<string> {
|
||||
const tempCopyBuffer = await vscode.env.clipboard.readText();
|
||||
if (commands < 0) {
|
||||
await vscode.commands.executeCommand(
|
||||
|
|
@ -388,7 +388,7 @@ export class VsCodeIdeUtils {
|
|||
return threadsResponse.threads;
|
||||
}
|
||||
|
||||
async getDebugLocals(threadIndex: number = 0): Promise<string> {
|
||||
async getDebugLocals(threadIndex = 0): Promise<string> {
|
||||
const session = vscode.debug.activeDebugSession;
|
||||
|
||||
if (!session) {
|
||||
|
|
@ -428,7 +428,7 @@ export class VsCodeIdeUtils {
|
|||
|
||||
async getTopLevelCallStackSources(
|
||||
threadIndex: number,
|
||||
stackDepth: number = 3,
|
||||
stackDepth = 3,
|
||||
): Promise<string[]> {
|
||||
const session = vscode.debug.activeDebugSession;
|
||||
if (!session) return [];
|
||||
|
|
@ -513,7 +513,7 @@ export class VsCodeIdeUtils {
|
|||
}
|
||||
}
|
||||
|
||||
private _repoWasNone: boolean = false;
|
||||
private _repoWasNone = false;
|
||||
async getRepo(forDirectory: vscode.Uri): Promise<any | undefined> {
|
||||
let repo = await this._getRepo(forDirectory);
|
||||
|
||||
|
|
@ -538,7 +538,7 @@ export class VsCodeIdeUtils {
|
|||
}
|
||||
|
||||
async getBranch(forDirectory: vscode.Uri) {
|
||||
let repo = await this.getRepo(forDirectory);
|
||||
const repo = await this.getRepo(forDirectory);
|
||||
if (repo?.state?.HEAD?.name === undefined) {
|
||||
try {
|
||||
const { stdout } = await asyncExec("git rev-parse --abbrev-ref HEAD", {
|
||||
|
|
@ -554,7 +554,7 @@ export class VsCodeIdeUtils {
|
|||
}
|
||||
|
||||
async getDiff(): Promise<string> {
|
||||
let diffs = [];
|
||||
const diffs = [];
|
||||
|
||||
for (const dir of this.getWorkspaceDirectories()) {
|
||||
const repo = await this.getRepo(vscode.Uri.file(dir));
|
||||
|
|
@ -570,7 +570,7 @@ export class VsCodeIdeUtils {
|
|||
|
||||
getHighlightedCode(): RangeInFile[] {
|
||||
// TODO
|
||||
let rangeInFiles: RangeInFile[] = [];
|
||||
const rangeInFiles: RangeInFile[] = [];
|
||||
vscode.window.visibleTextEditors
|
||||
.filter((editor) => this.documentIsCode(editor.document))
|
||||
.forEach((editor) => {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import { ILLM } from "core";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import type { ILLM } from "core";
|
||||
import type { ConfigHandler } from "core/config/handler";
|
||||
import Ollama from "core/llm/llms/Ollama";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
export class TabAutocompleteModel {
|
||||
private _llm: ILLM | undefined;
|
||||
private defaultTag: string = "starcoder2:3b";
|
||||
private defaultTagName: string = "Starcoder2 3b";
|
||||
private defaultTag = "starcoder2:3b";
|
||||
private defaultTagName = "Starcoder2 3b";
|
||||
|
||||
private shownOllamaWarning: boolean = false;
|
||||
private shownDeepseekWarning: boolean = false;
|
||||
private shownOllamaWarning = false;
|
||||
private shownDeepseekWarning = false;
|
||||
|
||||
private configHandler: ConfigHandler;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import * as path from "path";
|
||||
import { defaultIgnoreDir, defaultIgnoreFile } from "core/indexing/ignore";
|
||||
import ignore from "ignore";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import { uriFromFilePath } from "./vscode";
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ function splitGlob(glob: string): [string | undefined, string, boolean] {
|
|||
export async function* traverseDirectory(
|
||||
directory: string,
|
||||
gitIgnorePatterns: string[],
|
||||
returnFiles: boolean = true,
|
||||
returnFiles = true,
|
||||
onlyThisDirectory: string[] | undefined,
|
||||
): AsyncGenerator<string> {
|
||||
const nodes = await vscode.workspace.fs.readDirectory(
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export function convertSingleToDoubleQuoteJSON(json: string): string {
|
|||
|
||||
export function debounced(delay: number, fn: Function) {
|
||||
let timerId: NodeJS.Timeout | null;
|
||||
return function (...args: any[]) {
|
||||
return (...args: any[]) => {
|
||||
if (timerId) {
|
||||
clearTimeout(timerId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { machineIdSync } from "node-machine-id";
|
||||
import * as path from "path";
|
||||
import { machineIdSync } from "node-machine-id";
|
||||
import * as vscode from "vscode";
|
||||
|
||||
export function translate(range: vscode.Range, lines: number): vscode.Range {
|
||||
|
|
@ -28,8 +28,8 @@ export function getExtensionUri(): vscode.Uri {
|
|||
export function getViewColumnOfFile(
|
||||
filepath: string,
|
||||
): vscode.ViewColumn | undefined {
|
||||
for (let tabGroup of vscode.window.tabGroups.all) {
|
||||
for (let tab of tabGroup.tabs) {
|
||||
for (const tabGroup of vscode.window.tabGroups.all) {
|
||||
for (const tab of tabGroup.tabs) {
|
||||
if (
|
||||
(tab?.input as any)?.uri &&
|
||||
(tab.input as any).uri.fsPath === filepath
|
||||
|
|
@ -44,7 +44,7 @@ export function getViewColumnOfFile(
|
|||
export function getRightViewColumn(): vscode.ViewColumn {
|
||||
// When you want to place in the rightmost panel if there is already more than one, otherwise use Beside
|
||||
let column = vscode.ViewColumn.Beside;
|
||||
let columnOrdering = [
|
||||
const columnOrdering = [
|
||||
vscode.ViewColumn.One,
|
||||
vscode.ViewColumn.Beside,
|
||||
vscode.ViewColumn.Two,
|
||||
|
|
@ -56,7 +56,7 @@ export function getRightViewColumn(): vscode.ViewColumn {
|
|||
vscode.ViewColumn.Eight,
|
||||
vscode.ViewColumn.Nine,
|
||||
];
|
||||
for (let tabGroup of vscode.window.tabGroups.all) {
|
||||
for (const tabGroup of vscode.window.tabGroups.all) {
|
||||
if (
|
||||
columnOrdering.indexOf(tabGroup.viewColumn) >
|
||||
columnOrdering.indexOf(column)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import { ContextItemId, IDE } from "core";
|
||||
import { ConfigHandler } from "core/config/handler";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import type { ContextItemId, IDE } from "core";
|
||||
import type { ConfigHandler } from "core/config/handler";
|
||||
import {
|
||||
setupLocalMode,
|
||||
setupOptimizedExistingUserMode,
|
||||
|
|
@ -11,18 +13,16 @@ import TransformersJsEmbeddingsProvider from "core/indexing/embeddings/Transform
|
|||
import { logDevData } from "core/util/devdata";
|
||||
import { DevDataSqliteDb } from "core/util/devdataSqlite";
|
||||
import historyManager from "core/util/history";
|
||||
import { Message } from "core/util/messenger";
|
||||
import type { Message } from "core/util/messenger";
|
||||
import { editConfigJson, getConfigJsonPath } from "core/util/paths";
|
||||
import { Telemetry } from "core/util/posthog";
|
||||
import {
|
||||
import type {
|
||||
ReverseWebviewProtocol,
|
||||
WebviewProtocol,
|
||||
} from "core/web/webviewProtocol";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import * as vscode from "vscode";
|
||||
import { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import type { VerticalPerLineDiffManager } from "./diff/verticalPerLine/manager";
|
||||
import { getExtensionUri } from "./util/vscode";
|
||||
|
||||
async function showTutorial() {
|
||||
|
|
@ -158,11 +158,11 @@ export class VsCodeWebviewProtocol {
|
|||
return await vscode.workspace
|
||||
.openTextDocument(msg.data.filepath)
|
||||
.then((document) => {
|
||||
let start = new vscode.Position(0, 0);
|
||||
let end = new vscode.Position(5, 0);
|
||||
let range = new vscode.Range(start, end);
|
||||
const start = new vscode.Position(0, 0);
|
||||
const end = new vscode.Position(5, 0);
|
||||
const range = new vscode.Range(start, end);
|
||||
|
||||
let contents = document.getText(range);
|
||||
const contents = document.getText(range);
|
||||
return contents;
|
||||
});
|
||||
});
|
||||
|
|
@ -296,11 +296,11 @@ export class VsCodeWebviewProtocol {
|
|||
this.ide.openFile(getConfigJsonPath());
|
||||
|
||||
// Find the range where it was added and highlight
|
||||
let lines = newConfigString.split("\n");
|
||||
const lines = newConfigString.split("\n");
|
||||
let startLine;
|
||||
let endLine;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
let line = lines[i];
|
||||
const line = lines[i];
|
||||
|
||||
if (!startLine) {
|
||||
if (line.trim() === `"title": "${model.title}",`) {
|
||||
|
|
@ -576,8 +576,8 @@ export class VsCodeWebviewProtocol {
|
|||
mode === "local"
|
||||
? setupLocalMode
|
||||
: mode === "optimized"
|
||||
? setupOptimizedMode
|
||||
: setupOptimizedExistingUserMode,
|
||||
? setupOptimizedMode
|
||||
: setupOptimizedExistingUserMode,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,25 @@
|
|||
call-me-maybe "^1.0.1"
|
||||
js-yaml "^4.1.0"
|
||||
|
||||
"@biomejs/biome@1.6.4":
|
||||
version "1.6.4"
|
||||
resolved "https://registry.npmjs.org/@biomejs/biome/-/biome-1.6.4.tgz"
|
||||
integrity sha512-3groVd2oWsLC0ZU+XXgHSNbq31lUcOCBkCcA7sAQGBopHcmL+jmmdoWlY3S61zIh+f2mqQTQte1g6PZKb3JJjA==
|
||||
optionalDependencies:
|
||||
"@biomejs/cli-darwin-arm64" "1.6.4"
|
||||
"@biomejs/cli-darwin-x64" "1.6.4"
|
||||
"@biomejs/cli-linux-arm64" "1.6.4"
|
||||
"@biomejs/cli-linux-arm64-musl" "1.6.4"
|
||||
"@biomejs/cli-linux-x64" "1.6.4"
|
||||
"@biomejs/cli-linux-x64-musl" "1.6.4"
|
||||
"@biomejs/cli-win32-arm64" "1.6.4"
|
||||
"@biomejs/cli-win32-x64" "1.6.4"
|
||||
|
||||
"@biomejs/cli-darwin-arm64@1.6.4":
|
||||
version "1.6.4"
|
||||
resolved "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.6.4.tgz"
|
||||
integrity sha512-2WZef8byI9NRzGajGj5RTrroW9BxtfbP9etigW1QGAtwu/6+cLkdPOWRAs7uFtaxBNiKFYA8j/BxV5zeAo5QOQ==
|
||||
|
||||
"@electron/rebuild@^3.2.10":
|
||||
version "3.6.0"
|
||||
resolved "https://registry.npmjs.org/@electron/rebuild/-/rebuild-3.6.0.tgz"
|
||||
|
|
@ -188,11 +207,6 @@
|
|||
resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz"
|
||||
integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==
|
||||
|
||||
"@lancedb/vectordb-darwin-arm64@*":
|
||||
version "0.4.16"
|
||||
resolved "https://registry.npmjs.org/@lancedb/vectordb-darwin-arm64/-/vectordb-darwin-arm64-0.4.16.tgz"
|
||||
integrity sha512-RtuizzrZIVDYQ4ZZIMQRHGuV0DvOV93lyvivJJBLP1zCORMHEtEduaVbFE/+H0OCo0oqPsKXEpbc0nUEXKQqRg==
|
||||
|
||||
"@lancedb/vectordb-darwin-arm64@0.4.12":
|
||||
version "0.4.12"
|
||||
resolved "https://registry.npmjs.org/@lancedb/vectordb-darwin-arm64/-/vectordb-darwin-arm64-0.4.12.tgz"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue