Bug 273721

Summary: Web Inspector: getCompletionText should belong to a more generic class than CSSCompletions
Product: WebKit Reporter: Qianlang Chen <qianlangchen>
Component: Web InspectorAssignee: Qianlang Chen <qianlangchen>
Status: NEW ---    
Severity: Minor CC: inspector-bugzilla-changes, qianlangchen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   

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>