edit function explaining and doc gen

pull/5100/head
Stéphane Tetsing 2 months ago
parent fd8832f5bb
commit 3794139c61
  1. 2
      apps/remix-ide/src/app/tabs/locales/en/editor.json
  2. 2
      apps/remixdesktop/package.json
  3. 995
      apps/remixdesktop/yarn.lock
  4. 3
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx

@ -21,7 +21,7 @@
"editor.formatCode": "Format Code",
"editor.generateDocumentation": "Generate documentation for this function",
"editor.generateDocumentation2": "Generate documentation for the function \"{name}\"",
"editor.generateDocumentationByAI": "solidity code: {content}\n Generate the natspec documentation for the function {currentFunction} using the docstring style syntax. Only use docstring supported tags",
"editor.generateDocumentationByAI": "```solidity\n {content}\n```\n You only generate the natspec documentation for the function {currentFunction} using the docstring style syntax. Only use docstring supported tags",
"editor.explainFunction": "Explain this function",
"editor.explainFunctionSol": "Explain this code",
"editor.explainFunction2": "Explain the function \"{name}\"",

@ -70,9 +70,7 @@
"express": "^4.19.2",
"i": "^0.3.7",
"isomorphic-git": "^1.24.2",
"llama-node": "^0.1.6",
"matomo-tracker": "^2.2.4",
"node-llama-cpp": "^2.8.11",
"node-pty": "^0.10.1",
"npm": "^10.8.1",
"semver": "^7.5.4"

File diff suppressed because it is too large Load Diff

@ -779,10 +779,11 @@ export const EditorUI = (props: EditorUIProps) => {
const message = intl.formatMessage({ id: 'editor.generateDocumentationByAI' }, { content, currentFunction: currentFunction.current })
const cm = await props.plugin.call('remixAI', 'code_explaining', message)
console.log(cm)
const natSpecCom = "\n" + extractNatspecComments(cm)
console.log(natSpecCom)
const cln = await props.plugin.call('codeParser', "getLineColumnOfNode", currenFunctionNode)
const range = new monacoRef.current.Range(cln.start.line, cln.start.column, cln.start.line, cln.start.column)
const lines = natSpecCom.split('\n')
const newNatSpecCom = []

Loading…
Cancel
Save