Disable templates that are available on "TOP_LEVEL" in scripts

This commit is contained in:
Pavel V. Talanov
2016-06-20 16:01:17 +03:00
parent c3df743a28
commit be1e8fcfda
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -118,6 +118,9 @@ public abstract class KotlinTemplateContextType extends TemplateContextType {
|| e instanceof KtClassOrObject) {
return false;
}
if (e instanceof KtScriptInitializer) {
return false;
}
e = e.getParent();
}
return true;