MCPcopy Create free account
hub / github.com/continuedev/continue / useEditBlock

Function useEditBlock

gui/src/components/mainInput/Lump/useEditBlock.ts:7–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import { IdeMessengerContext } from "../../../context/IdeMessenger";
6
7export function useEditBlock() {
8 const ideMessenger = useContext(IdeMessengerContext);
9 const { selectedProfile } = useAuth();
10
11 return (slug?: string, sourceFile?: string) => {
12 if (sourceFile) {
13 ideMessenger.post("openFile", {
14 path: sourceFile,
15 });
16 } else if (selectedProfile?.uri) {
17 ideMessenger.post("openFile", {
18 path: selectedProfile.uri,
19 });
20 } else {
21 ideMessenger.post("config/openProfile", {
22 profileId: undefined,
23 });
24 }
25 };
26}
27
28export function useEditModel() {
29 const editBlock = useEditBlock();

Callers 5

PromptsSubSectionFunction · 0.90
MCPServerPreviewFunction · 0.90
useEditModelFunction · 0.85
useEditDocFunction · 0.85
useOpenRuleFunction · 0.85

Calls 2

useAuthFunction · 0.90
postMethod · 0.65

Tested by

no test coverage detected