Skip to content

Commit 8779bcb

Browse files
committed
updates
1 parent 392f003 commit 8779bcb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli
3939
}
4040

4141
// eslint-disable-next-line no-useless-escape
42-
const regex = new RegExp('\/\/(.*)\n ', 'g')
42+
const regex = new RegExp('\/\/\/(.*)\n ', 'g')
4343

4444
const generativeComment = [...word.matchAll(regex)]
4545
if (generativeComment && generativeComment.length) {
4646
// use the code generation model
4747
const {data} = await axios.post('https://gpt-chat.remixproject.org/infer', {comment: generativeComment[generativeComment.length - 1][1]})
48-
const parsedData = JSON.parse(data)
48+
const parsedData = JSON.parse(data).trimStart()
49+
console.log('parsedData', parsedData)
4950
const item: monacoTypes.languages.InlineCompletion = {
5051
insertText: parsedData
5152
};

0 commit comments

Comments
 (0)