Skip to content

Commit 58305dd

Browse files
move global file names to constants (RooCodeInc#2353)
1 parent 88c33ee commit 58305dd

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

src/core/Cline.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ import { ContextManager } from "./context-management/ContextManager"
6161
import { OpenAiHandler } from "../api/providers/openai"
6262
import { ApiStream } from "../api/transform/stream"
6363
import { ClineHandler } from "../api/providers/cline"
64-
import { ClineProvider, GlobalFileNames } from "./webview/ClineProvider"
64+
import { ClineProvider } from "./webview/ClineProvider"
6565
import { DEFAULT_LANGUAGE_SETTINGS, getLanguageKey, LanguageDisplay, LanguageKey } from "../shared/Languages"
6666
import { telemetryService } from "../services/telemetry/TelemetryService"
6767
import pTimeout from "p-timeout"
68+
import { GlobalFileNames } from "../global-constants"
6869

6970
const cwd = vscode.workspace.workspaceFolders?.map((folder) => folder.uri.fsPath).at(0) ?? path.join(os.homedir(), "Desktop") // may or may not exist but fs checking existence would immediately ask for permission which would be bad UX, need to come up with a better solution
7071

src/core/webview/ClineProvider.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { TelemetrySetting } from "../../shared/TelemetrySetting"
3737
import { cleanupLegacyCheckpoints } from "../../integrations/checkpoints/CheckpointMigration"
3838
import CheckpointTracker from "../../integrations/checkpoints/CheckpointTracker"
3939
import { getTotalTasksSize } from "../../utils/storage"
40+
import { GlobalFileNames } from "../../global-constants"
4041

4142
/*
4243
https://github.com/microsoft/vscode-webview-ui-toolkit-samples/blob/main/default/weather-webview/src/providers/WeatherViewProvider.ts
@@ -110,14 +111,6 @@ type GlobalStateKey =
110111
| "thinkingBudgetTokens"
111112
| "planActSeparateModelsSetting"
112113

113-
export const GlobalFileNames = {
114-
apiConversationHistory: "api_conversation_history.json",
115-
uiMessages: "ui_messages.json",
116-
openRouterModels: "openrouter_models.json",
117-
mcpSettings: "cline_mcp_settings.json",
118-
clineRules: ".clinerules",
119-
}
120-
121114
export class ClineProvider implements vscode.WebviewViewProvider {
122115
public static readonly sideBarId = "claude-dev.SidebarProvider" // used in package.json as the view's id. This value cannot be changed due to how vscode caches views based on their id, and updating the id would break existing instances of the extension.
123116
public static readonly tabPanelId = "claude-dev.TabPanelProvider"

src/global-constants.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// NOTE: These are here temporarily until we find a better home for them
2+
export const GlobalFileNames = {
3+
apiConversationHistory: "api_conversation_history.json",
4+
uiMessages: "ui_messages.json",
5+
openRouterModels: "openrouter_models.json",
6+
mcpSettings: "cline_mcp_settings.json",
7+
clineRules: ".clinerules",
8+
}

src/services/mcp/McpHub.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as fs from "fs/promises"
1414
import * as path from "path"
1515
import * as vscode from "vscode"
1616
import { z } from "zod"
17-
import { ClineProvider, GlobalFileNames } from "../../core/webview/ClineProvider"
17+
import { ClineProvider } from "../../core/webview/ClineProvider"
1818
import {
1919
DEFAULT_MCP_TIMEOUT_SECONDS,
2020
McpMode,
@@ -29,6 +29,7 @@ import {
2929
import { fileExistsAtPath } from "../../utils/fs"
3030
import { arePathsEqual } from "../../utils/path"
3131
import { secondsToMs } from "../../utils/time"
32+
import { GlobalFileNames } from "../../global-constants"
3233
export type McpConnection = {
3334
server: McpServer
3435
client: Client

0 commit comments

Comments
 (0)