AutoComplete only shows what is already typed - ONLY?



  • I have been trying my hand in creating an auto-complete xml.
    After populating with a few keywords and restarting NP++
    the keywords I have listed do not show up in the auto-complete
    cursor prompt. Only flickering of the cursor prompt.

    From there I took note to an existing HTML.xml file and started
    a new file with the HTML extension. Again, no keywords show
    except for the keywords that are already defined in the document
    body.

    Is this the normal behavior of auto-complete?
    If so, what is the purpose of the auto-complete xml file?

    I did try to define a keyword as a function, but could not get that
    to work either.

    The only item that seems to work is the Auto-Insert section.

    Request for a plugin:

    • The plugin reads all the keywords from the assigned keyword list.
    • Perhaps optionally have check boxes as to which keyword list
      number is and/or is not read (for each file extension type).
    • Populate the cursor prompt with only these keywords to be used
      as the AutoComplete.

    Yes, I have seen a few floating/dockable windows plugins that will
    insert text snippets, but this is not what I am after. Besides, the list
    will have to be replicated, which to me, is redundant.

    Notepad++ v7.6.3 (32-bit)
    Build time : Jan 27 2019 - 17:20:30
    Path : C:\Program Files (x86)\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : OFF
    OS : Windows 7 (64-bit)
    Plugins : DSpellCheck.dll LightExplorer.dll NppExport.dll PluginManager.dll _CustomizeToolbar.dll



  • Thanks for the Debug Info: that really helps.

    What are your autocomplete settings: Settings > Preferences > Auto-Completion?

    What was the location of the HTML.xml that you edited and saved? When you reloaded NPP, if you reload that HTML.xml, does it still contain the edits you made?

    I also want to confirm: you want to replace the default HTML.xml with an edited copy that will auto-complete more than just the standard HTML included, correct? Or are you trying to copy HTML.xml to SomethingElse.xml and have it apply to some other file type (maybe a UDL)? The rest of my answer assumes your edited autoCompletion file is called HTML.xml.

    Due to machine setup, I cannot test an installed-notepad++ any more, but: I think that you can put autoCompletion files in the %AppData%\Notepad++\autoCompletion\html.xml, but I’m not sure. And I believe if you set it in %ProgramFiles%\Notepad++\autoCompletion\html.xml, and you don’t have a conflicting definition in %AppData%, then it will use the installed copy. (My guess is you edited one, but it’s loading the other

    So I just tried the experiment with a portable notepad++, so I was editing <notepad++.exe_dir>\autoCompletion\html.xml. When I edited and saved, exited all NPP and reloaded, I was able to get it to auto-complete just fine.

    Imgur



  • Hi Peter,

    Let’s see if I can answer some of your questions.
    My AutoComplete settings are just as you show.

    Location of the unedited HTML file:
    C:\Program Files (x86)\Notepad++\plugins\APIs\html.xml
    I could not find any other file of this name in program data
    or appdata local or appdata roaming.

    I have not edited the HTML file. I edited another file (DCL),
    placed in the directory above and it did not work. So I
    investigated using a file that should have worked (the HTML).

    I installed the latest NP++ (npp.7.6.3.Installer.exe) a few days
    ago before looking into AutoComplete.

    My plans are to edit an existing auto-complete (LISP) as well as
    creating a new auto-complete (DCL).

    From the looks of your paths, they do not match to what I have.
    One would think the installer “npp.7.6.3.Installer.exe” would align
    my existing geometry to the new standards?

    Would a complete uninstall of NP++ be in order (including manually
    removing stray files and folders after the uninstall), then run the
    installer again?

    Scot-65



  • I think @Meta-Chuh will have to chime in to help me, because I’m not an expert on the details for an installed version of 7.6.3, since I’ve had to switch to portable-only due to UAC at work.

    But from what I understand

    1. the plugins\APIs\*.xml was the old (pre-7.6.3) location for auto-complete files. I know on the portable, auto-complete has its own directory rather than being in the plugins\API hierarchy, and I cannot see why it would be different on the installed.
    2. If there isn’t an %AppData%\Notepad++\autoCompletion\*.xml, then it shouldn’t be that another file is interfering.
    3. installing a new copy of 7.6.3 should have created the autoCompletion directory, but would not have deleted the old plugins\APIs\ directory from a previous installation.

    @scot-65 said,

    I edited another file (DCL), placed it in the directory above

    So two things with that:

    1. if you placed it in the plugins\APIs\ directory, I am reasonably certain that Notepad++ 7.6.3 won’t find it, because it now looks for auto-complete in c:\program files (x86)\notepad++\autoCompletion\*.xml
    2. If you are trying to create an auto-complete for a new file type (DCL), I don’t think it would be sufficient. I think Notepad++ would need some way to map from the file type to the autoCompletion file.
      • I ran an exerperiment where I created a UDL named “DeeCeeEll” which uses .dcl file extensions (to confirm which auto-completion file it loads, if any)
      • I tried creating ...\notepad++\autoCompletion\dcl.xml as with a few keywords, then I saved, exited everything, and reloaded; it did not autocomplete.
      • I renamed that to ...\notepad++\autoCompletion\deeceeell.xml, exited, reloaded. It did not autocomplete
      • As a workaround, if I had deeceeell.xml OPEN in another Notepad++ tab – or if I’d opened it previously, then closed it – then Notepad++ would auto-complete on any of those terms. But if I closed/reopened Notepad++, then the auto-complete memory would be cleared.

    Maybe someone else knows how to associate a UDL with an auto-completion file. For now, you may be able to use the workaround I suggested.



  • @PeterJones

    thanks for the trust, i hope i can keep up with it and comply 😀


    @scot-65

    peter’s guide is correct, and should work on your system if followed precisely.

    i have however found a few things that might be the reason, why it does not work on your specific installation.

    • on 7.6.3 your path C:\Program Files (x86)\Notepad++\plugins\APIs\html.xml is wrong and will not work.
      (api was the path of older installations, versions 7.6.1 and below)

    • make sure your html.xml or any other is correctly saved to C:\Program Files (x86)\Notepad++\autoCompletion\html.xml
      (html.xml is only an example name)

    • make sure your xml is saved correctly within C:\Program Files (x86)\Notepad++\autoCompletion as you need elevated rights to save there, unless you have uac turned off.

    • always keep in mind that auto completion is case sensitive.

    • if you use a custom auto completion xml, make sure it has the same name as your udl.
      so if your udl is called DemoUDL, your auto comletion file must be called DemoUDL.xml.

    here are two screenshots with auto completion examples of two languages, the default html language and a user defined language called DemoUDL:

    Imgur

    Imgur



  • @Meta-Chuh,

    I noticed in your screenshot that DemoUDL.xml was still open. Are you sure it isn’t grabbing the auto-complete from the open file, rather than really processing it as an auto-complete file? In my experiments, if I closed the DemoUDL.xml, then exited NPP and came back in and loaded my file that was using the DemoUDL file type, it would no longer do autocompletes from keywords in the xml file.



  • @PeterJones

    sure. i’ve now closed all opened tabs (except change.log)
    closed notepad++
    reopened notepad++
    created a new 1 document
    set it to DemoUDL
    and started typing <Pe

    here’s a new screenshot:

    Imgur

    btw: my apologies, before posting, i read everything from beginning until your chime in call, but nothing below that, so i wrote many things which you’ve already posted after the call.



  • Interesting: If I do File > new then Language > DemoUDL, and start typing, it will auto-complete per the DemoUDL.xml settings, as you described. However, If I associate .demo with the DemoUDL (Language > Define Your Language and set Ext. = demo), then exit/re-run, and load file a file called tryAutoComplete.demo, it properly says “User Defined language file - DemoUDL”, so I know Notepad++ knows it’s a UDL file. But when I start typing in it, it does not auto-complete per the DemoUDL.xml settings. If I then set Language to Normal Text then back to DemoUDL and type more, then it will auto-complete.

    I tried the new vs Language toggle over multiple loads of Notepad++, and it consistently behaved that way.

    @Meta-Chuh, does yours work the way you expect, or the way I just described, for a file-extension that auto-selects the DemoUDL file-type? If it matches my behavior for you, then there might be a race condition where it’s not loading the DemoUDL.xml until some file is manually set

    Notepad++ v7.6.3   (64-bit)
    Build time : Jan 27 2019 - 17:16:47
    Path : C:\usr\local\apps\notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : ON
    OS : Windows 10 (64-bit)
    Plugins : ComparePlugin.dll DSpellCheck.dll MarkdownViewerPlusPlus.dll mimeTools.dll NppConverter.dll NppExec.dll NppFTP.dll PythonScript.dll
    

    <?xml version="1.0" encoding="Windows-1252" ?>
    <NotepadPlus>
    	<AutoComplete>
    		<KeyWord name="PeterJonesAddedThis" />
    		<KeyWord name="PeterJonesAddedThat" />
    		<KeyWord name="PeterJonesAddedTheOther" />
    	</AutoComplete>
    </NotepadPlus>
    


  • @PeterJones

    intriguing …

    does yours work the way you expect, or the way I just described, for a file-extension that auto-selects the DemoUDL file-type? If it matches my behavior for you, then there might be a race condition where it’s not loading the DemoUDL.xml until some file is manually set

    it works correctly on my installed version, which i guess is what you’ve expected prior to your tests from today.

    this also made me very curious, as i don’t understand it yet.
    and as the tests i conducted before were on an installed x86 version 7.6.3. and yours were on a portable 7.6.3 x64, i’ve repeated all tests on the portable versions too (x86 and x64).
    i got the same, working as expected results.

    here is a step by step list of what i did.
    please check if i missed out on something vital:

    • i’ve created a new udl called DemoUDL in each of the portable versions.

    • i’ve created and saved a file called autocomplete.demoudl, instead of using an unsaved new 1 tab.

    • i associated the extension demoudl to the udl DemoUDL at language > define your language > DemoUDL > Ext.:

    • i’ve opened the file autocomplete.demoudl the following 3 ways:
      a) right click > open with notepad++
      b) drag and drop from explorer
      c) open file from within notepad++

    once opened, regardless how, autocomplete is working as expected, without the need to switch to normal text and back to DemoUDL

    here are the new screenshots of both x86 and x64 portable 7.6.3:

    x86:
    Imgur

    x64:
    Imgur

    and here’s my DemoUDL.xml file:

    <?xml version="1.0" encoding="Windows-1252" ?>
    <NotepadPlus>
    	<AutoComplete>
    		<KeyWord name="MetaWroteSomethingUseful" />
    		<KeyWord name="MetaWroteSomethingUseless" />
    		<KeyWord name="MetaWroteSomethingMeaningful" />
    		<KeyWord name="MetaWroteSomethingMeaningless" />
    		<KeyWord name="MetaWroteSomethingGroundbreaking" />
    		<KeyWord name="MetaWroteSomethingUtterlyAbsurd" />
    	</AutoComplete>
    </NotepadPlus>
    

    my x86 portable debug info:

    Notepad++ v7.6.3   (32-bit)
    Build time : Jan 27 2019 - 17:20:30
    Path : C:\Users\User\Desktop\npp.7.6.3.bin\notepad++.exe
    Admin mode : OFF
    Local Conf mode : ON
    OS : Windows 7 (64-bit)
    Plugins : DSpellCheck.dll LuaScript.dll mimeTools.dll NppConverter.dll NppExport.dll NppSnippets.dll _CustomizeToolbar.dll 
    

    my x64 portable debug info:

    Notepad++ v7.6.3   (64-bit)
    Build time : Jan 27 2019 - 17:16:47
    Path : C:\Users\User\Desktop\npp.7.6.3.bin.x64\notepad++.exe
    Admin mode : OFF
    Local Conf mode : ON
    OS : Windows 7 (64-bit)
    Plugins : DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll NppSnippets.dll XMLTools.dll 
    

    important note: we have to find out why it does behave differently on your machine, this would otherwise drive me bonkers 😉



  • btw: @scot-65

    sorry, we got a bit carried away from your own non auto-complete experience, my apologies for that.

    did you resolve your auto-completion already with any given information, or with anything else you’ve been able to find out ?



  • @Meta-Chuh ,

    You can rest easy. I made it work.

    Well, don’t rest too easy, because I don’t know exactly the root cause. :-)

    I unzipped a fresh portable x64, and followed your steps exactly, and it worked. So I went back to my main portable x64, removed the old autocompletion XML file, renamed userDefineLang.xml, opened Notepad++, created the UDL and associated it with demoudl extension, and it auto-completed as expected. I copied all the contents of my old userDefineLang.xml (one UDL at a time, expecting it might break on one of them) – even once my new userDefineLang.xml was identical to my old one, it continued to work. I deleted my new one, and renamed my old back to userDefineLang.xml, and it still worked as expected. I even played around with whether it was called DemoUDL.xml or demoudl.xml, but that didn’t influence it.

    So, either I was doing something differently before that I didn’t notice, or there was a funny character that somehow got into the demoudl.xml, or… I don’t know. Oh, I was using remote-desktop from a linux machine into my PC for the earlier tests, and now I’m actually directly on my PC. Maybe the next time I remote-desktop in, I’ll try it again – it might be that the remote-desktop was intercepting some windows notification-message that Notepad++ needed.

    The good news is, it’s working for me. Hopefully @scot-65 will be able to get it to work.



  • Hi Meta and Peter,

    Reading thru what you two have mentioned makes sense however,
    one basic question I ask(ed) is “By completely uninstalling NP++ and
    manually removing leftover files/folders, will a complete reinstall
    build the file/folder paths correctly?”

    What places to check for leftover files/folders after an uninstall?

    If so, then there are a few files I wish to hold onto so the transition
    is smooth.
    a) Preferences - what is this file name? Is it version-specific?
    b) stylers.xml
    c) userDefineLang.xml
    d) Any other that comes to mind?

    I ask this in hopes that future visitors viewing this thread can
    have a smooth transition to the new file/folder geometry.

    I did notice in my folder system the two places where plugins.
    Since “Plugin Admin” is now in the program’s core (or is it?),
    do I need to install the (old) plugin manager?

    Shall I wait for the release that will now have a dedicated folder
    for the separate UDL’s, to redo the install?

    I thank you both for your time.

    Scot-65



  • Preferences are scattered in lots of different files. But for an installed version, they should all be in %AppData%\Notepad++\ – including stylers.xml and userDefineLang.xml.

    After doing the uninstall, make sure that %ProgramData(x86)%\Notepad++ is completely deleted – no files or folders left. Then installing fresh should have everything you need in that directory.

    After that, you might want to try starting with @Meta-Chuh’s steps where he demonstrated to me how to get the UDL autocomplete to work. After that is working, then replicate the steps, but using your UDL’s name.

    You do not need (and should not install) the old Plugin Manager plugin, because it is not compatible with 7.6.3, and Plugins Admin works for 7.6.3.

    Whether you wait for the dedicated UDL folder is up to you, and how urgent your needs are. Since the dedicated-folder version will also read the old userDefineLang.xml, it shouldn’t be a problem to re-install now. (And selfishly, @Meta-Chuh and I are impatient to know if you’re able to get it working ;-) )



  • @scot-65

    indeed, we are both very selfishly impatient to get your system up and running 😉

    in addition, just to be safe, and to get the best, cleanest possible result:
    before you uninstall, and clean all folders, i would suggest to make a copy of your C:\Program Files (x86)\Notepad++ and %AppData%\Notepad++ folders (the later one contains your config.xml where your settings are stored) somewhere else, for example in a backup folder your desktop.

    this way you can restore anything we might have forgotten.

    then uninstall and delete all folders posted by @PeterJones.
    then check for any leftovers and delete C:\Program Files (x86)\Notepad++ and C:\Program Files\Notepad++ if any of those are left.

    then make a fresh install of notepad++ 7.6.3 x86, and start by conducting your auto completion tests with a simple DemoUDL like we did before you import anything from your old installation or install any further plugins.

    regarding plugins: it is recommended not to use your old plugins, but to reinstall them by using the built in “plugin manager” as stated by @PeterJones , just to be on the safe side, that they work on 7.6.3



  • reinstall them by using the built in “plugin manager”

    ITYM “by using the built in Plugins Admin” :-)



  • @PeterJones

    ITYM “by using the built in Plugins Admin” :-)

    omg (-‸ლ)

    after so many times of writing this same sentence, this confusion has finally managed to infect me as well 😂😂😂👍



  • >> we are both very selfishly impatient…

    OK folks, did a complete backup and uninstall.

    Checked the following locations for stray files/folders:

    • appdata/local - Manually removed a empty NP++ root folder (probably from an ancient install of NP++).
    • appdata/local low - None found.
    • appdata/roaming - Manually removed root NP++ folder (with UDL and plugin folder inside).
    • program files - None found.
    • program files (x86) - Manually removed the NP++ root folder.
    • program data - None found.

    Also looked inside the registry “HKLM/software” and found nothing.

    Did a fresh install of “npp.7.6.3.Installer.exe”.

    Checked to see if folder “C:\Program Files (x86)\Notepad++\autoCompletion”. OK, it’s there.

    Opened an HTML document to see if Auto-Complete is working. Yes it is.

    Yes, a fresh install of plugins was on my mind. I made a screen capture of the plugin manager to see what I had before the uninstall…

    I could hold up a glass and propose a toast to both of you, but I am not an extrovert. :-)

    Thanks for your help Peter and Meta.
    Scot-65



  • @PeterJones I was able to replicate the issue you had and tried to see if there is a resolve as to why an edited xml file cannot be seen for an existing file loaded in the NP++ editor.

    Observations:

    • Inserting a brand new xml (dcl.xml) into the autoCompletion folder everything worked as expected.
    • Closing NP++ then replacing the xml file with an edited version, then reopening NP++, the file did not recognize the edited xml at all!
    • Close the file, clear the recent files list, then closing NP++ and finally double-click to open the file, the edited xml was not recognized.
    • However, if the file exists but has no characters inside, the edited xml can be seen.
    • By beginning a new file, the edited xml file can be seen.

    One item I did not try is to relocate the file in a different folder, then double-click in the file manager to open.
    Another I did not try is to close NP++, delete the edited xml file, open NP++ (with file present), close NP++, reinsert the edited xml into the autoCompletion folder then reopen NP++.

    For now the only resolve when an edited xml file replaces another in the autoCompletion folder is to start a new file in the editor to check the work…

    Hope this helps.

    Scot-65


Log in to reply