@@ -16,7 +16,7 @@ import { pasteToEditor } from './editor';
1616import { getFileContent } from './file' ;
1717import { getInnerLibs } from './lib' ;
1818import { getOutputChannel } from './outputChannel' ;
19- import { getLastAcitveTextEditor } from '../context' ;
19+ import { getLastActiveTextEditor } from '../context' ;
2020import { getSyncFolder } from './config' ;
2121import { createChatCompletionForScript } from './openai' ;
2222
@@ -94,6 +94,7 @@ export const genCodeByBlock = async (data: {
9494 . replace ( / \\ / g, '/' ) ,
9595 createChatCompletion : createChatCompletionForScript ,
9696 materialPath : block ,
97+ activeTextEditor : getLastActiveTextEditor ( ) ,
9798 } ;
9899 data . model = {
99100 ...data . model ,
@@ -178,7 +179,7 @@ export const genCodeBySnippet = async (data: {
178179 hook . afterCompile = script . afterCompile ;
179180 }
180181 }
181- const activeTextEditor = getLastAcitveTextEditor ( ) ;
182+ const activeTextEditor = getLastActiveTextEditor ( ) ;
182183 if ( activeTextEditor ) {
183184 data . model = {
184185 ...data . model ,
@@ -199,6 +200,7 @@ export const genCodeBySnippet = async (data: {
199200 createChatCompletion : createChatCompletionForScript ,
200201 materialPath : snippetPath ,
201202 code : '' ,
203+ activeTextEditor : getLastActiveTextEditor ( ) ,
202204 } ;
203205 const extendModel = await hook . beforeCompile ( context ) ;
204206 if ( extendModel ) {
0 commit comments