-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scintilla autocomplete #42
Conversation
Thanks @vinsworldcom , Could you please check my example PoC built from this comment: #41 (comment) ? |
Your implementation does not exhibit the word highlighting issue that mine does. I like yours - comments further in #41 (comment) |
This still causes the selection to be visible which means it must be calling `getSelection()` still somewhere in the call path for `SciAutoComplete()`
If not found, we do not want to `ClearSelection()` as that can remove multi- caret. We also want the typed word for autocomplete to be at least 1 character so that `Space` doesn't trigger autocomplete for the full database.
If we're just typing in a file, Scintilla autocomplete is triggered and if there is no local or global database, we don't want to be prompted to create one just based on Scintilla trying to autocomplete.
ba96532
to
6006c1f
Compare
This PR has been updated to a relatively stable working beta that:
Finally, there should probably be an option to disable the feature completely - like checkbox in settings, along with the number of characters to trigger on:
Cheers. |
6006c1f
to
da469e2
Compare
da469e2
to
92b2176
Compare
This is temporary for testing until a better solution can be added to Settings window. The settings dialog should provide: + [] enable Scintilla autocomplete + [] ignore case + [__] from the nth character The character text box should accept 1-9 as valid characters. Or it could use a slider like the Notepad++ one, though that may be harder to implement. I think autocomplete ignore case should be different than definition and reference ignore case. With Def and Ref, I usually want the exact case match as I see an object in the code, deliberately click on it and then find the Def or Refs of that "exact" (i.e., case-sensitive) object. With autocomplete, I'm getting assitance from the "library" of available objects to help me find what I'm looking for. For example, is the "number of characters": + .length + .len + .Length + .Len + .size + is it a property, or does it end in `()` as a method, etc.. Autocomplete should provide more of a "fuzzy-find" (i.e., case- insensitive) match. Though others may think otherwise so there should be an option to make is case-sensitive, but that option should be different for "autocomplete" vs. "Defs and Refs".
Temporary for testing until adding a proper settings dialog switch.
I think next to work on here is to add a group box in the settings dialog titled Scintilla Autocomplete.
I'll try that later this week if I get time. For now, I'm running with this as my Notepad++ daily driver to see if any other unexpected issues arise. Looking good so far. Cheers. |
Still no way to add via Settings dialog, but can manually edit the local database config file. Have not yet added the read/write of the integer characters to act on.
Still no way to update in the Settings dialog, but this completes the variable settings required for Scintilla Autocomplete.
Use a pulldown combobox populated with values from 1-9.
@pnedev Cheers. |
Nice Vince, thank you. 👍 BR and Happy holidays! |
No worries, understood. I'm happy you have a very straightforward build process as I'm able to compile and test my fixes locally. I'm happy to keep running with my altered version now and if you never merge it, I can always pull your changes to get updates, recompile my Scintilla Autocomplete changes locally and run with that. Thank you for the support, keeping Notepad++ plugins alive and well! Happy holidays to you too! Cheers. |
This still causes the selection to be visible which means it must be calling `getSelection()` still somewhere in the call path for `SciAutoComplete()`
If not found, we do not want to `ClearSelection()` as that can remove multi- caret. We also want the typed word for autocomplete to be at least 1 character so that `Space` doesn't trigger autocomplete for the full database.
If we're just typing in a file, Scintilla autocomplete is triggered and if there is no local or global database, we don't want to be prompted to create one just based on Scintilla trying to autocomplete.
This is temporary for testing until a better solution can be added to Settings window. The settings dialog should provide: + [] enable Scintilla autocomplete + [] ignore case + [__] from the nth character The character text box should accept 1-9 as valid characters. Or it could use a slider like the Notepad++ one, though that may be harder to implement. I think autocomplete ignore case should be different than definition and reference ignore case. With Def and Ref, I usually want the exact case match as I see an object in the code, deliberately click on it and then find the Def or Refs of that "exact" (i.e., case-sensitive) object. With autocomplete, I'm getting assitance from the "library" of available objects to help me find what I'm looking for. For example, is the "number of characters": + .length + .len + .Length + .Len + .size + is it a property, or does it end in `()` as a method, etc.. Autocomplete should provide more of a "fuzzy-find" (i.e., case- insensitive) match. Though others may think otherwise so there should be an option to make is case-sensitive, but that option should be different for "autocomplete" vs. "Defs and Refs".
Temporary for testing until adding a proper settings dialog switch.
Still no way to add via Settings dialog, but can manually edit the local database config file. Have not yet added the read/write of the integer characters to act on.
Still no way to update in the Settings dialog, but this completes the variable settings required for Scintilla Autocomplete.
Use a pulldown combobox populated with values from 1-9.
The `SCIAUTOCLIST_LONG` is a the long length of the Scintilla auto-complete string where if the string is shorter, we do not query the database anymore and just keep reusing the existing string (optimization) until autocomplete is done (used or cancelled).
Needs update, so closing this PR. |
This is just a proof of concept showing it works. Please DO NOT merge this yet. There are still some issues with selection of word to determine autocomplete - it is slow and can lead to over-typing the selection if typing fast. But this does show the concept works.
It would also be nice to have a checkbox (
[ ] Use Scintilla Autocomplete
) in the settings to enable / disable this feature. You'd have a check of that option in theSCN_CHARADDED
:Fix #41
Cheers.