|
| 1 | +/* eslint-disable no-control-regex */ |
1 | 2 | import { EditorUIProps, monacoTypes } from '@remix-ui/editor'; |
2 | 3 | import axios, {AxiosResponse} from 'axios' |
3 | 4 | const controller = new AbortController(); |
@@ -29,8 +30,9 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli |
29 | 30 | console.log('not a trigger char') |
30 | 31 | return; |
31 | 32 | } |
32 | | - let regex = new RegExp('\/\/(.*)\n ', 'g') |
33 | | - |
| 33 | + // eslint-disable-next-line no-useless-escape |
| 34 | + const regex = new RegExp('\/\/(.*)\n ', 'g') |
| 35 | + |
34 | 36 | const generativeComment = [...word.matchAll(regex)] |
35 | 37 | if (generativeComment && generativeComment.length) { |
36 | 38 | // use the code generation model |
@@ -60,7 +62,7 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli |
60 | 62 |
|
61 | 63 | const generatedText = (result as any).output[0].generated_text as string |
62 | 64 | // the generated text remove a space from the context... |
63 | | - let clean = generatedText.replace('@custom:dev-run-script', '@custom:dev-run-script ').replace(word, '') |
| 65 | + const clean = generatedText.replace('@custom:dev-run-script', '@custom:dev-run-script ').replace(word, '') |
64 | 66 | console.log('suggest result', clean) |
65 | 67 | const item: monacoTypes.languages.InlineCompletion = { |
66 | 68 | insertText: clean |
|
0 commit comments