This changes code completion handling for when the new keyword can be used. If it is preceded by typeName identifier = and the typeName to a type with either a no arg constructor or an SObject then we replace the keyword suggestions by new typeName();
It might be possible to support other uses cases where new is being used, such as just assigning to vars, but this matches the feature request and is probably the most common case so I have just supported on declarations.
The PR has some improvements for typeName parsing as we were not handling whitespace very well.
This changes code completion handling for when the new keyword can be used. If it is preceded by
typeName identifier =
and the typeName to a type with either a no arg constructor or an SObject then we replace the keyword suggestions bynew typeName();
It might be possible to support other uses cases where
new
is being used, such as just assigning to vars, but this matches the feature request and is probably the most common case so I have just supported on declarations.The PR has some improvements for typeName parsing as we were not handling whitespace very well.