Feat: Ability to filter comments and strings from text completer#5233
Feat: Ability to filter comments and strings from text completer#5233mkslanc wants to merge 5 commits intoajaxorg:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## master #5233 +/- ## ========================================== + Coverage 87.23% 87.49% +0.26% ========================================== Files 565 581 +16 Lines 45248 45933 +685 Branches 6920 6958 +38 ========================================== + Hits 39470 40189 +719 + Misses 5778 5744 -34
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9d297d3 to c1cdbe0 Compare c1cdbe0 to ed90389 Compare src/autocomplete/text_completer.js Outdated
| return wordScores; | ||
| } | ||
| | ||
| function filterStringsFromCompletions(session, pos) { |
There was a problem hiding this comment.
since this has a different behaviour to wordDistance, I think it would make sense to add a basic test that verifies getting completions works as expected with filterStringsCompletions enabled.
There was a problem hiding this comment.
nit: the name of the function does not really represent what's going on, it returns wordScores for filtered strings so maybe getWordScoresForFilteredStrings would better suit it?
There was a problem hiding this comment.
This name really better suits purpose of function, but could you, please, clarify, which tests you are expecting? Current test is checking scenario with and without filterStringsCompletions
There was a problem hiding this comment.
We only test that with filterStringsCompletions enabled comments and doc comments are filtered out, but we don't test that completion works as expected with this option enabled and returns results in expected order (or something like that), since the logic now differs significantly.
Issue #, if available: #4100
Description of changes:
Add optional ability to filter all comments/string/doc-comments from text completer.
Option to turn it on -
editor.setOption("filterStringsCompletions", true);(by default it'sfalse)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.