improved completion after (

inlinecompletion_update
Stéphane Tetsing 1 year ago
parent 3ea6f6d37b
commit 6c946e8152
  1. 7
      libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts

@ -28,7 +28,7 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli
endColumn: position.column,
});
if (!word.endsWith(' ') && !word.endsWith('\n') && !word.endsWith(';') && !word.endsWith('.')) {
if (!word.endsWith(' ') && !word.endsWith('\n') && !word.endsWith(';') && !word.endsWith('.') && !word.endsWith('(') && word.split('\n').at(-1).trimStart().startsWith('//')) {
return;
}
@ -69,10 +69,7 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli
let result
try {
if (word.split('\n').at(-1).trimStart().startsWith('//')){
return // disable completion on comment -> current lie
}else if (!this.running){
console.log('last line', word.split('\n').at(-1))
if (!this.running){
result = await this.props.plugin.call('copilot-suggestion', 'suggest', word)
this.running = true
}

Loading…
Cancel
Save