Menu

hint and auto complete help/problem with "."s

2008-11-09
2012-11-14
  • Jamie Sharpe

    Jamie Sharpe - 2008-11-09

    I use NotePad++ a lot for programming in lua, and started making a auto function complete file which worked fine strait away.

    However, when i tried to use the hints for parameters I hit a problem, a BIG one.

    The functions i use are like "timer.Create()" "timer.Simple()" and i wanted to add in hints for the parameters. However, the "." in the function makes NP++ think it's two entirely different functions all together, when they're not!

    Here's a test xml file i did just to validate my error.

    <NotepadPlus>
        <AutoComplete>
          <Environment ignoreCase="no" startFunc="(" stopFunc=")" paramSeparator="," />
           
        <KeyWord name="TESTONE" func="yes">
                <Overload retVal="FooBar">
                    <Param name="TESTONE works! No problem" />
                </Overload>
            </KeyWord>
           
        <KeyWord name="TEST.TWO" func="yes">
                <Overload retVal="FooBar">
                    <Param name="TESTTWO doesn't work! UH OH!" />
                </Overload>
            </KeyWord>

           </AutoComplete>
    </NotepadPlus>

    You could try it yourself if you want to see what i meen. But with TEST.TWO no hint or any sign of a hint existing shows. But with TESTONE as soon as i hit ( the hint shows telling me it worked.

    Is there a way for me to make notepad++ ignore "."s in the lua language? Or will there actually be any support for lua and the problem which a lot in the Garrys Mod community (link to pages of the GMod lua syntax style: http://wiki.garrysmod.com/wiki/?title=Lua   as you see, there's alot of this.that function.foobar) are having?

    There is also the same problem with "."s in the auto complete functions. I made a list with all the functions i use, and almost every single one, has a "." in it. So when i'm typing a function out, such as "Player.Kill()" here's what happens:

    Types in "Player"
    *list shows with all the functions with Player at the start*
    Types in ".Ki" to make "Player.Ki" thinking it would show "Player.Kill"
    *list disappears*

    It happens because once the "." is typed in, NP++ thinks whatever is after it is a whole new function -Which is isn't-

    Is there anything at all to help me through this problem I (and others) have?

    I really want more flexibility with the Auto Complete/Call Hint settings like when a new function is defined and what characters to ignore/allow.

    Is there anyone that can help me?

     
    • cchris

      cchris - 2009-07-29

      This question is to be added to the Scintilla project, because they provide the highlighter for Lua.

      Another aproach is to look at the Gmod Lua v1.2 plugin. Perhaps you can tweak this piece of code and recompile - or ask the author.

      CChris

       
    • Jamie Sharpe

      Jamie Sharpe - 2008-11-11

      Is it not possible for some one to make a quick plugin/fix or patch so that it ignores "."s in the lua language? (preferably select what language as I use a user custom one)

       
    • Airdrik

      Airdrik - 2008-11-12

      The problem is that NP++ isn't that intelligent (it's a code editor, not an IDE), and since the "." is a separate token, when looking up function hints, it only looks up functions based on the string of valid identifier-name characters (most likely a-z, A-Z and _). 

      If you want "." to be included in the set of identifier-name characters for lua, rather than being a separate operator, you will need to go to the scintilla project (or at least into the code for the scintilla editor component).

       
    • Jamie Sharpe

      Jamie Sharpe - 2009-07-28

      Is this ever likely going to get a fix/patch? There's loads of times when i've wanted to use this but haven't been able to due to this problem. Not to mention many others.