Skip to content

Commit

Permalink
restructure debug commands, working view
Browse files Browse the repository at this point in the history
  • Loading branch information
robobenklein committed Feb 23, 2024
1 parent 07d3752 commit 60a0f4d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
28 changes: 19 additions & 9 deletions coderibbon-theia/src/browser/coderibbon-theia-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ import { CodeRibbonTheiaRibbonStrip } from "./cr-ribbon-strip";

import { crdebug } from "./cr-logger";

export const CodeRibbonHelloWorldCommand = {
id: "CodeRibbon.HelloWorld",
label: "Hello, CodeRibbon.",
export const CodeRibbonDebuggingCommands = {
helloWorldCommand: {
id: "CodeRibbon.HelloWorld",
label: "Hello, CodeRibbon.",
},
testFuzzyFinderCommand: {
id: "CodeRibbon.dev.test_ff",
label: "CodeRibbon Test FuzzyFinder",
},
};

export const CodeRibbonDevGetPanelCommand = {
Expand Down Expand Up @@ -136,18 +142,22 @@ export class CodeRibbonTheiaCommandContribution implements CommandContribution {
) {}

registerCommands(registry: CommandRegistry): void {
registry.registerCommand(CodeRibbonHelloWorldCommand, {

// === NOTE: Debugging section
// TODO: only register these in debug mode

registry.registerCommand(CodeRibbonDebuggingCommands.helloWorldCommand, {
execute: () => {
this.messageService.info("CodeRibbon says hello!");
crdebug("Hello console! CommandContribution:", this);
// crdebug("CRAS is:", this.cras);
},
});
// registry.registerCommand(CodeRibbonDevGetPanelCommand, {
// execute: () => {
// crdebug();
// }
// });
registry.registerCommand(CodeRibbonDebuggingCommands.testFuzzyFinderCommand, {
execute: () => {
crdebug();
}
});

// === NOTE: Nav section

Expand Down
8 changes: 5 additions & 3 deletions coderibbon-theia/src/browser/coderibbon-theia-menus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@theia/core/lib/common";

import {
CodeRibbonHelloWorldCommand,
CodeRibbonDebuggingCommands,
CodeRibbonNavigationCommands,
CodeRibbonManipulationCommands,
CodeRibbonArrangementCommands,
Expand All @@ -36,9 +36,11 @@ export class CodeRibbonTheiaMenuContribution implements MenuContribution {
registerMenus(menus: MenuModelRegistry): void {
menus.registerSubmenu(CodeRibbonTopMenuPath, "CodeRibbon");

// General

menus.registerMenuAction(CodeRibbonTopMenuPath, {
commandId: CodeRibbonHelloWorldCommand.id,
label: "Say Hello",
commandId: CodeRibbonDebuggingCommands.testFuzzyFinderCommand.id,
label: "Test FuzzyFinder",
});

// Navigation
Expand Down
2 changes: 1 addition & 1 deletion coderibbon-theia/src/browser/cr-fuzzy-file-opener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Command, CommandRegistry } from '@theia/core/lib/common/command';
@injectable()
export class CodeRibbonFuzzyFileOpenerWidget extends ReactWidget {
static readonly ID = "coderibbon:fuzzy-file-opener";
static readonly LABEL = "Fuzzy File Finder";
static readonly LABEL = "CodeRibbon Fuzzy File Finder";

@postConstruct()
protected async init(): Promise<void> {
Expand Down

0 comments on commit 60a0f4d

Please sign in to comment.