1. Consider I have a root concept ClassRoom whose contents are IClassContent[0...n] (an interface).
2. Two classes namely Student & Board implement IClassContent.
Now in code completion if we press Ctrl+Space at content of classroom, we are getting two entries.(aliases of both Student & Board which are student & board respectively).
Now i want to show the code completion entry for Student, only when a flag is enabled. So i have created a default substitute menu for concept as shown.
But this doesn't show the entry when we press Ctrl+Space without typing anything. Earlier both entries(student and board) will be shown in the code-completion menu. So i modified the return statement as
return pattern.equals(conceptAlias) || pattern.isEmpty;
Now the entry is shown in code completion menu. But as soon as i type s , the Student node is created. I found that second condition pattern.isEmpty is true now and hence the node is created.
But the expected behavior is the node should be created only when complete 'student' is typed(Need the default behavior exhibited before the introduction of substitute menu). How to achieve this?