NEW 273721
Web Inspector: getCompletionText should belong to a more generic class than CSSCompletions
https://bugs.webkit.org/show_bug.cgi?id=273721
Summary Web Inspector: getCompletionText should belong to a more generic class than C...
Qianlang Chen
Reported 2024-05-03 17:34:07 PDT
In the inspector's frontend code, there's a convenience function WI.CSSCompletions.getCompletionText to retrieve the display text of a `completion` variable that is either a String or a WI.QueryResult. Now, WI.QueryResult by its name implies that it can be used to filter code completion suggestions for any language, not just CSS. Therefore, the callers of WI.CSSCompletions.getCompletionText may not necessarily be dealing with suggestions specifically for CSS, and the function should probably be served by a class with a more generic name such as WI.Completions. See discussion [here](https://github.com/WebKit/WebKit/pull/26137/commits/c37407ab48a1ced442643f6a51bba738ce488cd6#diff-26a23acb61e6e02c7ca21f91c07aa423a41edae8d5c518329bd66259585af410), where in the PR CodeMirrorCompletionController tries to use WI.CSSCompletions.getCompletionText while not always suggesting CSS code, hinting at a possible need for this slight refactoring.
Attachments
Radar WebKit Bug Importer
Comment 1 2024-05-03 17:34:32 PDT
Note You need to log in before you can comment on or make changes to this bug.