samedi 18 avril 2020

How to generate monaco completion proposals from C# assembly?

I have a DLL with a set of classes I want to get code completion in Monaco code editor UI. They require them to be in format like this:

{
            label: '"lodash"',
            kind: monaco.languages.CompletionItemKind.Function,
            documentation: "The Lodash library exported as Node.js modules.",
            insertText: '"lodash": "*"',
            range: range
}

So how to generate Monaco completion proposals from C# assembly?

Notes:

  1. this may be related "Using Roslyn C# Completion Service programmatically" yet how to make them work together?
  2. If one could generate something like this using reflection:
    'namespace test{',
        'declare interface custom {',
        'id :string;',
        '};',
        '',
        'declare function MyCustomFunction(i :custom) :void;',
        '}'

It would solve the problem as shown here





Aucun commentaire:

Enregistrer un commentaire