Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ export class AutocompleteCodeActionProvider implements vscode.CodeActionProvider
quickfix: vscode.CodeActionKind.QuickFix,
}

private _enabled = false

public set enabled(value: boolean) {
this._enabled = value
}

public provideCodeActions(
document: vscode.TextDocument,
range: vscode.Range | vscode.Selection,
_context: vscode.CodeActionContext,
_token: vscode.CancellationToken,
): vscode.ProviderResult<(vscode.CodeAction | vscode.Command)[]> {
if (!this._enabled) return []

const action = new vscode.CodeAction(
t("kilocode:autocomplete.codeAction.title"),
this.providedCodeActionKinds["quickfix"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class AutocompleteServiceManager {
public async load() {
this.settings = readSettings()

this.codeActionProvider.enabled = this.settings?.enableSmartInlineTaskKeybinding ?? false
if (this.settings.model) {
this.model.setModel(this.settings.model)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@ export function applyFirstLineOnly(
*/
export const INLINE_COMPLETION_ACCEPTED_COMMAND = "kilocode.autocomplete.inline-completion.accepted"

export function countLines(text: string): number {
return _countLines(text)
}

export function shouldShowOnlyFirstLine(prefix: string, suggestion: string): boolean {
return _shouldShowOnlyFirstLine(prefix, suggestion)
}

export function getFirstLine(text: string): string {
return _getFirstLine(text)
}

export function stringToInlineCompletions(text: string, position: vscode.Position): vscode.InlineCompletionItem[] {
if (text === "") {
return []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class KiloCodeActionProvider implements vscode.CodeActionProvider {
if (hasDiagnostics) {
const fix = new vscode.CodeAction("Fix with Kilo Code", vscode.CodeActionKind.QuickFix)
fix.command = { command: "kilo-code.new.fixCode", title: "Fix with Kilo Code" }
fix.isPreferred = true
actions.push(fix)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/kilo-vscode/tests/unit/code-action-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ describe("KiloCodeActionProvider", () => {
expect(result).toHaveLength(2)
})

it("Fix action is preferred", () => {
it("Fix action is not preferred so it does not hijack auto-fix", () => {
const result = provider.provideCodeActions({} as never, makeRange(false) as never, makeContext(1) as never)
const fix = result.find((a) => a.title === "Fix with Kilo Code")
expect(fix?.isPreferred).toBe(true)
expect(fix?.isPreferred).toBeFalsy()
})

it("Fix action uses QuickFix kind", () => {
Expand Down
8 changes: 7 additions & 1 deletion packages/opencode/test/mcp/oauth-browser.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect, mock, beforeEach } from "bun:test"
import { test, expect, mock, beforeEach, afterEach } from "bun:test" // kilocode_change
import { EventEmitter } from "events"
import { Effect } from "effect"
import type { MCP as MCPNS } from "../../src/mcp/index"
Expand Down Expand Up @@ -108,6 +108,12 @@ beforeEach(() => {
transportCalls.length = 0
})

// kilocode_change start
afterEach(async () => {
await Instance.disposeAll()
})
// kilocode_change end

// Import modules after mocking
const { MCP } = await import("../../src/mcp/index")
const { AppRuntime } = await import("../../src/effect/app-runtime")
Expand Down
4 changes: 3 additions & 1 deletion packages/opencode/test/session/prompt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,8 @@ unixSkip(
)
// kilocode_change end

unix(
// kilocode_change start - TODO(#8990): flaky on Linux CI
unixSkip(
"cancel finalizes interrupted bash tool output through normal truncation",
() =>
provideTmpdirServer(
Expand Down Expand Up @@ -1552,6 +1553,7 @@ unix(
),
30_000,
)
// kilocode_change end

// kilocode_change start - TODO(#8990): flaky on Linux CI
unixSkip(
Expand Down
Loading