Custom Code Completion

How can I customize code completion? For instance, when I type api.parameters[] , I need to present a list of keys for the parameters dictionary.

Thanks,

Alex Iuspa

Hi Alex,

Could you please provide a full code snippet and we will look at the best way to extend code completion for PythonNETParser

Kind regards,
Dmitry

I am getting the code completion to work for Python, however the Completion box does not display the imageindex for a property or method. I realized the namespace Alternet.Syntax.Parsers.Python.CodeCompletion

does not support MemberImageIndex.Method as CSharp does. Can you let me know how I can get that to display? Please refer to the code below: private PythonListMembers CompleteCode(List resourcekeys)
{

        PythonListMembers mems = new PythonListMembers();
        mems.ShowDescriptions = true;
        mems.ShowResults = true;
        mems.ShowQualifiers = true;


        foreach (var key in resourcekeys)
        {
            IListMember ls  =  mems.InsertListMember(0);
            ls.Name = key.label;
            ls.DisplayText = $"<b>{key.label}</b>";
            ls.InsertText = key.insertText;
            ls.ImageIndex = 52;

        }

        return mems;

    }

Hi Alex,

In this code, you will need to assign property Images to the PythonListMembers. It can be done like this:

            var repository = parser.CompletionRepository;
            mems.Images = repository.Images;

(or you can provide your own images).

Please note that ls.ImageIndex = 52 is outside PythonRepository Images collection.

Kind regards,
Dmitry