reqable / re-editor

Re-Editor is a powerful lightweight text and code editor widget.
https://pub.dev/packages/re_editor
MIT License
527 stars 51 forks source link

Change autocomplete matching and highlight to fuzzy matching #51

Open svr2kos2 opened 1 month ago

svr2kos2 commented 1 month ago

There is one problem: when we type sink, the highlight result will be StringSink. This issue only involves the highlight behavior, and there’s no problem with the autocomplete result. I believe this problem falls under the match quality area. Maybe we should solve it when implementing other features related to match quality, such as result sorting, syntax analysis, or providing interfaces to integrate with existing code analyzers.

MegatronKing commented 4 weeks ago

Thank you, I can understand your code, but I think it is not a good idea to modify the matching logic directly. We should add some new implementation classes of CodePrompt instead of modifying the existing class.

svr2kos2 commented 4 weeks ago

Could you please clarify your concern? I don’t quite understand why we wouldn’t want to use a better matching method as the default. I’m willing to make some commits to accommodate your point of view.
Please let me know if you have any additional considerations.

MegatronKing commented 1 week ago

Sorry, I forget to reply this PR.

CodePrompt is a pure abstract class, an interface, you can implement this to write your own matching logic. If you are going to add default implementation inside this class, I don't think it is a good idea.