forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PearAI Overlay Foundation within pear-app
- Loading branch information
1 parent
90dbd86
commit 6f6cee2
Showing
8 changed files
with
501 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/vs/workbench/browser/parts/pearai/pearOverlayActions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { registerAction2, Action2 } from "vs/platform/actions/common/actions"; | ||
import { ServicesAccessor } from "vs/platform/instantiation/common/instantiation"; | ||
import { IPearOverlayService } from "./pearOverlayService"; | ||
import { KeyCode, KeyMod } from "vs/base/common/keyCodes"; | ||
|
||
export class ClosePearOverlayAction extends Action2 { | ||
static readonly ID = "workbench.action.closePearAI"; | ||
|
||
constructor() { | ||
super({ | ||
id: ClosePearOverlayAction.ID, | ||
title: { value: "Close PearAI Popup", original: "Close PearAI Popup" }, | ||
f1: true, | ||
keybinding: { | ||
weight: 200, | ||
primary: KeyCode.Escape, | ||
}, | ||
}); | ||
} | ||
|
||
run(accessor: ServicesAccessor): void { | ||
const pearaiOverlayService = accessor.get(IPearOverlayService); | ||
pearaiOverlayService.hide(); | ||
} | ||
} | ||
|
||
export class TogglePearOverlayAction extends Action2 { | ||
static readonly ID = "workbench.action.togglePearAI"; | ||
|
||
constructor() { | ||
super({ | ||
id: TogglePearOverlayAction.ID, | ||
title: { value: "Toggle PearAI Popup", original: "Toggle PearAI Popup" }, | ||
f1: true, | ||
keybinding: { | ||
weight: 200, | ||
primary: KeyMod.CtrlCmd | KeyCode.KeyE, | ||
}, | ||
}); | ||
} | ||
|
||
run(accessor: ServicesAccessor): void { | ||
const pearaiOverlayService = accessor.get(IPearOverlayService); | ||
console.log("TOGGLED PEARAI SERVICE 2"); | ||
pearaiOverlayService.toggle(); | ||
} | ||
} | ||
|
||
registerAction2(TogglePearOverlayAction); | ||
registerAction2(ClosePearOverlayAction); |
Oops, something went wrong.