-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
var lastContext; | ||
var lastContext, | ||
matcher = null, // string matcher for hints | ||
prefs = PreferencesManager.getExtensionPrefs("CSSCodeHints"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need a pref for this? As long as the behavior we offer is not a cause for complaint (or something people reasonably disagree on), then I don't think a knob is needed.
Initial review done. |
@dangoor All feedback addressed ready to re-review. |
Hey @JeffryBooher, wow... small code change! Unfortunately, I think a bit more code change is required, though:
|
@@ -33,12 +33,15 @@ define(function (require, exports, module) { | |||
HTMLUtils = brackets.getModule("language/HTMLUtils"), | |||
LanguageManager = brackets.getModule("language/LanguageManager"), | |||
TokenUtils = brackets.getModule("utils/TokenUtils"), | |||
StringMatch = brackets.getModule("utils/StringMatch"), | |||
PreferencesManager = brackets.getModule("preferences/PreferencesManager"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need that module any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Point!
@dangoor basicStringMatch didn't do it. I'm going to have to write a custom sorter which i had thought about doing anyway. |
It looks like jsCodeHints makes its own sort functor to callback with penalizeUnderscoreValueCompare() We could do something similar to that in CSS code hints but we first want the needle to match 'ba' (background-*) matches first This may be difficult to do with a callback since we need the needle as well... |
@JeffryBooher The stringMatch function returns a value with a "matchGoodness" score. You need to hang on to that value for all of the matches and then sort on that. The |
@dangoor Tests fixed and fuzzyMatching should be on par with what's expected: "b-l-c" will get you "border-left-color" as the only option. "ml" will yield a list with "margin-left" at the top. |
@JeffryBooher Works great! The code duplication seems borderline for refactoring to eliminate the duplication, but I think it's small enough that this is fine. I'll go ahead and merge. Thanks for the nice addition! |
Adds fuzzy code hints to css editing:
Known issues:
shape-inside: circle( <-- presents shapes again. This exists in master because we don't set the context o