Skip to content
Merged
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
5 changes: 4 additions & 1 deletion .github/workflows/marketplace-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ jobs:
npm run vsix
package=$(unzip -l bin/roo-cline-${current_package_version}.vsix)
echo "$package"
echo "$package" | grep -q "dist/extension.js" || exit 1
echo "$package" | grep -q "extension/dist/package.json" || exit 1
echo "$package" | grep -q "extension/dist/package.nls.json" || exit 1
echo "$package" | grep -q "extension/dist/extension.js" || exit 1
echo "$package" | grep -q "extension/webview-ui/audio/celebration.wav" || exit 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional checks to ensure we're building the vsix correctly. We recently changed the location of the audio directory. I'd like to come up with a better solution for ensuring certain build artifacts are always present. You can end up breaking things if you add something without realizing that .vscodeignore disallows it.

echo "$package" | grep -q "extension/webview-ui/build/assets/index.js" || exit 1
echo "$package" | grep -q "extension/node_modules/@vscode/codicons/dist/codicon.ttf" || exit 1
echo "$package" | grep -q ".env" || exit 1
Expand Down
4 changes: 2 additions & 2 deletions evals/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ code --install-extension redhat.java &>/dev/null || exit 1
code --install-extension ms-python.python&>/dev/null || exit 1
code --install-extension rust-lang.rust-analyzer &>/dev/null || exit 1

if ! code --list-extensions 2>/dev/null | grep -q "rooveterinaryinc.roo-cline"; then
code --install-extension rooveterinaryinc.roo-cline &>/dev/null || exit 1
if ! code --list-extensions 2>/dev/null | grep -q "RooVeterinaryInc.roo-cline"; then
code --install-extension RooVeterinaryInc.roo-cline &>/dev/null || exit 1
fi

echo "✅ Done"
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@
],
"main": "./dist/extension.js",
"contributes": {
"submenus": [
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this below menus, which makes more sense to me.

{
"id": "roo-code.contextMenu",
"label": "%views.contextMenu.label%"
},
{
"id": "roo-code.terminalMenu",
"label": "%views.terminalMenu.label%"
}
],
"viewsContainers": {
"activitybar": [
{
Expand Down Expand Up @@ -166,19 +156,19 @@
"category": "%configuration.title%"
},
{
"command": "roo.acceptInput",
"command": "roo-cline.acceptInput",
"title": "%command.acceptInput.title%",
"category": "%configuration.title%"
}
],
"menus": {
"editor/context": [
{
"submenu": "roo-code.contextMenu",
"submenu": "roo-cline.contextMenu",
"group": "navigation"
}
],
"roo-code.contextMenu": [
"roo-cline.contextMenu": [
{
"command": "roo-cline.addToContext",
"group": "1_actions@1"
Expand All @@ -194,11 +184,11 @@
],
"terminal/context": [
{
"submenu": "roo-code.terminalMenu",
"submenu": "roo-cline.terminalMenu",
"group": "navigation"
}
],
"roo-code.terminalMenu": [
"roo-cline.terminalMenu": [
{
"command": "roo-cline.terminalAddToContext",
"group": "1_actions@1"
Expand Down Expand Up @@ -277,6 +267,16 @@
}
]
},
"submenus": [
{
"id": "roo-cline.contextMenu",
"label": "%views.contextMenu.label%"
},
{
"id": "roo-cline.terminalMenu",
"label": "%views.terminalMenu.label%"
}
],
"configuration": {
"title": "%configuration.title%",
"properties": {
Expand Down
1 change: 1 addition & 0 deletions src/exports/roo-code.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,7 @@ declare const Package: {
readonly publisher: string
readonly name: string
readonly version: string
readonly outputChannel: string
}
/**
* ProviderName
Expand Down
11 changes: 4 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ let extensionContext: vscode.ExtensionContext
// Your extension is activated the very first time the command is executed.
export async function activate(context: vscode.ExtensionContext) {
extensionContext = context
outputChannel = vscode.window.createOutputChannel("Roo-Code")
outputChannel = vscode.window.createOutputChannel(Package.outputChannel)
context.subscriptions.push(outputChannel)
outputChannel.appendLine("Roo-Code extension activated")
outputChannel.appendLine(`${Package.name} extension activated`)

// Migrate old settings to new
await migrateSettings(context, outputChannel)
Expand Down Expand Up @@ -147,13 +147,10 @@ export async function activate(context: vscode.ExtensionContext) {
return new API(outputChannel, provider, socketPath, enableLogging)
}

// This method is called when your extension is deactivated
// This method is called when your extension is deactivated.
export async function deactivate() {
outputChannel.appendLine("Roo-Code extension deactivated")
// Clean up MCP server manager
outputChannel.appendLine(`${Package.name} extension deactivated`)
await McpServerManager.cleanup(extensionContext)
telemetryService.shutdown()

// Clean up terminal handlers
TerminalRegistry.cleanup()
}
26 changes: 25 additions & 1 deletion src/schemas/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// npx jest src/schemas/__tests__/index.test.ts

import { GLOBAL_STATE_KEYS } from "../index"
import { contributes } from "../../../package.json"

import { GLOBAL_STATE_KEYS, Package, codeActionIds, terminalActionIds, commandIds } from "../index"

describe("GLOBAL_STATE_KEYS", () => {
it("should contain provider settings keys", () => {
Expand All @@ -15,3 +17,25 @@ describe("GLOBAL_STATE_KEYS", () => {
expect(GLOBAL_STATE_KEYS).not.toContain("openRouterApiKey")
})
})

describe("package.json#contributes", () => {
it("is in sync with the schema's commands", () => {
// These aren't explicitly referenced in package.json despite
// being registered by the extension.
const absent = new Set([
"activationCompleted",
"showHumanRelayDialog",
"registerHumanRelayCallback",
"unregisterHumanRelayCallback",
"handleHumanRelayResponse",
])

// This test will notify us if package.json drifts from the schema.
expect(contributes.commands.map((command) => command.command).sort()).toEqual(
[...new Set([...commandIds, ...terminalActionIds, ...codeActionIds])]
.filter((id) => !absent.has(id))
.map((id) => `${Package.name}.${id}`)
.sort(),
)
})
})
39 changes: 28 additions & 11 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,66 @@ import { Equals, Keys, AssertEqual } from "../utils/type-fu"

import { publisher, name, version } from "../../package.json"

// These ENV variables can be defined by ESBuild when building the extension
// in order to override the values in package.json. This allows us to build
// different extension variants with the same package.json file.
// The build process still needs to emit a modified package.json for consumption
// by VSCode, but that build artifact is not used during the transpile step of
// the build, so we still need this override mechanism.
export const Package = {
publisher,
name,
version,
publisher: process.env.PKG_PUBLISHER || publisher,
name: process.env.PKG_NAME || name,
version: process.env.PKG_VERSION || version,
outputChannel: process.env.PKG_OUTPUT_CHANNEL || "Roo-Code",
} as const

/**
* CodeAction
*/

export type CodeActionName = "EXPLAIN" | "FIX" | "IMPROVE" | "ADD_TO_CONTEXT" | "NEW_TASK"
export const codeActionIds = ["explainCode", "fixCode", "improveCode", "addToContext", "newTask"] as const

export type CodeActionId = (typeof codeActionIds)[number]

export type CodeActionId = "explainCode" | "fixCode" | "improveCode" | "addToContext" | "newTask"
export type CodeActionName = "EXPLAIN" | "FIX" | "IMPROVE" | "ADD_TO_CONTEXT" | "NEW_TASK"

/**
* TerminalAction
*/

export const terminalActionIds = ["terminalAddToContext", "terminalFixCommand", "terminalExplainCommand"] as const

export type TerminalActionId = (typeof terminalActionIds)[number]

export type TerminalActionName = "ADD_TO_CONTEXT" | "FIX" | "EXPLAIN"

export type TerminalActionPromptType = `TERMINAL_${TerminalActionName}`

export type TerminalActionId = "terminalAddToContext" | "terminalFixCommand" | "terminalExplainCommand"

/**
* Command
*/

const commandIds = [
export const commandIds = [
"activationCompleted",

"plusButtonClicked",
"mcpButtonClicked",
"promptsButtonClicked",
"mcpButtonClicked",
"historyButtonClicked",
"popoutButtonClicked",
"openInNewTab",
"settingsButtonClicked",
"historyButtonClicked",

"openInNewTab",

"showHumanRelayDialog",
"registerHumanRelayCallback",
"unregisterHumanRelayCallback",
"handleHumanRelayResponse",

"newTask",

"setCustomStoragePath",

"focusInput",
"acceptInput",
] as const
Expand Down
Loading