|
|
|
@ -829,7 +829,10 @@ export const EditorUI = (props: EditorUIProps) => { |
|
|
|
|
const file = await props.plugin.call('fileManager', 'getCurrentFile') |
|
|
|
|
const context = await props.plugin.call('fileManager', 'readFile', file) |
|
|
|
|
const message = intl.formatMessage({ id: 'editor.explainFunctionByAI' }, { content:context, currentFunction: currentFunction.current }) |
|
|
|
|
await props.plugin.call('remixAI' as any, 'chatPipe', 'code_explaining', message, context) |
|
|
|
|
await props.plugin.call('popupPanel', 'showPopupPanel', true) |
|
|
|
|
setTimeout(async () => { |
|
|
|
|
await props.plugin.call('remixAI' as any, 'chatPipe', 'code_explaining', message, context) |
|
|
|
|
}, 500) |
|
|
|
|
_paq.push(['trackEvent', 'ai', 'remixAI', 'explainFunction']) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
@ -850,7 +853,10 @@ export const EditorUI = (props: EditorUIProps) => { |
|
|
|
|
const selectedCode = editor.getModel().getValueInRange(editor.getSelection()) |
|
|
|
|
const pipeMessage = intl.formatMessage({ id: 'editor.ExplainPipeMessage' }, { content:selectedCode }) |
|
|
|
|
|
|
|
|
|
await props.plugin.call('remixAI' as any, 'chatPipe', 'code_explaining', selectedCode, content, pipeMessage) |
|
|
|
|
await props.plugin.call('popupPanel', 'showPopupPanel', true) |
|
|
|
|
setTimeout(async () => { |
|
|
|
|
await props.plugin.call('remixAI' as any, 'chatPipe', 'code_explaining', selectedCode, content, pipeMessage) |
|
|
|
|
}, 500) |
|
|
|
|
_paq.push(['trackEvent', 'ai', 'remixAI', 'explainFunction']) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|