Community
Participate
Working Groups
When the completionProposal extension point was designed auto-activation characters were left out because we did not want to hard code auto activation characters into the extensions because they are controlled by user preferences. The solution then instead was to create the StructuredContentAssistProcessor which each content type then implemented using its own auto activation character preferences. This works fine assuming no one else wants to contribute auto-activation characters. This is not the case though because JSDT would like to supply auto activation characters for script regions. Currently this is being done by JSDT supplying a sourceViewerConfiguration for both the HTML and JSP content types which then uses a JSDT implementation of StructuredContentAssistProcessor to figure out the auto-activation character preferences. The problem with this approach is that the sourceViewerConfiguration was not designed to have multiple contributions for the same content type, which is what happens when both SSE and JSDT supply extensions for the HTML and JSP content types. The result is that its a crap-shoot which extension gets loaded, either the SSE version of the JSDT version. Thus sometimes the JSDT auto-activation works in script regions, and sometimes it does not. This then is not an acceptable solution. As suggested by Nitin a good solution would be to allow implementers of the completionProposal extension point to supply preference keys for auto-activation preferences for their computers. Though thinking this through more fully you would also need to know which preference store the keys need to be used in. Not sure if that is something that can be provided through extension point. But alternatively developing some interface adopters could implement with two methods "getAutoActivationCharicters" and "isAutoActivationEnabled" (or something like that) could also work. The sum of what is needed is JSDT needs some way to contribute auto activation characters for script regions for its computers.
Created attachment 181990 [details] patch
Created attachment 181991 [details] updated patch
With this patch, an implementer of the proposalComputer will have to set an autoActivationDelegate to be associated with the content type and partition type. This should ultimately allow us to deprecate the specific implementations of StructuredContentAssistProcessor that we have lying around, as they mostly just set up listeners for changes in the auto-activation preferences and return the appropriate auto-activation characters. The auto-activation delegate will likely add itself as a property listener to a preference store and update the array of characters to return for auto-activation. The dispose() method is invoked when the StructuredContentAssistProcessor is released.
Code checked in. Thanks, Nitin.