Make sure that environment passed to ContextSnippetGenerator is a ContextEnvironment