mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix(modes): custom modes under custom path not showing (#8499)
This commit is contained in:
parent
520b2f63da
commit
06af804c2e
4 changed files with 10 additions and 15 deletions
|
|
@ -2,11 +2,12 @@ import * as path from "path"
|
|||
import * as vscode from "vscode"
|
||||
|
||||
import { GlobalFileNames } from "../../../shared/globalFileNames"
|
||||
import { getSettingsDirectoryPath } from "../../../utils/storage"
|
||||
|
||||
export async function createModeInstructions(context: vscode.ExtensionContext | undefined): Promise<string> {
|
||||
if (!context) throw new Error("Missing VSCode Extension Context")
|
||||
|
||||
const settingsDir = path.join(context.globalStorageUri.fsPath, "settings")
|
||||
const settingsDir = await getSettingsDirectoryPath(context.globalStorageUri.fsPath)
|
||||
const customModesPath = path.join(settingsDir, GlobalFileNames.customModes)
|
||||
|
||||
return `
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
import * as path from "path"
|
||||
import * as vscode from "vscode"
|
||||
import { promises as fs } from "fs"
|
||||
|
||||
import type { ModeConfig } from "@roo-code/types"
|
||||
|
||||
import { getAllModesWithPrompts } from "../../../shared/modes"
|
||||
import { ensureSettingsDirectoryExists } from "../../../utils/globalContext"
|
||||
|
||||
export async function getModesSection(context: vscode.ExtensionContext): Promise<string> {
|
||||
const settingsDir = path.join(context.globalStorageUri.fsPath, "settings")
|
||||
await fs.mkdir(settingsDir, { recursive: true })
|
||||
// Make sure path gets created
|
||||
await ensureSettingsDirectoryExists(context)
|
||||
|
||||
// Get all modes with their overrides from extension state
|
||||
const allModes = await getAllModesWithPrompts(context)
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
import { mkdir } from "fs/promises"
|
||||
import { join } from "path"
|
||||
import { ExtensionContext } from "vscode"
|
||||
|
||||
export async function getGlobalFsPath(context: ExtensionContext): Promise<string> {
|
||||
return context.globalStorageUri.fsPath
|
||||
}
|
||||
import { getSettingsDirectoryPath } from "./storage"
|
||||
|
||||
export async function ensureSettingsDirectoryExists(context: ExtensionContext): Promise<string> {
|
||||
const settingsDir = join(context.globalStorageUri.fsPath, "settings")
|
||||
await mkdir(settingsDir, { recursive: true })
|
||||
return settingsDir
|
||||
// getSettingsDirectoryPath already handles the custom storage path setting
|
||||
return await getSettingsDirectoryPath(context.globalStorageUri.fsPath)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import * as path from "path"
|
|||
import * as fs from "fs/promises"
|
||||
import { fileExistsAtPath } from "./fs"
|
||||
import { GlobalFileNames } from "../shared/globalFileNames"
|
||||
import { getSettingsDirectoryPath } from "./storage"
|
||||
import * as yaml from "yaml"
|
||||
|
||||
const deprecatedCustomModesJSONFilename = "custom_modes.json"
|
||||
|
|
@ -26,7 +27,7 @@ export async function migrateSettings(
|
|||
]
|
||||
|
||||
try {
|
||||
const settingsDir = path.join(context.globalStorageUri.fsPath, "settings")
|
||||
const settingsDir = await getSettingsDirectoryPath(context.globalStorageUri.fsPath)
|
||||
|
||||
// Check if settings directory exists first
|
||||
if (!(await fileExistsAtPath(settingsDir))) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue