TextEditor: Fix handling of multiline text for code assistant

Task-number: QTCREATORBUG-8544
Change-Id: Ic0cffe941309ee38cc62111960c5ddad46025a8c
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
C++: fix support for nested anonymous class

The case when anonymous class is inside function. Fixed:
* highlighting
* completion

Task-number: QTCREATORBUG-11711
Change-Id: Ic8fc5fdfb1aed62a74bf148ab7ed449d08214dda
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>