Notepad++ custom language calltips autocomplete

2.6k views Asked by At

I am trying to setup calltips functionality for Alaska XBase++ language in Notepad++, but I don't manage to get it working.

I read Npp's how to edit config files, I made a user-defined language called alaska, and created alaska.xml file and put it into .\plugins\APIs.

This is the XML code i tried:

<NotepadPlus>
    <Autocomplete>
        <KeyWord name="sample" func="yes">
            <Overload retVal="void" descr="Sample description">
                <Param name="filename string"/>
            </Overload>
        </KeyWord>
    </Autocomplete>
</NotepadPlus>

Is there anything I am missing in code or outside it? Do I have to install it in some way aside from putting file in .\plugins\APIs? I also tried defining sample as a keyword in user-defined language window with no result in calltip (as a function).

PS: I made sure autocomplete options are enabled in Settings->Preferences (in fact it works for built-in languages), and I set alaska as current used language (and I get sample formatted as configured in style configuration)

1

There are 1 answers

0
Mr. Istery On BEST ANSWER

Alright, I found the answer myself.

After checking that non-function keywords would work with no problem, I tried to completely define an <Environment>, even though in Npp docs they say it can be omitted.

A small example of how the XML file is built is given above. NotepadPlus, AutoComplete and Environment are singleton elements, there should be only one of each, and all of them should be present for correctness, although it is allowed to remove the <Environment> element. Doing so will default all values to the ones given in the above example.

Any attribute can be omitted, and the <Environment> tag as well. The practice is not recommended though.

This is the complete tag:

<Environment ignoreCase="yes" startFunc="(" stopFunc=")" paramSeparator="," terminal="" additionalWordChar = ":"/>

And just in case I made sure i forgot no attributes.