From ee3312fb000e40fc72da4014a9b40faafaddf25f Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Fri, 10 Jan 2014 22:42:47 +0400 Subject: [PATCH] Got rid of "namespace" word in plugin code. --- idea/resources/liveTemplates/Kotlin.xml | 22 +++++++++---------- idea/src/META-INF/plugin.xml | 2 +- .../jetbrains/jet/plugin/JetBundle.properties | 4 ++-- .../plugin/JetQuickDocumentationProvider.java | 6 ++--- .../caches/JetFromJavaDescriptorHelper.java | 10 ++++----- .../jet/plugin/caches/JetShortNamesCache.java | 4 ++-- .../jet/plugin/codeInsight/TipsManager.java | 4 ++-- .../upDownMover/JetDeclarationMover.java | 4 ++-- .../plugin/debugger/JetPositionManager.java | 10 ++++----- .../plugin/filters/JetExceptionFilter.java | 4 ++-- .../FunctionsHighlightingVisitor.java | 2 +- .../highlighter/JetColorSettingsPage.java | 16 +++++++------- .../highlighter/JetHighlightingColors.java | 4 ++-- .../PropertiesHighlightingVisitor.java | 4 ++-- .../liveTemplates/JetTemplateContextType.java | 6 ++--- .../plugin/project/ResolveElementCache.java | 10 ++++----- .../plugin/quickfix/ImportInsertHelper.java | 2 +- .../JetRefactoringBundle.properties | 2 +- .../JetIntroduceVariableHandler.java | 2 +- .../jet/plugin/util/DebuggerUtils.java | 6 ++--- 20 files changed, 62 insertions(+), 62 deletions(-) diff --git a/idea/resources/liveTemplates/Kotlin.xml b/idea/resources/liveTemplates/Kotlin.xml index 53c46e1b935..f5f8feb7363 100644 --- a/idea/resources/liveTemplates/Kotlin.xml +++ b/idea/resources/liveTemplates/Kotlin.xml @@ -4,7 +4,7 @@ name="main" toReformat="true" toShortenFQNames="true" value="fun main(args : Array<String>) { $END$ }"> - @@ -71,7 +71,7 @@ @@ -119,7 +119,7 @@ @@ -159,7 +159,7 @@ @@ -193,7 +193,7 @@ name="psvm" toReformat="true" toShortenFQNames="true" value="fun main(args : Array<String>) { $END$ }"> - diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 140e556e210..d4be8a190bc 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -226,7 +226,7 @@ - + diff --git a/idea/src/org/jetbrains/jet/plugin/JetBundle.properties b/idea/src/org/jetbrains/jet/plugin/JetBundle.properties index e773d574bd0..b123e23e010 100644 --- a/idea/src/org/jetbrains/jet/plugin/JetBundle.properties +++ b/idea/src/org/jetbrains/jet/plugin/JetBundle.properties @@ -124,14 +124,14 @@ options.jet.attribute.descriptor.var=Var (mutable variable, parameter or propert options.jet.attribute.descriptor.local.variable=Local variable or value options.jet.attribute.descriptor.captured.variable=Variables and values captured in a closure options.jet.attribute.descriptor.instance.property=Instance property -options.jet.attribute.descriptor.namespace.property=Package-level property +options.jet.attribute.descriptor.package.property=Package-level property options.jet.attribute.descriptor.property.with.backing=Property with backing field options.jet.attribute.descriptor.backing.field.access=Backing field access options.jet.attribute.descriptor.extension.property=Extension property options.jet.attribute.descriptor.it=Function literal default parameter options.jet.attribute.descriptor.fun=Function declaration options.jet.attribute.descriptor.fun.call=Function call -options.jet.attribute.descriptor.namespace.fun.call=Package-level function call +options.jet.attribute.descriptor.package.fun.call=Package-level function call options.jet.attribute.descriptor.extension.fun.call=Extension function call options.jet.attribute.descriptor.constructor.call=Constructor call options.jet.attribute.descriptor.variable.as.function.call=Variable as function call diff --git a/idea/src/org/jetbrains/jet/plugin/JetQuickDocumentationProvider.java b/idea/src/org/jetbrains/jet/plugin/JetQuickDocumentationProvider.java index d1adf128ff9..ac7927aa7f0 100644 --- a/idea/src/org/jetbrains/jet/plugin/JetQuickDocumentationProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/JetQuickDocumentationProvider.java @@ -36,10 +36,10 @@ import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache; import org.jetbrains.jet.renderer.DescriptorRenderer; public class JetQuickDocumentationProvider extends AbstractDocumentationProvider { - private static final Predicate SKIP_WHITESPACE_AND_EMPTY_NAMESPACE = new Predicate() { + private static final Predicate SKIP_WHITESPACE_AND_EMPTY_PACKAGE = new Predicate() { @Override public boolean apply(PsiElement input) { - // Skip empty namespace because there can be comments before it + // Skip empty package because there can be comments before it // Skip whitespaces return (input instanceof JetPackageDirective && input.getChildren().length == 0) || input instanceof PsiWhiteSpace; } @@ -136,7 +136,7 @@ public class JetQuickDocumentationProvider extends AbstractDocumentationProvider @Nullable private static KDoc findElementKDoc(@NotNull JetElement element) { - PsiElement comment = JetPsiUtil.skipSiblingsBackwardByPredicate(element, SKIP_WHITESPACE_AND_EMPTY_NAMESPACE); + PsiElement comment = JetPsiUtil.skipSiblingsBackwardByPredicate(element, SKIP_WHITESPACE_AND_EMPTY_PACKAGE); return comment instanceof KDoc ? (KDoc) comment : null; } diff --git a/idea/src/org/jetbrains/jet/plugin/caches/JetFromJavaDescriptorHelper.java b/idea/src/org/jetbrains/jet/plugin/caches/JetFromJavaDescriptorHelper.java index 7c99f178047..b0f949a2ae4 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/JetFromJavaDescriptorHelper.java +++ b/idea/src/org/jetbrains/jet/plugin/caches/JetFromJavaDescriptorHelper.java @@ -51,10 +51,10 @@ public class JetFromJavaDescriptorHelper { /** * Get java equivalents for jet top level classes. */ - static Collection getClassesForJetNamespaces(Project project, GlobalSearchScope scope) { + static Collection getClassesForKotlinPackages(Project project, GlobalSearchScope scope) { /* Will iterate through short name caches - Kotlin namespaces from jar a class files will be collected from java cache - Kotlin namespaces classes from sources will be collected with JetShortNamesCache.getClassesByName */ + Kotlin packages from jar a class files will be collected from java cache + Kotlin package classes from sources will be collected with JetShortNamesCache.getClassesByName */ return getClassesByAnnotation(KotlinPackage.class.getSimpleName(), project, scope); } @@ -64,8 +64,8 @@ public class JetFromJavaDescriptorHelper { static Collection getPossiblePackageDeclarationsNames(Project project, GlobalSearchScope scope) { Collection result = new ArrayList(); - for (PsiClass jetNamespaceClass : getClassesForJetNamespaces(project, scope)) { - for (PsiMethod psiMethod : jetNamespaceClass.getMethods()) { + for (PsiClass packageClass : getClassesForKotlinPackages(project, scope)) { + for (PsiMethod psiMethod : packageClass.getMethods()) { if (psiMethod.getModifierList().hasModifierProperty(PsiModifier.STATIC)) { result.add(psiMethod.getName()); } diff --git a/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java b/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java index 9bcf4cf1ccd..1f739c0233b 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java +++ b/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java @@ -87,7 +87,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { public String[] getAllClassNames() { Collection classNames = JetShortClassNameIndex.getInstance().getAllKeys(project); - // .namespace classes can not be indexed, since they have no explicit declarations + // package classes can not be indexed, since they have no explicit declarations IDELightClassGenerationSupport lightClassGenerationSupport = IDELightClassGenerationSupport.getInstanceForIDE(project); Set packageClassShortNames = lightClassGenerationSupport.getAllPossiblePackageClasses(GlobalSearchScope.allScope(project)).keySet(); @@ -107,7 +107,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { IDELightClassGenerationSupport lightClassGenerationSupport = IDELightClassGenerationSupport.getInstanceForIDE(project); MultiMap packageClasses = lightClassGenerationSupport.getAllPossiblePackageClasses(scope); - // .namespace classes can not be indexed, since they have no explicit declarations + // package classes can not be indexed, since they have no explicit declarations Collection fqNames = packageClasses.get(name); if (!fqNames.isEmpty()) { for (FqName fqName : fqNames) { diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/TipsManager.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/TipsManager.java index e0ac6d0b3ed..2a8e172d2d5 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/TipsManager.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/TipsManager.java @@ -177,7 +177,7 @@ public final class TipsManager { public boolean apply(DeclarationDescriptor declarationDescriptor) { if (declarationDescriptor instanceof PackageViewDescriptor) { // Heuristic: we don't want to complete "System" in "package java.lang.Sys", - // so we find class of the same name as namespace, we exclude this namespace + // so we find class of the same name as package, we exclude this package PackageViewDescriptor parent = ((PackageViewDescriptor) declarationDescriptor).getContainingDeclaration(); if (parent != null) { JetScope parentScope = parent.getMemberScope(); @@ -195,7 +195,7 @@ public final class TipsManager { @NotNull JetScope externalScope, @NotNull final ReceiverValue receiverValue ) { - // It's impossible to add extension function for namespace + // It's impossible to add extension function for package JetType receiverType = receiverValue.getType(); if (receiverType instanceof PackageType) { return new HashSet(descriptors); diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java index cf30f05f09f..7a6e81010c5 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java @@ -204,7 +204,7 @@ public class JetDeclarationMover extends AbstractJetUpDownMover { // element may move only into class body else { PsiElement adjustedSibling = sibling; - if (adjustedSibling instanceof PsiComment || isEmptyNamespaceHeader(adjustedSibling)) { + if (adjustedSibling instanceof PsiComment || isEmptyPackageDirective(adjustedSibling)) { adjustedSibling = PsiTreeUtil.getNextSiblingOfType(adjustedSibling, JetDeclaration.class); } @@ -258,7 +258,7 @@ public class JetDeclarationMover extends AbstractJetUpDownMover { return start != null && end != null ? new LineRange(start, end, editor.getDocument()) : null; } - private static boolean isEmptyNamespaceHeader(PsiElement adjustedSibling) { + private static boolean isEmptyPackageDirective(PsiElement adjustedSibling) { return adjustedSibling instanceof JetPackageDirective && adjustedSibling.getTextLength() == 0; } diff --git a/idea/src/org/jetbrains/jet/plugin/debugger/JetPositionManager.java b/idea/src/org/jetbrains/jet/plugin/debugger/JetPositionManager.java index d03a41eaa30..e63081d8d09 100644 --- a/idea/src/org/jetbrains/jet/plugin/debugger/JetPositionManager.java +++ b/idea/src/org/jetbrains/jet/plugin/debugger/JetPositionManager.java @@ -131,8 +131,8 @@ public class JetPositionManager implements PositionManager { @Override @SuppressWarnings("unchecked") public void run() { - JetFile namespace = (JetFile) sourcePosition.getFile(); - JetTypeMapper typeMapper = prepareTypeMapper(namespace); + JetFile file = (JetFile) sourcePosition.getFile(); + JetTypeMapper typeMapper = prepareTypeMapper(file); PsiElement element = PsiTreeUtil.getParentOfType(sourcePosition.getElementAt(), JetClassOrObject.class, JetFunctionLiteral.class, JetNamedFunction.class); if (element instanceof JetClassOrObject) { @@ -154,7 +154,7 @@ public class JetPositionManager implements PositionManager { } if (result.isNull()) { - result.set(PackageCodegen.getPackagePartInternalName(namespace)); + result.set(PackageCodegen.getPackagePartInternalName(file)); } } }); @@ -186,12 +186,12 @@ public class JetPositionManager implements PositionManager { AnalyzeExhaust analyzeExhaust = AnalyzerFacadeWithCache.analyzeFileWithCache(file); analyzeExhaust.throwIfError(); - Collection namespaceFiles = JetFilesProvider.getInstance(file.getProject()).allPackageFiles().fun(file); + Collection packageFiles = JetFilesProvider.getInstance(file.getProject()).allPackageFiles().fun(file); DelegatingBindingTrace bindingTrace = new DelegatingBindingTrace(analyzeExhaust.getBindingContext(), "trace created in JetPositionManager"); JetTypeMapper typeMapper = new JetTypeMapper(bindingTrace, ClassBuilderMode.FULL); //noinspection unchecked - CodegenBinding.initTrace(bindingTrace, namespaceFiles); + CodegenBinding.initTrace(bindingTrace, packageFiles); return new Result(typeMapper, PsiModificationTracker.MODIFICATION_COUNT); } }, false); diff --git a/idea/src/org/jetbrains/jet/plugin/filters/JetExceptionFilter.java b/idea/src/org/jetbrains/jet/plugin/filters/JetExceptionFilter.java index b33922c21a1..73daff8188d 100644 --- a/idea/src/org/jetbrains/jet/plugin/filters/JetExceptionFilter.java +++ b/idea/src/org/jetbrains/jet/plugin/filters/JetExceptionFilter.java @@ -57,7 +57,7 @@ public class JetExceptionFilter implements Filter { // fullyQualifiedName is of format "package.Class$Inner" String fullyQualifiedName = element.getClassName(); - // All classes except 'namespace' and its inner classes are handled correctly in the default ExceptionFilter + // All classes except package classes and its inner classes are handled correctly in the default ExceptionFilter if (!isPackageClassOrSubClass(fullyQualifiedName)) { return null; } @@ -88,7 +88,7 @@ public class JetExceptionFilter implements Filter { return packageClassName.equals(className); } - // Matches strings like "\tat test.namespace$foo$f$1.invoke(a.kt:3)\n" + // Matches strings like "\tat test.TestPackage$foo$f$1.invoke(a.kt:3)\n" private static final Pattern STACK_TRACE_ELEMENT_PATTERN = Pattern.compile("^\\s*at\\s+(.+)\\.(.+)\\((.+):(\\d+)\\)\\s*$"); @Nullable diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java b/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java index 377c4697a7c..7c915e9d202 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java @@ -81,7 +81,7 @@ public class FunctionsHighlightingVisitor extends AfterAnalysisHighlightingVisit FunctionDescriptor fun = (FunctionDescriptor) calleeDescriptor; JetPsiChecker.highlightName(holder, callee, JetHighlightingColors.FUNCTION_CALL); if (DescriptorUtils.isTopLevelDeclaration(fun)) { - JetPsiChecker.highlightName(holder, callee, JetHighlightingColors.NAMESPACE_FUNCTION_CALL); + JetPsiChecker.highlightName(holder, callee, JetHighlightingColors.PACKAGE_FUNCTION_CALL); } if (fun.getReceiverParameter() != null) { JetPsiChecker.highlightName(holder, callee, JetHighlightingColors.EXTENSION_FUNCTION_CALL); diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/JetColorSettingsPage.java b/idea/src/org/jetbrains/jet/plugin/highlighter/JetColorSettingsPage.java index 7f17157f92d..f68f24368b6 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/JetColorSettingsPage.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/JetColorSettingsPage.java @@ -59,23 +59,23 @@ public class JetColorSettingsPage implements ColorSettingsPage { "[Deprecated]\n" + "public class MyClass<out T : Iterable<T>>(var prop1 : Int) {\n" + " fun foo(nullable : String?, r : Runnable, f : () -> Int, fl : FunctionLike) {\n" + - " println(\"length\\nis ${nullable?.length} \\e\")\n" + + " println(\"length\\nis ${nullable?.length} \\e\")\n" + " val ints = java.util.ArrayList(2)\n" + " ints[0] = 102 + f() + fl()\n" + " val myFun = { -> \"\" };\n" + " var ref = ints.size()\n" + - " if (!ints.empty) {\n" + - " ints.forEach @lit {\n" + + " if (!ints.empty) {\n" + + " ints.forEach @lit {\n" + " if (it == null) return @lit\n" + - " println(it + ref)\n" + + " println(it + ref)\n" + " }\n" + " }\n" + " }\n" + "}\n" + "\n" + - "var globalCounter : Int = 5\n" + + "var globalCounter : Int = 5\n" + " get() {\n" + - " return $globalCounter\n" + + " return $globalCounter\n" + " }\n" + "\n" + "public abstract class Abstract {\n" + @@ -142,7 +142,7 @@ public class JetColorSettingsPage implements ColorSettingsPage { new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.captured.variable"), JetHighlightingColors.WRAPPED_INTO_REF), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.instance.property"), JetHighlightingColors.INSTANCE_PROPERTY), - new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.namespace.property"), JetHighlightingColors.NAMESPACE_PROPERTY), + new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.package.property"), JetHighlightingColors.PACKAGE_PROPERTY), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.property.with.backing"), JetHighlightingColors.PROPERTY_WITH_BACKING_FIELD), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.backing.field.access"), JetHighlightingColors.BACKING_FIELD_ACCESS), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.extension.property"), JetHighlightingColors.EXTENSION_PROPERTY), @@ -150,7 +150,7 @@ public class JetColorSettingsPage implements ColorSettingsPage { new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.it"), JetHighlightingColors.FUNCTION_LITERAL_DEFAULT_PARAMETER), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.fun"), JetHighlightingColors.FUNCTION_DECLARATION), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.fun.call"), JetHighlightingColors.FUNCTION_CALL), - new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.namespace.fun.call"), JetHighlightingColors.NAMESPACE_FUNCTION_CALL), + new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.package.fun.call"), JetHighlightingColors.PACKAGE_FUNCTION_CALL), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.extension.fun.call"), JetHighlightingColors.EXTENSION_FUNCTION_CALL), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.constructor.call"), JetHighlightingColors.CONSTRUCTOR_CALL), new AttributesDescriptor(JetBundle.message("options.jet.attribute.descriptor.variable.as.function.call"), JetHighlightingColors.VARIABLE_AS_FUNCTION_CALL), diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/JetHighlightingColors.java b/idea/src/org/jetbrains/jet/plugin/highlighter/JetHighlightingColors.java index 4a2e44124e9..0af67cf10f0 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/JetHighlightingColors.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/JetHighlightingColors.java @@ -61,7 +61,7 @@ public class JetHighlightingColors { public static final TextAttributesKey PARAMETER = createTextAttributesKey("KOTLIN_PARAMETER", CodeInsightColors.PARAMETER_ATTRIBUTES); public static final TextAttributesKey WRAPPED_INTO_REF = createTextAttributesKey("KOTLIN_WRAPPED_INTO_REF", CodeInsightColors.IMPLICIT_ANONYMOUS_CLASS_PARAMETER_ATTRIBUTES); public static final TextAttributesKey INSTANCE_PROPERTY = createTextAttributesKey("KOTLIN_INSTANCE_PROPERTY", CodeInsightColors.INSTANCE_FIELD_ATTRIBUTES); - public static final TextAttributesKey NAMESPACE_PROPERTY = createTextAttributesKey("KOTLIN_NAMESPACE_PROPERTY", CodeInsightColors.STATIC_FIELD_ATTRIBUTES); + public static final TextAttributesKey PACKAGE_PROPERTY = createTextAttributesKey("KOTLIN_PACKAGE_PROPERTY", CodeInsightColors.STATIC_FIELD_ATTRIBUTES); public static final TextAttributesKey PROPERTY_WITH_BACKING_FIELD = createTextAttributesKey("KOTLIN_PROPERTY_WITH_BACKING_FIELD"); public static final TextAttributesKey BACKING_FIELD_ACCESS = createTextAttributesKey("KOTLIN_BACKING_FIELD_ACCESS"); public static final TextAttributesKey EXTENSION_PROPERTY = createTextAttributesKey("KOTLIN_EXTENSION_PROPERTY"); @@ -70,7 +70,7 @@ public class JetHighlightingColors { public static final TextAttributesKey FUNCTION_LITERAL_DEFAULT_PARAMETER = createTextAttributesKey("KOTLIN_CLOSURE_DEFAULT_PARAMETER"); public static final TextAttributesKey FUNCTION_DECLARATION = createTextAttributesKey("KOTLIN_FUNCTION_DECLARATION", CodeInsightColors.METHOD_DECLARATION_ATTRIBUTES); public static final TextAttributesKey FUNCTION_CALL = createTextAttributesKey("KOTLIN_FUNCTION_CALL", CodeInsightColors.METHOD_CALL_ATTRIBUTES); - public static final TextAttributesKey NAMESPACE_FUNCTION_CALL = createTextAttributesKey("KOTLIN_NAMESPACE_FUNCTION_CALL", CodeInsightColors.STATIC_METHOD_ATTRIBUTES); + public static final TextAttributesKey PACKAGE_FUNCTION_CALL = createTextAttributesKey("KOTLIN_PACKAGE_FUNCTION_CALL", CodeInsightColors.STATIC_METHOD_ATTRIBUTES); public static final TextAttributesKey EXTENSION_FUNCTION_CALL = createTextAttributesKey("KOTLIN_EXTENSION_FUNCTION_CALL"); public static final TextAttributesKey CONSTRUCTOR_CALL = createTextAttributesKey("KOTLIN_CONSTRUCTOR", CodeInsightColors.CONSTRUCTOR_CALL_ATTRIBUTES); public static final TextAttributesKey VARIABLE_AS_FUNCTION_CALL = createTextAttributesKey("KOTLIN_VARIABLE_AS_FUNCTION"); diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/PropertiesHighlightingVisitor.java b/idea/src/org/jetbrains/jet/plugin/highlighter/PropertiesHighlightingVisitor.java index 83b1e9cb941..218a2099b0f 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/PropertiesHighlightingVisitor.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/PropertiesHighlightingVisitor.java @@ -78,9 +78,9 @@ class PropertiesHighlightingVisitor extends AfterAnalysisHighlightingVisitor { private void highlightProperty(@NotNull PsiElement elementToHighlight, @NotNull PropertyDescriptor descriptor, boolean withBackingField) { - boolean namespace = DescriptorUtils.isTopLevelDeclaration(descriptor); + boolean inPackage = DescriptorUtils.isTopLevelDeclaration(descriptor); JetPsiChecker.highlightName(holder, elementToHighlight, - namespace ? JetHighlightingColors.NAMESPACE_PROPERTY : JetHighlightingColors.INSTANCE_PROPERTY + inPackage ? JetHighlightingColors.PACKAGE_PROPERTY : JetHighlightingColors.INSTANCE_PROPERTY ); if (descriptor.getReceiverParameter() != null) { JetPsiChecker.highlightName(holder, elementToHighlight, JetHighlightingColors.EXTENSION_PROPERTY); diff --git a/idea/src/org/jetbrains/jet/plugin/liveTemplates/JetTemplateContextType.java b/idea/src/org/jetbrains/jet/plugin/liveTemplates/JetTemplateContextType.java index 1ea1ba0114f..100155d8ed6 100644 --- a/idea/src/org/jetbrains/jet/plugin/liveTemplates/JetTemplateContextType.java +++ b/idea/src/org/jetbrains/jet/plugin/liveTemplates/JetTemplateContextType.java @@ -81,9 +81,9 @@ public abstract class JetTemplateContextType extends TemplateContextType { } } - public static class Namespace extends JetTemplateContextType { - public Namespace() { - super("KOTLIN_NAMESPACE", "Namespace", Generic.class); + public static class TopLevel extends JetTemplateContextType { + public TopLevel() { + super("KOTLIN_TOPLEVEL", "Top-level", Generic.class); } @Override diff --git a/idea/src/org/jetbrains/jet/plugin/project/ResolveElementCache.java b/idea/src/org/jetbrains/jet/plugin/project/ResolveElementCache.java index 126320e3e10..ec434a15dae 100644 --- a/idea/src/org/jetbrains/jet/plugin/project/ResolveElementCache.java +++ b/idea/src/org/jetbrains/jet/plugin/project/ResolveElementCache.java @@ -164,7 +164,7 @@ public class ResolveElementCache { typeConstraintAdditionalResolve(resolveSession, (JetTypeConstraint) resolveElement); } else if (PsiTreeUtil.getParentOfType(resolveElement, JetPackageDirective.class) != null) { - namespaceRefAdditionalResolve(resolveSession, trace, resolveElement); + packageRefAdditionalResolve(resolveSession, trace, resolveElement); } else { assert false : "Invalid type of the topmost parent"; @@ -173,7 +173,7 @@ public class ResolveElementCache { return trace.getBindingContext(); } - private static void namespaceRefAdditionalResolve(ResolveSession resolveSession, BindingTrace trace, JetElement jetElement) { + private static void packageRefAdditionalResolve(ResolveSession resolveSession, BindingTrace trace, JetElement jetElement) { if (jetElement instanceof JetSimpleNameExpression) { JetPackageDirective header = PsiTreeUtil.getParentOfType(jetElement, JetPackageDirective.class); assert header != null; @@ -402,10 +402,10 @@ public class ResolveElementCache { } // Inside package declaration - JetPackageDirective namespaceHeader = PsiTreeUtil.getParentOfType(expression, JetPackageDirective.class, false); - if (namespaceHeader != null) { + JetPackageDirective packageDirective = PsiTreeUtil.getParentOfType(expression, JetPackageDirective.class, false); + if (packageDirective != null) { PackageViewDescriptor packageDescriptor = resolveSession.getModuleDescriptor().getPackage( - namespaceHeader.getFqName((JetSimpleNameExpression) expression).parent()); + packageDirective.getFqName((JetSimpleNameExpression) expression).parent()); if (packageDescriptor != null) { return packageDescriptor.getMemberScope(); } diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java b/idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java index 8c3e2f616b4..4318beeb5c4 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java @@ -39,7 +39,7 @@ public class ImportInsertHelper { } /** - * Add import directive into the PSI tree for the given namespace. + * Add import directive into the PSI tree for the given package. * * @param importFqn full name of the import * @param file File where directive should be added. diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/JetRefactoringBundle.properties b/idea/src/org/jetbrains/jet/plugin/refactoring/JetRefactoringBundle.properties index 59fb0f09eb9..b1ec05936ea 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/JetRefactoringBundle.properties +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/JetRefactoringBundle.properties @@ -5,7 +5,7 @@ introduce.variable=Introduce Variable cannot.refactor.no.container=Cannot refactor in this place cannot.refactor.no.expression=Cannot perform refactoring without an expression cannot.refactor.expression.has.unit.type=Cannot introduce expression of unit type -cannot.refactor.namespace.expression=Cannot introduce namespace reference +cannot.refactor.package.expression=Cannot introduce package reference cannot.extract.method=Cannot find statements to extract cannot.find.class.to.extract=Cannot find class to extract method cannot.refactor.expression.should.have.inferred.type=Expression should have inferred type diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/introduceVariable/JetIntroduceVariableHandler.java b/idea/src/org/jetbrains/jet/plugin/refactoring/introduceVariable/JetIntroduceVariableHandler.java index 6f7a40057f1..593bf53ff1e 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/introduceVariable/JetIntroduceVariableHandler.java +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/introduceVariable/JetIntroduceVariableHandler.java @@ -133,7 +133,7 @@ public class JetIntroduceVariableHandler extends JetIntroduceHandlerBase { } } if (expressionType instanceof PackageType) { - showErrorHint(project, editor, JetRefactoringBundle.message("cannot.refactor.namespace.expression")); + showErrorHint(project, editor, JetRefactoringBundle.message("cannot.refactor.package.expression")); return; } if (expressionType != null && diff --git a/idea/src/org/jetbrains/jet/plugin/util/DebuggerUtils.java b/idea/src/org/jetbrains/jet/plugin/util/DebuggerUtils.java index fdf7e90a592..6af0207d270 100644 --- a/idea/src/org/jetbrains/jet/plugin/util/DebuggerUtils.java +++ b/idea/src/org/jetbrains/jet/plugin/util/DebuggerUtils.java @@ -64,8 +64,8 @@ public class DebuggerUtils { return anyFile; } - Collection allNamespaceFiles = filesProvider.allPackageFiles().fun(anyFile); - JetFile file = PsiCodegenPredictor.getFileForPackagePartName(allNamespaceFiles, className); + Collection allPackageFiles = filesProvider.allPackageFiles().fun(anyFile); + JetFile file = PsiCodegenPredictor.getFileForPackagePartName(allPackageFiles, className); if (file != null) { return file; } @@ -74,7 +74,7 @@ public class DebuggerUtils { // we may actually need to analyze the project in order to find a file which produces this class AnalyzeExhaust analyzeExhaust = AnalyzerFacadeWithCache.analyzeFileWithCache(anyFile); - return PsiCodegenPredictor.getFileForCodegenNamedClass(analyzeExhaust.getBindingContext(), allNamespaceFiles, className.getInternalName()); + return PsiCodegenPredictor.getFileForCodegenNamedClass(analyzeExhaust.getBindingContext(), allPackageFiles, className.getInternalName()); } @NotNull