Bug 273721 - Web Inspector: getCompletionText should belong to a more generic class than CSSCompletions
Summary: Web Inspector: getCompletionText should belong to a more generic class than C...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Minor
Assignee: Qianlang Chen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-05-03 17:34 PDT by Qianlang Chen
Modified: 2024-05-03 17:34 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Qianlang Chen 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.
Comment 1 Radar WebKit Bug Importer 2024-05-03 17:34:32 PDT
<rdar://problem/127521031>