From e60351b1b0089ff35f483e670719d7c6841ddb28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Tetsing?= Date: Thu, 23 May 2024 13:30:52 +0200 Subject: [PATCH] added doc provider --- .../lib/providers/documentationProvider.ts | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 libs/remix-ui/editor/src/lib/providers/documentationProvider.ts diff --git a/libs/remix-ui/editor/src/lib/providers/documentationProvider.ts b/libs/remix-ui/editor/src/lib/providers/documentationProvider.ts new file mode 100644 index 0000000000..03736935ba --- /dev/null +++ b/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> { + const item: monacoTypes.languages.InlineCompletion = { + insertText: this.completion + }; + console.log("provided docu completion") + + return { + items: [item], + enableForwardStability: true + } + } + + handleItemDidShow?(completions: monacoTypes.languages.InlineCompletions, item: monacoTypes.languages.InlineCompletion, updatedInsertText: string): void { + + } + handlePartialAccept?(completions: monacoTypes.languages.InlineCompletions, item: monacoTypes.languages.InlineCompletion, acceptedCharacters: number): void { + + } + freeInlineCompletions(completions: monacoTypes.languages.InlineCompletions): void { + + } +} \ No newline at end of file