Skip to content

Commit 2bf8eac

Browse files
authored
Merge pull request #3469 from Kilo-Org/christiaan/autoformat
Autoformat
2 parents 628715f + 24467d2 commit 2bf8eac

File tree

9 files changed

+182
-192
lines changed

9 files changed

+182
-192
lines changed

apps/kilocode-docs/docs/cli.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,3 @@ Use `/teams select` and start typing the team name to switch teams.
258258

259259
The process is the same when switching into a Team or Enterprise organization.
260260
The process is the same when switching into a Team or Enterprise organization.
261-
262-
263-

apps/kilocode-docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/features/api-configuration-profiles.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ API 配置配置文件允许您创建和切换不同的 AI 设置集。每个配
3636

3737
- 选择您的 API 提供商
3838

39-
<img src="/docs/img/api-configuration-profiles/api-configuration-profiles-2.png" alt="提供商选择下拉菜单" width="550" />
39+
<img src="/docs/img/api-configuration-profiles/api-configuration-profiles-2.png" alt="提供商选择下拉菜单" width="550" />
4040

4141
- 输入 API 密钥
4242

43-
<img src="/docs/img/api-configuration-profiles/api-configuration-profiles-3.png" alt="API 密钥输入字段" width="550" />
43+
<img src="/docs/img/api-configuration-profiles/api-configuration-profiles-3.png" alt="API 密钥输入字段" width="550" />
4444

4545
- 选择模型
4646

47-
<img src="/docs/img/api-configuration-profiles/api-configuration-profiles-8.png" alt="模型选择界面" width="550" />
47+
<img src="/docs/img/api-configuration-profiles/api-configuration-profiles-8.png" alt="模型选择界面" width="550" />
4848

4949
- 调整模型参数
5050

51-
<img src="/docs/img/api-configuration-profiles/api-configuration-profiles-5.png" alt="模型参数调整控件" width="550" />
51+
<img src="/docs/img/api-configuration-profiles/api-configuration-profiles-5.png" alt="模型参数调整控件" width="550" />
5252

5353
### 切换配置文件
5454

apps/kilocode-docs/i18n/zh-CN/docusaurus-plugin-content-docs/current/getting-started/connecting-api-provider.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Kilo Code 需要 AI 模型提供商的 API 密钥才能运行。
1313
- **Anthropic:** 直接访问 Claude 模型。需要 API 访问批准,并且可能[根据您的层级有速率限制](https://docs.anthropic.com/en/api/rate-limits#requirements-to-advance-tier)。有关详细信息,请参阅 [Anthropic 的定价页面](https://www.anthropic.com/pricing#anthropic-api)
1414

1515
## 使用 Kilo Code 提供商
16+
1617
默认情况下,当您安装 Kilo Code 扩展时,系统会提示您在 [Kilo Code 提供商](/providers/kilocode)中登录或创建帐户。
1718

1819
这将引导您完成帐户设置并*自动*正确配置 Kilo Code 以帮助您入门。如果您更喜欢使用其他提供商,则需要按照以下说明手动获取您的 API 密钥。
@@ -36,7 +37,7 @@ LLM路由器让您可以通过一个API密钥访问多个AI模型,简化了成
3637

3738
<img src="/docs/img/connecting-api-provider/connecting-api-provider-4.png" alt="OpenRouter API密钥页面" width="600" />
3839

39-
*OpenRouter仪表板,带有"创建密钥"按钮。命名您的密钥并在创建后复制它。*
40+
_OpenRouter仪表板,带有"创建密钥"按钮。命名您的密钥并在创建后复制它。_
4041

4142
##### Requesty
4243

@@ -47,7 +48,7 @@ LLM路由器让您可以通过一个API密钥访问多个AI模型,简化了成
4748

4849
<img src="/docs/img/connecting-api-provider/connecting-api-provider-7.png" alt="Requesty API管理页面" width="600" />
4950

50-
*Requesty API管理页面,带有"创建API密钥"按钮。立即复制您的密钥 - 它只会显示一次。*
51+
_Requesty API管理页面,带有"创建API密钥"按钮。立即复制您的密钥 - 它只会显示一次。_
5152

5253
#### 选项2:直接提供商
5354

@@ -62,7 +63,7 @@ LLM路由器让您可以通过一个API密钥访问多个AI模型,简化了成
6263

6364
<img src="/docs/img/connecting-api-provider/connecting-api-provider-5.png" alt="Anthropic控制台API密钥部分" width="600" />
6465

65-
*Anthropic控制台API密钥部分,带有"创建密钥"按钮。命名您的密钥,设置过期时间,并立即复制它。*
66+
_Anthropic控制台API密钥部分,带有"创建密钥"按钮。命名您的密钥,设置过期时间,并立即复制它。_
6667

6768
##### OpenAI
6869

@@ -73,7 +74,7 @@ LLM路由器让您可以通过一个API密钥访问多个AI模型,简化了成
7374

7475
<img src="/docs/img/connecting-api-provider/connecting-api-provider-6.png" alt="OpenAI API密钥页面" width="600" />
7576

76-
*OpenAI平台,带有"创建新密钥"按钮。命名您的密钥并在创建后立即复制它。*
77+
_OpenAI平台,带有"创建新密钥"按钮。命名您的密钥并在创建后立即复制它。_
7778

7879
### 在VS Code中配置Kilo Code
7980

@@ -85,4 +86,4 @@ LLM路由器让您可以通过一个API密钥访问多个AI模型,简化了成
8586
4. 选择您的模型:
8687
- 对于**OpenRouter**:选择`anthropic/claude-3.7-sonnet` ([模型详情](https://openrouter.ai/anthropic/claude-3.7-sonnet))
8788
- 对于**Anthropic**:选择`claude-3-7-sonnet-20250219` ([模型详情](https://www.anthropic.com/pricing#anthropic-api))
88-
5. 点击"Let's go!"保存设置并开始使用Kilo Code
89+
5. 点击"Let's go!"保存设置并开始使用Kilo Code

cli/src/services/logs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class LogsService {
7878
stack: error.stack,
7979
// Include any additional enumerable properties
8080
...Object.getOwnPropertyNames(error)
81-
.filter(key => key !== "message" && key !== "name" && key !== "stack")
81+
.filter((key) => key !== "message" && key !== "name" && key !== "stack")
8282
.reduce(
8383
(acc, key) => {
8484
acc[key] = (error as any)[key]

src/__mocks__/vscode.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Mock VSCode API for Vitest tests
22
const mockEventEmitter = () => ({
3-
event: () => () => { },
4-
fire: () => { },
5-
dispose: () => { },
3+
event: () => () => {},
4+
fire: () => {},
5+
dispose: () => {},
66
})
77

88
const mockDisposable = {
9-
dispose: () => { },
9+
dispose: () => {},
1010
}
1111

1212
const mockUri = {
@@ -47,7 +47,7 @@ export const workspace = {
4747
onDidCreate: () => mockDisposable,
4848
onDidChange: () => mockDisposable,
4949
onDidDelete: () => mockDisposable,
50-
dispose: () => { },
50+
dispose: () => {},
5151
}),
5252
fs: {
5353
readFile: () => Promise.resolve(new Uint8Array()),
@@ -68,25 +68,25 @@ export const window = {
6868
showWarningMessage: () => Promise.resolve(),
6969
showInformationMessage: () => Promise.resolve(),
7070
createOutputChannel: () => ({
71-
appendLine: () => { },
72-
append: () => { },
73-
clear: () => { },
74-
show: () => { },
75-
dispose: () => { },
71+
appendLine: () => {},
72+
append: () => {},
73+
clear: () => {},
74+
show: () => {},
75+
dispose: () => {},
7676
}),
7777
createTerminal: () => ({
7878
exitStatus: undefined,
7979
name: "Roo Code",
8080
processId: Promise.resolve(123),
8181
creationOptions: {},
8282
state: { isInteractedWith: true },
83-
dispose: () => { },
84-
hide: () => { },
85-
show: () => { },
86-
sendText: () => { },
83+
dispose: () => {},
84+
hide: () => {},
85+
show: () => {},
86+
sendText: () => {},
8787
}),
8888
onDidCloseTerminal: () => mockDisposable,
89-
createTextEditorDecorationType: () => ({ dispose: () => { } }),
89+
createTextEditorDecorationType: () => ({ dispose: () => {} }),
9090
}
9191

9292
export const commands = {
@@ -96,10 +96,10 @@ export const commands = {
9696

9797
export const languages = {
9898
createDiagnosticCollection: () => ({
99-
set: () => { },
100-
delete: () => { },
101-
clear: () => { },
102-
dispose: () => { },
99+
set: () => {},
100+
delete: () => {},
101+
clear: () => {},
102+
dispose: () => {},
103103
}),
104104
}
105105

src/core/task/Task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3146,11 +3146,11 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
31463146
// stream.
31473147
yield* iterator
31483148

3149-
// kilocode_change start
3149+
// kilocode_change start
31503150
if (apiConfiguration?.rateLimitAfter) {
31513151
Task.lastGlobalApiRequestTime = performance.now()
31523152
}
3153-
// kilocode_change end
3153+
// kilocode_change end
31543154
}
31553155

31563156
// Checkpoints

src/services/continuedev/core/nextEdit/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
- Users can decide to switch between autocomplete and next edit.
1010
- Next edit triggers at the same time autocomplete is triggered, via vscode's inline completion provider.
1111
- The following happens after the trigger:
12-
- User's current cursor position is captured.
13-
- We define an editable range, ±5 lines from the current cursor position.
14-
- User's most recent edit is captured as a unified diff. (this is currently buggy)
15-
- This is sent to the model, which returns a new editable range with next edit predictions.
16-
- We display this new editable range in a SVG decoration.
17-
- User can either tab to accept or esc to reject.
18-
- On accept, the old editable range will be replaced by the new editable region. The cursor will be moved to the last line containing some change.
19-
- On reject, nothing happens.
12+
- User's current cursor position is captured.
13+
- We define an editable range, ±5 lines from the current cursor position.
14+
- User's most recent edit is captured as a unified diff. (this is currently buggy)
15+
- This is sent to the model, which returns a new editable range with next edit predictions.
16+
- We display this new editable range in a SVG decoration.
17+
- User can either tab to accept or esc to reject.
18+
- On accept, the old editable range will be replaced by the new editable region. The cursor will be moved to the last line containing some change.
19+
- On reject, nothing happens.
2020

2121
## What needs to be worked on?
2222

2323
- User edit captures.
2424
- Find a better way to trigger next edit (this links back to the diff capture problem).
25-
- We can see that next edit triggers as soon as the user accepts a change. This is because autocomplete runs the same way.
26-
- I think autocomplete has some filter logic that doesn't display the ghost text under some conditions, which I am guessing are the following:
27-
- The model does not have any more completions to create.
28-
- The prediction at the cursor location has been cached.
25+
- We can see that next edit triggers as soon as the user accepts a change. This is because autocomplete runs the same way.
26+
- I think autocomplete has some filter logic that doesn't display the ghost text under some conditions, which I am guessing are the following:
27+
- The model does not have any more completions to create.
28+
- The prediction at the cursor location has been cached.
2929
- JetBrains integration.
Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
function getIconFromLevel(level: string): string {
2-
switch (level) {
3-
case 'debug':
4-
return '🔵';
5-
case 'info':
6-
return '🟢';
7-
case 'warn':
8-
return '🟡';
9-
case 'error':
10-
return '🔴';
11-
}
12-
return 'X'
2+
switch (level) {
3+
case "debug":
4+
return "🔵"
5+
case "info":
6+
return "🟢"
7+
case "warn":
8+
return "🟡"
9+
case "error":
10+
return "🔴"
11+
}
12+
return "X"
1313
}
1414

1515
export class Logger {
16-
constructor(private filename: string, private includeFilename = false) {}
17-
#formatMessage(level: string, message: string): string {
18-
return `${getIconFromLevel(level)} ${this.includeFilename ? `[${this.filename}] ` : ''}${message}`;
19-
}
20-
debug(message: string, ...args: any[]) {
21-
console.debug(this.#formatMessage('debug', message), ...args);
22-
}
23-
info(message: string, ...args: any[]) {
24-
console.info(this.#formatMessage('info', message), ...args);
25-
}
26-
warn(message: string, ...args: any[]) {
27-
console.info(this.#formatMessage('warn', message), ...args);
28-
}
29-
error(message: string, ...args: any[]) {
30-
console.info(this.#formatMessage('error', message), ...args);
31-
}
16+
constructor(
17+
private filename: string,
18+
private includeFilename = false,
19+
) {}
20+
#formatMessage(level: string, message: string): string {
21+
return `${getIconFromLevel(level)} ${this.includeFilename ? `[${this.filename}] ` : ""}${message}`
22+
}
23+
debug(message: string, ...args: any[]) {
24+
console.debug(this.#formatMessage("debug", message), ...args)
25+
}
26+
info(message: string, ...args: any[]) {
27+
console.info(this.#formatMessage("info", message), ...args)
28+
}
29+
warn(message: string, ...args: any[]) {
30+
console.info(this.#formatMessage("warn", message), ...args)
31+
}
32+
error(message: string, ...args: any[]) {
33+
console.info(this.#formatMessage("error", message), ...args)
34+
}
3235
}

0 commit comments

Comments
 (0)