File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
libs/remix-ui/editor/src/lib/providers Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,12 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli
2929 console . log ( 'not a trigger char' )
3030 return ;
3131 }
32-
33- const generativeComment = word . match ( / \/ \/ ( .* ) \n / )
34- if ( generativeComment [ 1 ] ) {
32+ let regex = new RegExp ( '\/\/(.*)\n ' , 'g' )
33+
34+ const generativeComment = [ ...p . matchAll ( regex ) ]
35+ if ( generativeComment && generativeComment . length ) {
3536 // use the code generation model
36- const { data} = await axios . post ( 'https://gpt-chat.remixproject.org/infer' , { comment : generativeComment [ 1 ] } )
37+ const { data} = await axios . post ( 'https://gpt-chat.remixproject.org/infer' , { comment : generativeComment [ generativeComment . length - 1 ] } )
3738 const item : monacoTypes . languages . InlineCompletion = {
3839 insertText : data
3940 } ;
You can’t perform that action at this time.
0 commit comments