Skip to content

Commit a414c7d

Browse files
Wrangle our settings-related types and add support for settings import / export (#1997)
* Strongly type our settings use composition where possible * Update src/core/contextProxy.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Update src/core/contextProxy.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Add comment, tweak function name * Add changeset * Clean up toolGroup types * Comments tweak * Remove unused type * More type safety * Improve import / export, add translations --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
1 parent 55bbe88 commit a414c7d

Some content is hidden

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

64 files changed

+2668
-1532
lines changed

.changeset/lucky-hairs-join.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Wrangle our settings-related types and add support for settings import / export

src/core/Cline.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ export class Cline extends EventEmitter<ClineEvents> {
994994
}
995995
}
996996

997-
const { terminalOutputLineLimit } = (await this.providerRef.deref()?.getState()) ?? {}
997+
const { terminalOutputLineLimit = 500 } = (await this.providerRef.deref()?.getState()) ?? {}
998998

999999
process.on("line", (line) => {
10001000
if (!didContinue) {
@@ -2339,7 +2339,7 @@ export class Cline extends EventEmitter<ClineEvents> {
23392339
}
23402340

23412341
// Get the maxReadFileLine setting
2342-
const { maxReadFileLine } = (await this.providerRef.deref()?.getState()) ?? {}
2342+
const { maxReadFileLine = 500 } = (await this.providerRef.deref()?.getState()) ?? {}
23432343

23442344
// Count total lines in the file
23452345
let totalLines = 0
@@ -2480,13 +2480,14 @@ export class Cline extends EventEmitter<ClineEvents> {
24802480
this.consecutiveMistakeCount = 0
24812481
const absolutePath = path.resolve(this.cwd, relDirPath)
24822482
const [files, didHitLimit] = await listFiles(absolutePath, recursive, 200)
2483-
const { showRooIgnoredFiles } = (await this.providerRef.deref()?.getState()) ?? {}
2483+
const { showRooIgnoredFiles = true } =
2484+
(await this.providerRef.deref()?.getState()) ?? {}
24842485
const result = formatResponse.formatFilesList(
24852486
absolutePath,
24862487
files,
24872488
didHitLimit,
24882489
this.rooIgnoreController,
2489-
showRooIgnoredFiles ?? true,
2490+
showRooIgnoredFiles,
24902491
)
24912492
const completeMessage = JSON.stringify({
24922493
...sharedMessageProps,
@@ -3759,15 +3760,16 @@ export class Cline extends EventEmitter<ClineEvents> {
37593760
async getEnvironmentDetails(includeFileDetails: boolean = false) {
37603761
let details = ""
37613762

3762-
const { terminalOutputLineLimit, maxWorkspaceFiles } = (await this.providerRef.deref()?.getState()) ?? {}
3763+
const { terminalOutputLineLimit = 500, maxWorkspaceFiles = 200 } =
3764+
(await this.providerRef.deref()?.getState()) ?? {}
37633765

37643766
// It could be useful for cline to know if the user went from one or no file to another between messages, so we always include this context
37653767
details += "\n\n# VSCode Visible Files"
37663768
const visibleFilePaths = vscode.window.visibleTextEditors
37673769
?.map((editor) => editor.document?.uri?.fsPath)
37683770
.filter(Boolean)
37693771
.map((absolutePath) => path.relative(this.cwd, absolutePath))
3770-
.slice(0, maxWorkspaceFiles ?? 200)
3772+
.slice(0, maxWorkspaceFiles)
37713773

37723774
// Filter paths through rooIgnoreController
37733775
const allowedVisibleFiles = this.rooIgnoreController
@@ -3979,7 +3981,7 @@ export class Cline extends EventEmitter<ClineEvents> {
39793981
} else {
39803982
const maxFiles = maxWorkspaceFiles ?? 200
39813983
const [files, didHitLimit] = await listFiles(this.cwd, true, maxFiles)
3982-
const { showRooIgnoredFiles } = (await this.providerRef.deref()?.getState()) ?? {}
3984+
const { showRooIgnoredFiles = true } = (await this.providerRef.deref()?.getState()) ?? {}
39833985
const result = formatResponse.formatFilesList(
39843986
this.cwd,
39853987
files,

src/core/config/ConfigManager.ts

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

0 commit comments

Comments
 (0)