added doc provider

pull/4884/head
Stéphane Tetsing 6 months ago committed by Aniket
parent e3c73c2759
commit 89991f744c
  1. 34
      libs/remix-ui/editor/src/lib/providers/documentationProvider.ts

@ -0,0 +1,34 @@
/* eslint-disable no-control-regex */
import { EditorUIProps, monacoTypes } from '@remix-ui/editor';
export class RemixSolidityDocumentationProvider implements monacoTypes.languages.InlineCompletionsProvider{
props:EditorUIProps
monaco:any
completion:string
constructor(completion: any){
this.completion = completion
}
async provideInlineCompletions(model: monacoTypes.editor.ITextModel, position: monacoTypes.Position, context: monacoTypes.languages.InlineCompletionContext, token: monacoTypes.CancellationToken): Promise<monacoTypes.languages.InlineCompletions<monacoTypes.languages.InlineCompletion>> {
const item: monacoTypes.languages.InlineCompletion = {
insertText: this.completion
};
console.log("provided docu completion")
return {
items: [item],
enableForwardStability: true
}
}
handleItemDidShow?(completions: monacoTypes.languages.InlineCompletions<monacoTypes.languages.InlineCompletion>, item: monacoTypes.languages.InlineCompletion, updatedInsertText: string): void {
}
handlePartialAccept?(completions: monacoTypes.languages.InlineCompletions<monacoTypes.languages.InlineCompletion>, item: monacoTypes.languages.InlineCompletion, acceptedCharacters: number): void {
}
freeInlineCompletions(completions: monacoTypes.languages.InlineCompletions<monacoTypes.languages.InlineCompletion>): void {
}
}
Loading…
Cancel
Save