Community
Participate
Working Groups
For completion proposals that implement all ICompletionProposalExtensions, org.eclipse.jface.text.contentassist.CompletionProposalPopup#handleSetData(Event) currently: - calls ICompletionProposalExtension6#getStyledDisplayString() and throws the returned value away - calls ICompletionProposalExtension7#emphasizeMatch(..) and uses the returned StyledString Problems: 1. getStyledDisplayString() should not be called if the result is not used 2. ICompletionProposalExtension6#getStyledDisplayString() and ICompletionProposal#getDisplayString() need to tell that ICompletionProposalExtension7 exists, and getStyledDisplayString() needs to tell that it's not used in that case 3. emphasizeMatch(..) is not a good API name. The method doesn't emphasize a match in an existing string, but it returns a new styled display string in which the matching characters should be emphasized. I see two possible solutions: 3.a) pass the result of getStyledDisplayString() as an additional parameter to emphasizeMatch(..) 3.b) rename the method to getStyledDisplayString(IDocument, int, BoldStylerProvider) or getEmphasizedStyledDisplayString(..) (though I prefer the getStyledDisplayString(..)). In this case, solutions for problems 1 and 2 need to be adjusted accordingly.
New Gerrit change created: https://git.eclipse.org/r/67038
New Gerrit change created: https://git.eclipse.org/r/67039
Renamed #emphasizeMatch(..) to #getStyledDisplayString(IDocument, int, BoldStylerProvider), avoided call to ICompletionProposalExtension6#getStyledDisplayString() when ICompletionProposalExtension7#getStyledDisplayString(..) is used and updated the Javadocs. Dani/Markus, please have a look.
Gerrit change https://git.eclipse.org/r/67038 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=2c9d9e8dafa4d12d37e78445ec3102468faee9ff
Gerrit change https://git.eclipse.org/r/67039 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=b3d832b6e30ca2ca6efafb8d49105aeec3d4f5a7