7.5.3 (x64) Where is the 'default' autocompletion dictionary? Can I copy, modify and use?
Like many folks, I get typos entered into the autocompletion dictionary. I sure would be nice to remove those; but, I can’t find the dictionary file. I’ve noticed references to “<Language name>.xml” located I presume here: C:\Program Files\Notepad++\plugins\APIs, and find nothing even remotely like eng.xml or english.xml or similar. I’m reading up on the wiki, but would love to find the right file before I continue.
So, where’s the file, because autocomplete is using something, and that file wherever has the errors in it. Persistent little bugger…
So, I’ve found, possibly, the answer to the last half of my question… but where’s the file, do I need to make it, if so, what am I using that has the typos in it. ex: Instead of typing, for the first time, ‘CreateFrame’, I typed ‘CreateFram’ a typo… and because it’s short by one letter, always the first choice for autocomplete… I’d hate to think I have to click or use down arrow to select it forever…
It goes without saying… thanks ahead of time for any help!
There are two types of auto completion mechanism.
The programming language dependent and, I assume,
what you called the “default” one.
The programming language dependent is stored under API directory
and can be modified. The “default” one is dynamically created
when you type but, afaik, it does only behave like you described
when you do not correct your mistake.
Taking your example, when you have written a line like
the auto completion box will keep it as long as you do not modify it to
Once this is done CreateFram is no longer in the auto completion list.
At least this is how it works for me.
So, if I’m understanding you correctly, if the CreateFrame is built into the programming language, it won’t store the poor spelling, and will offer an autocompletion as CreateFrame, and not CreateFram, so it won’t hold onto the CreatFram because it’s stored ‘correctly’ as language dependant, in this case to .lua
But, if it’s the ‘default one’ then it will fix it, if i correct it immediately; if however, it went through a save stored incorrectly, it will always remember that one, and there’s no editing it?
So, we live with our error forever?!
Did I get that right? Because apparently, though I did ultimately correct it, it wasn’t until I reopened the session /file and caught it… so I get punished with that error forever? ;-) Sounds like an oversite, or a bug to me!
Or, if I could add it to the .lua file as part of the language dependency, then that ‘will’/‘might’ fix it? y/n? Because I’m not sure if it’s .lua dependent, though I suspect it is not; it is part of the language dependent framework in which I’m programming as an interface within the program/game that will use it.
So, I have to retract… apparently, this typo had propagated through several backup iterations of the code, and the reason I was seeing it, apparently, was I hadn’t saved the change, like I thought?! Now that it has changed, it’s gone. In a new file, this autocomplete keyword doesn’t even exist, so it’s part of the default… and once I changed it in the original, that file no longer shows the typo, just as you said.
So, no bug, it now looks like a great feature! I can see if I’ve misspelled a word in the document, and if it shows in Autocomplete, then I know it exists in the document… somewhere. Which is awesome!
yep - you got it :-)
OK, so now I know it’s not in autocompletion, I found the english.xml file, it’s under /localization instead of /api as the wiki indicated. Guess everyone could edit that, but, I’d like to confirm before I do that, or clarify it by adding location for 7.5.3(x64).
Now that I’ve found it, it doesn’t look that easy to add words to the language… Or am I mistaking that file for the one governing my .lua keywords. If it’s not too problematic, I would like to make a branch of .lua that covers my personal needs… until it proves useful, then share if it does.
Can I get a clue about where this ‘programming language dependent’ file is located, and how I might go about understanding the structure? I can probably eventually find it, so just a clue for the latter would suffice. Thanks.
Gack! english.xml has nothing to do with autocomplete! o.O but, ironically, I think I’m learning some .xml :-)
Many thanks to Claudia Frank!
aha, I see… I think… “functionList.xml”, and there’s none for .lua, or specifically in my case, perhaps a .lua_WoW…
Brain hurts a lot… but, would need to learn and add here… (sigh) it’s a start. There appears to be no .lua function completion .xml. In the english.xml - a “Here be dragons” warning… with a “Keep out!” which I’ll heed… but basic .lua stuff here.
But, I see I have a long way to go; still, exploration has started, seeing what’s up here with various aspects of notepad++, and perhaps, whatever I do here will be a work in progress for quite some time… at least until I could contribute anything useful. :-(
@ 63yrs of age, I can still (gratefully) handle a pretty steep learning curve… but, yes… slowing down just a bit… got some handy links now, to make progress. At least your responses actually encouraged me to take a peek under the hood. I always say, when it comes to programming and languages… I’ve forgotten more than I know; but, what I do have embedded is a pretty comprehensive concept of structures in languages. This can and does go a long ways… and xml is not that hard to read…, and I see the .xml scintilla structures (I think)… and function parsers (I know)… and how this is implemented… just a wee bit with my head peeking at the surface of what pokes out… under the hood.
no no, the functionlist.xml isn’t what you are looking for, at least I assume.
You are looking for the API xml files which are stored under
There is no default one for lua you either have to download one from the web
or create it yourself. (I was under the impression you already have downloaded one)
The functionlist.xml is for showing the functions defined in the current program.
Basically you declare regex to search your current code and display the matches in the
function list window in a tree form.
this is what functionlist offers
and this is, what I assume, you are looking for - auto-completion
On windows it is looking much nicer - this is one of the quirks when running npp on linux.
I see what you’re saying @Claudia-Frank… so please wrap me up here (please… and thank you of course)
Ah, I see… yes the first would be very helpful… So, the lang.xml & functionList.xml go hand in hand. (in this case) lua.xml (which I’d have to make) in the ./plugins/APIs/ and functionList.xml to parse the list and selection. Does this also require a PlugIn .dll or would that only be if I need more than a parse and lookup. Or would the alone provide the list… I guess it’s still not completely clear.
So, to have parsing the language functions the components are: (for lua)
lua.xml which is the list of functions and descriptions
modify functionList .xml which is used to display and parse the list of functions
?? PlugIn.dll if I need more, or to interpret or parse the whole line… or display something else, or… or…
lang.xml (Python) in action… using both lang.xml and functionList.xml?
I’m seeing what the lang.xml does
As a starting point you might checkout this: http://ageekandhisblog.com/notepad-plugin-lua-corona-api-autocompletion/
langs.xml is provided to scintilla, the edit control notepad++ uses, which does all the coloring an folding.
If, for example, lua is evolving to version X and introduces new keywords then one has to edit this file
an add the keywords to let scintilla know that those new words need to be colored as well. But I would
avoid editing this file directly, use the StyleConfigurator instead.
functionlist.xml is used by npp. By defining languages specific regular expressions, npp is able
to scan the current document open and outline the matches from the regular expression in a tree-view like manner.
One would edit functionlist.xml when the programming language used hasn’t the needed regular expression yet or
when an already supported programming language needs to be enhanced by new functionality.
Let’s say you want to see the pythons doc strings in the functionlist window as well.
API.xml (API needs to be replaced by the language specific word) is used by npp to provide language dependent
auto completion and hints. Like you can also fade in a window explaining the syntax of a command which, of course,
has to be added to the API.xml beforehand. A good starting point, also not maintained anymore, to find
some api files is http://docs.notepad-plus-plus.org/index.php/User_Defined_Language_Files
stylers.xml is used by npp to get the information how to style certain words, like keyword open should
be colored in blue use bold font with size 10… This can be set as an general rule or per language but,
again, don’t edit this file directly but use StyleConfigurator instead.
I hope I was able to clarify the usage of the different xml files a little bit more.
Those files, when available, are used by npp automatically. No additional plugins needed but
this doesn’t mean a language specific plugin doesn’t provide additional features you might
want to have.
By George, I think I’ve got it! Yes, I’ll look for a language specific API.xml first. The code seems straight forward, and my xml is improving daily. Clear on the Scintilla langs.xml (I was confusing programming languages with native languages we speak) Naturally I’ll stay out of files marked, do not change, or even “Here be Dragons”, though it didn’t keep me out of Microsoft’s registry. lol
Yes, I’m already using the Style Configurator… And I just realized that some of the things I was looking for are under the Global Styles, for changing color… (no wonder I couldn’t find them under the language). Here though, I’d worry about conflicting colors with a global change.
I like the idea of a plugin. It’s been a while since I wrote a .dll. I was once proficient in C, C++ (no C#) Nothing a good ‘dictionary’ and 'syntax" reference can’t solve. Of course, a savvy IDE wouldn’t hurt either… but don’t get me wrong… I love my Notepad++, been a fan for years… Best (more than basic) editor around, IMHO. I’ve been using it for since I can remember, it’s about time I poked under the hood… it’s fairly friendly that way IMO, awesome!.
That does clarify it pretty much. I can’t Thank you enough for all the help, much appreciated. I may be a newbie here; but, I’m anything but when it comes to… well… a lot. I hope for many more productive years… Somehow I’ve managed to make programming and development a hobby, as well as a profession…