From 791b5bb84c2ab1709a522ae2987caee9a8c67d48 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Fri, 10 Jan 2014 18:20:42 +0400 Subject: [PATCH] =?UTF-8?q?JetNamespaceHeader=20=E2=86=92=20JetPackageDire?= =?UTF-8?q?ctive.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/org/jetbrains/jet/JetNodeTypes.java | 2 +- .../diagnostics/PositioningStrategies.java | 2 +- .../jet/lang/parsing/JetParsing.java | 30 +++++++++---------- .../org/jetbrains/jet/lang/psi/JetClass.java | 2 +- .../org/jetbrains/jet/lang/psi/JetFile.java | 12 ++++---- .../jet/lang/psi/JetNamedFunction.java | 2 +- ...ceHeader.java => JetPackageDirective.java} | 8 ++--- .../jetbrains/jet/lang/psi/JetPsiUtil.java | 17 ++++++----- .../jet/lang/resolve/DeclarationResolver.java | 12 ++++---- .../lang/resolve/ScriptHeaderResolver.java | 6 ++-- .../jet/lang/resolve/ScriptNameUtil.java | 8 ++--- .../lang/resolve/TypeHierarchyResolver.java | 10 +++---- .../jet/lang/resolve/lazy/ScopeProvider.java | 6 ++-- .../lazy/data/JetClassOrObjectInfo.java | 4 +-- .../FileBasedDeclarationProviderFactory.java | 8 ++--- .../testData/psi/AnnotatedExpressions.txt | 2 +- .../testData/psi/AnonymousInitializer.txt | 2 +- compiler/testData/psi/AssertNotNull.txt | 2 +- compiler/testData/psi/Attributes.txt | 2 +- .../testData/psi/AttributesOnPatterns.txt | 2 +- compiler/testData/psi/Attributes_ERR.txt | 2 +- compiler/testData/psi/BabySteps.txt | 2 +- compiler/testData/psi/BabySteps_ERR.txt | 2 +- .../psi/BlockCommentAtBeginningOfFile1.txt | 2 +- .../psi/BlockCommentAtBeginningOfFile2.txt | 2 +- .../psi/BlockCommentAtBeginningOfFile3.txt | 2 +- .../psi/BlockCommentAtBeginningOfFile4.txt | 2 +- compiler/testData/psi/ByClauses.txt | 2 +- .../testData/psi/CallWithManyClosures.txt | 2 +- compiler/testData/psi/CallsInWhen.txt | 2 +- compiler/testData/psi/Constructors.txt | 2 +- compiler/testData/psi/ControlStructures.txt | 2 +- compiler/testData/psi/DoubleColon.txt | 2 +- compiler/testData/psi/EOLsInComments.txt | 2 +- compiler/testData/psi/EOLsOnRollback.txt | 2 +- compiler/testData/psi/EmptyFile.txt | 2 +- compiler/testData/psi/Enums.txt | 2 +- compiler/testData/psi/Expressions_ERR.txt | 2 +- .../testData/psi/ExtensionsWithQNReceiver.txt | 2 +- compiler/testData/psi/FileStart_ERR.txt | 2 +- .../testData/psi/FloatingPointLiteral.txt | 2 +- compiler/testData/psi/ForWithMultiDecl.txt | 2 +- compiler/testData/psi/FunctionCalls.txt | 2 +- compiler/testData/psi/FunctionLiterals.txt | 2 +- .../testData/psi/FunctionLiterals_ERR.txt | 2 +- .../testData/psi/FunctionNoParameterList.txt | 2 +- compiler/testData/psi/FunctionTypes.txt | 2 +- compiler/testData/psi/FunctionTypes_ERR.txt | 2 +- compiler/testData/psi/Functions.txt | 2 +- compiler/testData/psi/Functions_ERR.txt | 2 +- .../testData/psi/HangOnLonelyModifier.txt | 2 +- compiler/testData/psi/IfWithPropery.txt | 2 +- compiler/testData/psi/ImportSoftKW.txt | 2 +- compiler/testData/psi/Imports.txt | 2 +- compiler/testData/psi/Imports_ERR.txt | 2 +- compiler/testData/psi/Inner.txt | 2 +- compiler/testData/psi/IntegerLiteral.txt | 2 +- compiler/testData/psi/Labels.txt | 2 +- compiler/testData/psi/LocalDeclarations.txt | 2 +- compiler/testData/psi/ModifierAsSelector.txt | 2 +- .../psi/MultiVariableDeclarations.txt | 2 +- compiler/testData/psi/NamespaceBlockFirst.txt | 2 +- compiler/testData/psi/NamespaceModifiers.txt | 2 +- compiler/testData/psi/NestedComments.txt | 2 +- .../testData/psi/NewLinesValidOperations.txt | 2 +- .../testData/psi/NewlinesInParentheses.txt | 2 +- compiler/testData/psi/NotIsAndNotIn.txt | 2 +- .../testData/psi/ObjectLiteralAsStatement.txt | 2 +- compiler/testData/psi/ParameterNameMising.txt | 2 +- compiler/testData/psi/Precedence.txt | 2 +- .../psi/PrimaryConstructorModifiers_ERR.txt | 2 +- compiler/testData/psi/Properties.txt | 2 +- .../psi/PropertiesFollowedByInitializers.txt | 2 +- compiler/testData/psi/Properties_ERR.txt | 2 +- compiler/testData/psi/QuotedIdentifiers.txt | 2 +- compiler/testData/psi/RootNamespace.txt | 2 +- compiler/testData/psi/SemicolonAfterIf.txt | 2 +- compiler/testData/psi/ShortAnnotations.txt | 2 +- compiler/testData/psi/SimpleClassMembers.txt | 2 +- .../testData/psi/SimpleClassMembers_ERR.txt | 2 +- compiler/testData/psi/SimpleExpressions.txt | 2 +- compiler/testData/psi/SimpleModifiers.txt | 2 +- compiler/testData/psi/SoftKeywords.txt | 2 +- .../psi/SoftKeywordsInTypeArguments.txt | 2 +- compiler/testData/psi/StringTemplates.txt | 2 +- compiler/testData/psi/Super.txt | 2 +- compiler/testData/psi/ThisType.txt | 2 +- compiler/testData/psi/TryRecovery.txt | 2 +- compiler/testData/psi/TypeAnnotations.txt | 2 +- compiler/testData/psi/TypeConstraints.txt | 2 +- compiler/testData/psi/TypeDef.txt | 2 +- compiler/testData/psi/TypeDef_ERR.txt | 2 +- .../psi/TypeExpressionAmbiguities_ERR.txt | 2 +- .../testData/psi/TypeParametersBeforeName.txt | 2 +- compiler/testData/psi/When.txt | 2 +- compiler/testData/psi/When_ERR.txt | 2 +- .../psi/examples/AnonymousObjects.txt | 2 +- compiler/testData/psi/examples/BinaryTree.txt | 2 +- compiler/testData/psi/examples/BitArith.txt | 2 +- compiler/testData/psi/examples/Builder.txt | 2 +- compiler/testData/psi/examples/Color.txt | 2 +- .../psi/examples/FunctionsAndTypes.txt | 2 +- compiler/testData/psi/examples/Graph.txt | 2 +- compiler/testData/psi/examples/IPushPop.txt | 2 +- compiler/testData/psi/examples/LINQ.txt | 2 +- .../psi/examples/PolymorphicClassObjects.txt | 2 +- compiler/testData/psi/examples/Queue.txt | 2 +- compiler/testData/psi/examples/Stack.txt | 2 +- compiler/testData/psi/examples/UnionFind.txt | 2 +- .../testData/psi/examples/UpdateOperation.txt | 2 +- compiler/testData/psi/examples/With.txt | 2 +- .../psi/examples/array/MutableArray.txt | 2 +- .../psi/examples/collections/ArrayList.txt | 2 +- .../psi/examples/collections/HashMap.txt | 2 +- .../psi/examples/collections/IIterable.txt | 2 +- .../psi/examples/collections/IIterator.txt | 2 +- .../psi/examples/collections/IList.txt | 2 +- .../examples/collections/IMutableIterable.txt | 2 +- .../examples/collections/IMutableIterator.txt | 2 +- .../psi/examples/collections/IMutableList.txt | 2 +- .../psi/examples/collections/IMutableSet.txt | 2 +- .../psi/examples/collections/ISet.txt | 2 +- .../psi/examples/collections/ISized.txt | 2 +- .../psi/examples/collections/LinkedList.txt | 2 +- .../testData/psi/examples/io/IOSamples.txt | 2 +- compiler/testData/psi/examples/map/IMap.txt | 2 +- .../examples/priorityqueues/BinaryHeap.txt | 2 +- .../priorityqueues/IPriorityQueue.txt | 2 +- .../priorityqueues/PriorityQueueAsPushPop.txt | 2 +- .../testData/psi/examples/util/Comparison.txt | 2 +- .../psi/examples/util/IComparable.txt | 2 +- .../FunctionTypesWithFunctionReceivers.txt | 2 +- .../FunctionsWithFunctionReceivers.txt | 2 +- .../PropertiesWithFunctionReceivers.txt | 2 +- .../FunctionTypesAsArguments.txt | 2 +- .../greatSyntacticShift/functionLiterals.txt | 2 +- .../psi/greatSyntacticShift/functionTypes.txt | 2 +- compiler/testData/psi/kdoc/AtTags.txt | 2 +- .../psi/kdoc/DocCommentAtBeginningOfFile1.txt | 2 +- .../psi/kdoc/DocCommentAtBeginningOfFile2.txt | 2 +- .../psi/kdoc/DocCommentAtBeginningOfFile3.txt | 2 +- .../psi/kdoc/DocCommentAtBeginningOfFile4.txt | 2 +- .../psi/kdoc/EndOnLeadingAsterisks.txt | 2 +- .../testData/psi/kdoc/EndRightAfterText.txt | 2 +- compiler/testData/psi/kdoc/Incomplete.txt | 2 +- compiler/testData/psi/kdoc/Markdown.txt | 2 +- compiler/testData/psi/kdoc/Simple.txt | 2 +- .../psi/kdoc/TextRightAfterLeadAsterisks.txt | 2 +- .../propertyDelegate/BracketsInDelegate.txt | 2 +- .../DelegateAndInitializer.txt | 2 +- .../psi/propertyDelegate/GetterInSameLine.txt | 2 +- .../psi/propertyDelegate/LocalProperty.txt | 2 +- .../testData/psi/propertyDelegate/OnlyBy.txt | 2 +- .../psi/propertyDelegate/PropertyInClass.txt | 2 +- .../propertyDelegate/PropertyWithGetter.txt | 2 +- .../PropertyWithInitializer.txt | 2 +- .../PropertyWithoutTypeRef.txt | 2 +- .../psi/propertyDelegate/TopLevelProperty.txt | 2 +- .../psi/propertyDelegate/TwoProperties.txt | 2 +- .../psi/recovery/AbsentLeftHandSide.txt | 2 +- .../testData/psi/recovery/ForRecovery.txt | 2 +- .../testData/psi/recovery/ImportRecovery.txt | 2 +- ...ngCommaInConstructorValueParameterList.txt | 2 +- .../MissingCommaInValueArgumentList.txt | 2 +- .../MissingCommaInValueParameterList.txt | 2 +- .../testData/psi/recovery/PackageRecovery.txt | 2 +- .../recovery/SameLineStatementRecovery.txt | 2 +- .../recovery/ValueParameterNoTypeRecovery.txt | 2 +- compiler/testData/psi/recovery/kt2172.txt | 2 +- .../testData/psi/script/ComplexScript.txt | 2 +- compiler/testData/psi/script/Import.txt | 2 +- compiler/testData/psi/script/Shebang.txt | 2 +- .../testData/psi/script/ShebangIncorrect.txt | 2 +- compiler/testData/psi/script/SimpleScript.txt | 2 +- ...ractLazyResolveDescriptorRendererTest.java | 2 +- .../resolve/lazy/LazyResolveTestUtil.java | 8 ++--- .../jet/renderer/DescriptorRendererTest.java | 2 +- .../jet/resolve/ExpectedResolveData.java | 10 +++---- .../jetbrains/jet/plugin/JetIconProvider.java | 2 +- .../plugin/JetQuickDocumentationProvider.java | 6 +--- .../jet/plugin/codeInsight/TipsManager.java | 4 +-- .../upDownMover/JetDeclarationMover.java | 2 +- .../completion/JetPackagesContributor.java | 4 +-- .../importOptimizer/JetImportOptimizer.java | 9 +++--- .../formatter/JetFormattingModelBuilder.java | 2 +- .../liveTemplates/JetTemplateContextType.java | 5 +--- .../plugin/project/ResolveElementCache.java | 10 +++---- .../plugin/quickfix/ImportInsertHelper.java | 8 ++--- 188 files changed, 256 insertions(+), 265 deletions(-) rename compiler/frontend/src/org/jetbrains/jet/lang/psi/{JetNamespaceHeader.java => JetPackageDirective.java} (93%) diff --git a/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java b/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java index a68a104ccd9..4c6a5f1dd64 100644 --- a/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java +++ b/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java @@ -146,7 +146,7 @@ public interface JetNodeTypes { JetNodeType WHEN_CONDITION_IS_PATTERN = new JetNodeType("WHEN_CONDITION_IS_PATTERN", JetWhenConditionIsPattern.class); JetNodeType WHEN_CONDITION_EXPRESSION = new JetNodeType("WHEN_CONDITION_WITH_EXPRESSION", JetWhenConditionWithExpression.class); - JetNodeType NAMESPACE_HEADER = new JetNodeType("NAMESPACE_HEADER", JetNamespaceHeader.class); + JetNodeType PACKAGE_DIRECTIVE = new JetNodeType("PACKAGE_DIRECTIVE", JetPackageDirective.class); JetNodeType SCRIPT = new JetNodeType("SCRIPT", JetScript.class); IFileElementType TYPE_CODE_FRAGMENT = new JetTypeCodeFragmentType(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java index 14caf53168f..339eb4aac4d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/PositioningStrategies.java @@ -204,7 +204,7 @@ public class PositioningStrategies { } else if (element instanceof JetFile) { JetFile file = (JetFile) element; - PsiElement nameIdentifier = file.getNamespaceHeader().getNameIdentifier(); + PsiElement nameIdentifier = file.getPackageDirective().getNameIdentifier(); if (nameIdentifier != null) { return markElement(nameIdentifier); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java index 2d877d66762..ba1ddf3c73b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/parsing/JetParsing.java @@ -46,7 +46,7 @@ public class JetParsing extends AbstractJetParsing { private static final TokenSet CLASS_NAME_RECOVERY_SET = TokenSet.orSet(TokenSet.create(LT, LPAR, COLON, LBRACE), TOPLEVEL_OBJECT_FIRST); private static final TokenSet TYPE_PARAMETER_GT_RECOVERY_SET = TokenSet.create(WHERE_KEYWORD, LPAR, COLON, LBRACE, GT); private static final TokenSet PARAMETER_NAME_RECOVERY_SET = TokenSet.create(COLON, EQ, COMMA, RPAR); - private static final TokenSet NAMESPACE_NAME_RECOVERY_SET = TokenSet.create(DOT, EOL_OR_SEMICOLON); + private static final TokenSet PACKAGE_NAME_RECOVERY_SET = TokenSet.create(DOT, EOL_OR_SEMICOLON); private static final TokenSet IMPORT_RECOVERY_SET = TokenSet.create(AS_KEYWORD, DOT, EOL_OR_SEMICOLON); /*package*/ static final TokenSet TYPE_REF_FIRST = TokenSet.create(LBRACKET, IDENTIFIER, FUN_KEYWORD, LPAR, CAPITALIZED_THIS_KEYWORD, HASH); private static final TokenSet RECEIVER_TYPE_TERMINATORS = TokenSet.create(DOT, SAFE_ACCESS); @@ -144,16 +144,16 @@ public class JetParsing extends AbstractJetParsing { /* *preamble - * : namespaceHeader? import* + * : packageDirective? import* * ; */ private void parsePreamble(boolean imports) { /* - * namespaceHeader - * : modifiers "namespace" SimpleName{"."} SEMI? + * packageDirective + * : modifiers "package" SimpleName{"."} SEMI? * ; */ - PsiBuilder.Marker namespaceHeader = mark(); + PsiBuilder.Marker packageDirective = mark(); PsiBuilder.Marker firstEntry = mark(); parseModifierList(MODIFIER_LIST, true); @@ -161,12 +161,12 @@ public class JetParsing extends AbstractJetParsing { advance(); // PACKAGE_KEYWORD - parseNamespaceName(); + parsePackageName(); if (at(LBRACE)) { - // Because it's blocked namespace and it will be parsed as one of top level objects + // Because it's blocked package and it will be parsed as one of top level objects firstEntry.rollbackTo(); - namespaceHeader.done(NAMESPACE_HEADER); + packageDirective.done(PACKAGE_DIRECTIVE); return; } @@ -177,22 +177,22 @@ public class JetParsing extends AbstractJetParsing { else { firstEntry.rollbackTo(); } - namespaceHeader.done(NAMESPACE_HEADER); + packageDirective.done(PACKAGE_DIRECTIVE); if(imports) parseImportDirectives(); } /* SimpleName{"."} */ - private void parseNamespaceName() { + private void parsePackageName() { while (true) { if (myBuilder.newlineBeforeCurrentToken()) { - errorWithRecovery("Package name must be a '.'-separated identifier list placed on a single line", NAMESPACE_NAME_RECOVERY_SET); + errorWithRecovery("Package name must be a '.'-separated identifier list placed on a single line", PACKAGE_NAME_RECOVERY_SET); break; } PsiBuilder.Marker nsName = mark(); - if (expect(IDENTIFIER, "Package name must be a '.'-separated identifier list", NAMESPACE_NAME_RECOVERY_SET)) { + if (expect(IDENTIFIER, "Package name must be a '.'-separated identifier list", PACKAGE_NAME_RECOVERY_SET)) { nsName.done(REFERENCE_EXPRESSION); } else { @@ -297,7 +297,7 @@ public class JetParsing extends AbstractJetParsing { /* * toplevelObject - * : namespace + * : package * : class * : extension * : function @@ -315,7 +315,7 @@ public class JetParsing extends AbstractJetParsing { IElementType keywordToken = tt(); IElementType declType = null; // if (keywordToken == PACKAGE_KEYWORD) { -// declType = parseNamespaceBlock(); +// declType = parsePackageBlock(); // } // else if (keywordToken == CLASS_KEYWORD || keywordToken == TRAIT_KEYWORD) { @@ -1481,7 +1481,7 @@ public class JetParsing extends AbstractJetParsing { /* * userType - * : ("namespace" ".")? simpleUserType{"."} + * : ("package" ".")? simpleUserType{"."} * ; */ void parseUserType() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java index c13231388a0..0d9f3113f2e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetClass.java @@ -210,7 +210,7 @@ public class JetClass extends JetTypeParameterListOwnerStub imp } PsiFile file = getContainingFile(); if (!(file instanceof JetFile)) return null; - String fileQualifiedName = ((JetFile) file).getNamespaceHeader().getQualifiedName(); + String fileQualifiedName = ((JetFile) file).getPackageDirective().getQualifiedName(); if (!fileQualifiedName.isEmpty()) { parts.add(fileQualifiedName); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFile.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFile.java index d351bc06966..dfdbb2fe6a1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFile.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFile.java @@ -89,11 +89,11 @@ public class JetFile extends PsiFileBase implements JetDeclarationContainer, Jet return null; } - // scripts has no namespace header + // scripts have no package directive @Nullable - public JetNamespaceHeader getNamespaceHeader() { - ASTNode ast = getNode().findChildByType(JetNodeTypes.NAMESPACE_HEADER); - return ast != null ? (JetNamespaceHeader) ast.getPsi() : null; + public JetPackageDirective getPackageDirective() { + ASTNode ast = getNode().findChildByType(JetNodeTypes.PACKAGE_DIRECTIVE); + return ast != null ? (JetPackageDirective) ast.getPsi() : null; } @Nullable @@ -103,8 +103,8 @@ public class JetFile extends PsiFileBase implements JetDeclarationContainer, Jet return stub.getPackageName(); } - JetNamespaceHeader statement = getNamespaceHeader(); - return statement != null ? statement.getQualifiedName() : null; + JetPackageDirective directive = getPackageDirective(); + return directive != null ? directive.getQualifiedName() : null; } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamedFunction.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamedFunction.java index 0a42f6a2910..c6f2e7a17cc 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamedFunction.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamedFunction.java @@ -97,7 +97,7 @@ public class JetNamedFunction extends JetTypeParameterListOwnerStub getNamespaceNames() { + public List getPackageNames() { return findChildrenByType(JetNodeTypes.REFERENCE_EXPRESSION); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java index 825d81cbc9a..cbd18f10ed3 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java @@ -187,8 +187,8 @@ public class JetPsiUtil { @NotNull public static FqName getFQName(@NotNull JetFile file) { - JetNamespaceHeader header = file.getNamespaceHeader(); - return header != null ? header.getFqName() : FqName.ROOT; + JetPackageDirective directive = file.getPackageDirective(); + return directive != null ? directive.getFqName() : FqName.ROOT; } @Nullable @@ -908,14 +908,15 @@ public class JetPsiUtil { } public static NavigatablePsiElement getPackageReference(@NotNull JetFile file, int partIndex) { - JetNamespaceHeader header = file.getNamespaceHeader(); - if (header == null) { - throw new IllegalArgumentException("Should be called only for files with namespace: " + file); + JetPackageDirective directive = file.getPackageDirective(); + if (directive == null) { + throw new IllegalArgumentException("Should be called only for files with package directive: " + file); } - List names = header.getNamespaceNames(); + List names = directive.getPackageNames(); if (!(0 <= partIndex && partIndex < names.size())) { - throw new IndexOutOfBoundsException(String.format("%s index for file with header %s is out of range", partIndex, header.getText())); + throw new IndexOutOfBoundsException(String.format("%s index for file with directive %s is out of range", partIndex, + directive.getText())); } return names.get(partIndex); @@ -1002,7 +1003,7 @@ public class JetPsiUtil { @Nullable public static String getPackageName(@NotNull JetElement element) { JetFile file = (JetFile) element.getContainingFile(); - JetNamespaceHeader header = PsiTreeUtil.findChildOfType(file, JetNamespaceHeader.class); + JetPackageDirective header = PsiTreeUtil.findChildOfType(file, JetPackageDirective.class); return header != null ? header.getQualifiedName() : null; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java index 9c5f774a50d..dde25c62b57 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationResolver.java @@ -91,7 +91,7 @@ public class DeclarationResolver { public void process(@NotNull JetScope rootScope) { - checkModifiersAndAnnotationsInNamespaceHeaders(); + checkModifiersAndAnnotationsInPackageDirectives(); resolveAnnotationConstructors(); resolveConstructorHeaders(); resolveAnnotationStubsOnClassesAndConstructors(); @@ -102,12 +102,12 @@ public class DeclarationResolver { checkRedeclarationsInInnerClassNames(); } - private void checkModifiersAndAnnotationsInNamespaceHeaders() { + private void checkModifiersAndAnnotationsInPackageDirectives() { for (JetFile file : context.getPackageFragments().keySet()) { - JetNamespaceHeader namespaceHeader = file.getNamespaceHeader(); - if (namespaceHeader == null) continue; + JetPackageDirective packageDirective = file.getPackageDirective(); + if (packageDirective == null) continue; - PsiElement firstChild = namespaceHeader.getFirstChild(); + PsiElement firstChild = packageDirective.getFirstChild(); if (!(firstChild instanceof JetModifierList)) continue; JetModifierList modifierList = (JetModifierList) firstChild; @@ -373,7 +373,7 @@ public class DeclarationResolver { @Override public PsiElement apply(@Nullable JetFile file) { assert file != null : "File is null for aPackage " + aPackage; - return file.getNamespaceHeader().getNameIdentifier(); + return file.getPackageDirective().getNameIdentifier(); } }); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptHeaderResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptHeaderResolver.java index 6e6dd560463..47e7116df87 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptHeaderResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptHeaderResolver.java @@ -28,7 +28,7 @@ import org.jetbrains.jet.lang.descriptors.impl.ValueParameterDescriptorImpl; import org.jetbrains.jet.lang.parsing.JetScriptDefinition; import org.jetbrains.jet.lang.parsing.JetScriptDefinitionProvider; import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.psi.JetNamespaceHeader; +import org.jetbrains.jet.lang.psi.JetPackageDirective; import org.jetbrains.jet.lang.psi.JetScript; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.Name; @@ -119,8 +119,8 @@ public class ScriptHeaderResolver { public void processScriptHierarchy(@NotNull JetScript script, @NotNull JetScope outerScope) { JetFile file = (JetFile) script.getContainingFile(); - JetNamespaceHeader namespaceHeader = file.getNamespaceHeader(); - FqName fqName = namespaceHeader != null ? new FqName(namespaceHeader.getQualifiedName()) : FqName.ROOT; + JetPackageDirective packageDirective = file.getPackageDirective(); + FqName fqName = packageDirective != null ? new FqName(packageDirective.getQualifiedName()) : FqName.ROOT; PackageFragmentDescriptor ns = packageFragmentProvider.getOrCreateFragment(fqName); Integer priority = script.getUserData(PRIORITY_KEY); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptNameUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptNameUtil.java index ae65aec4e0e..d8b26280fb9 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptNameUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptNameUtil.java @@ -19,7 +19,7 @@ package org.jetbrains.jet.lang.resolve; import org.jetbrains.jet.lang.parsing.JetScriptDefinition; import org.jetbrains.jet.lang.parsing.JetScriptDefinitionProvider; import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.psi.JetNamespaceHeader; +import org.jetbrains.jet.lang.psi.JetPackageDirective; public class ScriptNameUtil { private ScriptNameUtil() { @@ -40,9 +40,9 @@ public class ScriptNameUtil { name = name.substring(0,index); } name = Character.toUpperCase(name.charAt(0)) + (name.length() == 0 ? "" : name.substring(1)); - JetNamespaceHeader header = file.getNamespaceHeader(); - if(header != null && header.getName().length() > 0) { - name = header.getName().replace('.','/') + "/" + name; + JetPackageDirective directive = file.getPackageDirective(); + if(directive != null && directive.getName().length() > 0) { + name = directive.getName().replace('.','/') + "/" + name; } return name; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.java index 8a409d3a3ed..26448298fa4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.java @@ -541,13 +541,13 @@ public class TypeHierarchyResolver { @NotNull private MutablePackageFragmentDescriptor getOrCreatePackageFragmentForFile(@NotNull JetFile file) { - JetNamespaceHeader namespaceHeader = file.getNamespaceHeader(); - assert namespaceHeader != null : "scripts are not supported"; + JetPackageDirective packageDirective = file.getPackageDirective(); + assert packageDirective != null : "scripts are not supported"; - MutablePackageFragmentDescriptor fragment = packageFragmentProvider.getOrCreateFragment(namespaceHeader.getFqName()); + MutablePackageFragmentDescriptor fragment = packageFragmentProvider.getOrCreateFragment(packageDirective.getFqName()); - for (JetSimpleNameExpression nameExpression : namespaceHeader.getNamespaceNames()) { - FqName fqName = namespaceHeader.getFqName(nameExpression); + for (JetSimpleNameExpression nameExpression : packageDirective.getPackageNames()) { + FqName fqName = packageDirective.getFqName(nameExpression); PackageViewDescriptor packageView = packageFragmentProvider.getModule().getPackage(fqName); assert packageView != null : "package not found: " + fqName; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/ScopeProvider.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/ScopeProvider.java index 50ebb73cbb6..9139027f21d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/ScopeProvider.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/ScopeProvider.java @@ -110,12 +110,12 @@ public class ScopeProvider { @NotNull private PackageViewDescriptor getFilePackageDescriptor(JetFile file) { - JetNamespaceHeader header = file.getNamespaceHeader(); - if (header == null) { + JetPackageDirective directive = file.getPackageDirective(); + if (directive == null) { throw new IllegalArgumentException("Scripts are not supported: " + file.getName()); } - FqName fqName = new FqName(header.getQualifiedName()); + FqName fqName = new FqName(directive.getQualifiedName()); PackageViewDescriptor packageDescriptor = resolveSession.getModuleDescriptor().getPackage(fqName); if (packageDescriptor == null) { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/data/JetClassOrObjectInfo.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/data/JetClassOrObjectInfo.java index 1806861cdfd..039fe1aedb4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/data/JetClassOrObjectInfo.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/data/JetClassOrObjectInfo.java @@ -61,8 +61,8 @@ public abstract class JetClassOrObjectInfo implement PsiFile file = element.getContainingFile(); if (file instanceof JetFile) { JetFile jetFile = (JetFile) file; - JetNamespaceHeader header = jetFile.getNamespaceHeader(); - return header != null ? header.getFqName() : FqName.ROOT; + JetPackageDirective directive = jetFile.getPackageDirective(); + return directive != null ? directive.getFqName() : FqName.ROOT; } throw new IllegalArgumentException("Not in a JetFile: " + element); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/declarations/FileBasedDeclarationProviderFactory.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/declarations/FileBasedDeclarationProviderFactory.java index 4e3e6c5782e..e2236bccfc0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/declarations/FileBasedDeclarationProviderFactory.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/declarations/FileBasedDeclarationProviderFactory.java @@ -27,7 +27,7 @@ import jet.Function1; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.psi.JetNamespaceHeader; +import org.jetbrains.jet.lang.psi.JetPackageDirective; import org.jetbrains.jet.lang.psi.JetPsiUtil; import org.jetbrains.jet.lang.resolve.lazy.data.JetClassLikeInfo; import org.jetbrains.jet.lang.resolve.name.FqName; @@ -83,12 +83,12 @@ public class FileBasedDeclarationProviderFactory implements DeclarationProviderF private static Index computeFilesByPackage(@NotNull Collection files) { Index index = new Index(); for (JetFile file : files) { - JetNamespaceHeader header = file.getNamespaceHeader(); - if (header == null) { + JetPackageDirective directive = file.getPackageDirective(); + if (directive == null) { throw new IllegalArgumentException("Scripts are not supported"); } - FqName packageFqName = new FqName(header.getQualifiedName()); + FqName packageFqName = new FqName(directive.getQualifiedName()); addMeAndParentPackages(index, packageFqName); index.filesByPackage.put(packageFqName, file); } diff --git a/compiler/testData/psi/AnnotatedExpressions.txt b/compiler/testData/psi/AnnotatedExpressions.txt index adb16a4dfa1..4443d27a38e 100644 --- a/compiler/testData/psi/AnnotatedExpressions.txt +++ b/compiler/testData/psi/AnnotatedExpressions.txt @@ -1,5 +1,5 @@ JetFile: AnnotatedExpressions.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/AnonymousInitializer.txt b/compiler/testData/psi/AnonymousInitializer.txt index 4bea107343c..6e9a7764c9c 100644 --- a/compiler/testData/psi/AnonymousInitializer.txt +++ b/compiler/testData/psi/AnonymousInitializer.txt @@ -1,5 +1,5 @@ JetFile: AnonymousInitializer.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/AssertNotNull.txt b/compiler/testData/psi/AssertNotNull.txt index 60dc64455fd..e526fc7e38b 100644 --- a/compiler/testData/psi/AssertNotNull.txt +++ b/compiler/testData/psi/AssertNotNull.txt @@ -1,5 +1,5 @@ JetFile: AssertNotNull.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/Attributes.txt b/compiler/testData/psi/Attributes.txt index 9d9344c0a00..a60e346bee2 100644 --- a/compiler/testData/psi/Attributes.txt +++ b/compiler/testData/psi/Attributes.txt @@ -1,5 +1,5 @@ JetFile: Attributes.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/AttributesOnPatterns.txt b/compiler/testData/psi/AttributesOnPatterns.txt index 4314b046837..fded66a1b0a 100644 --- a/compiler/testData/psi/AttributesOnPatterns.txt +++ b/compiler/testData/psi/AttributesOnPatterns.txt @@ -1,5 +1,5 @@ JetFile: AttributesOnPatterns.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/Attributes_ERR.txt b/compiler/testData/psi/Attributes_ERR.txt index 1bc34c4321f..39f9f8ea88f 100644 --- a/compiler/testData/psi/Attributes_ERR.txt +++ b/compiler/testData/psi/Attributes_ERR.txt @@ -1,5 +1,5 @@ JetFile: Attributes_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/BabySteps.txt b/compiler/testData/psi/BabySteps.txt index 9720a71f6bc..0bf31c8fd1f 100644 --- a/compiler/testData/psi/BabySteps.txt +++ b/compiler/testData/psi/BabySteps.txt @@ -1,5 +1,5 @@ JetFile: BabySteps.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/BabySteps_ERR.txt b/compiler/testData/psi/BabySteps_ERR.txt index 46530657e20..4645fa393ce 100644 --- a/compiler/testData/psi/BabySteps_ERR.txt +++ b/compiler/testData/psi/BabySteps_ERR.txt @@ -1,5 +1,5 @@ JetFile: BabySteps_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/BlockCommentAtBeginningOfFile1.txt b/compiler/testData/psi/BlockCommentAtBeginningOfFile1.txt index 941c1774096..df5879d4084 100644 --- a/compiler/testData/psi/BlockCommentAtBeginningOfFile1.txt +++ b/compiler/testData/psi/BlockCommentAtBeginningOfFile1.txt @@ -1,4 +1,4 @@ JetFile: BlockCommentAtBeginningOfFile1.kt PsiComment(BLOCK_COMMENT)('/*') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/BlockCommentAtBeginningOfFile2.txt b/compiler/testData/psi/BlockCommentAtBeginningOfFile2.txt index fbfe2cb645f..be9651d0c02 100644 --- a/compiler/testData/psi/BlockCommentAtBeginningOfFile2.txt +++ b/compiler/testData/psi/BlockCommentAtBeginningOfFile2.txt @@ -1,4 +1,4 @@ JetFile: BlockCommentAtBeginningOfFile2.kt PsiComment(BLOCK_COMMENT)('/*\n/*') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/BlockCommentAtBeginningOfFile3.txt b/compiler/testData/psi/BlockCommentAtBeginningOfFile3.txt index 18f6d1f60f7..049a01d5632 100644 --- a/compiler/testData/psi/BlockCommentAtBeginningOfFile3.txt +++ b/compiler/testData/psi/BlockCommentAtBeginningOfFile3.txt @@ -1,4 +1,4 @@ JetFile: BlockCommentAtBeginningOfFile3.kt PsiComment(BLOCK_COMMENT)('/*\n\nfooo') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/BlockCommentAtBeginningOfFile4.txt b/compiler/testData/psi/BlockCommentAtBeginningOfFile4.txt index c170e65c6ea..d50728c9383 100644 --- a/compiler/testData/psi/BlockCommentAtBeginningOfFile4.txt +++ b/compiler/testData/psi/BlockCommentAtBeginningOfFile4.txt @@ -1,4 +1,4 @@ JetFile: BlockCommentAtBeginningOfFile4.kt PsiComment(BLOCK_COMMENT)('/*\n\n/*foo*/\n\nasdfas') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/ByClauses.txt b/compiler/testData/psi/ByClauses.txt index 6c61d64ea6e..d27ba2f3476 100644 --- a/compiler/testData/psi/ByClauses.txt +++ b/compiler/testData/psi/ByClauses.txt @@ -1,5 +1,5 @@ JetFile: ByClauses.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/CallWithManyClosures.txt b/compiler/testData/psi/CallWithManyClosures.txt index 4f1eecc6b57..eec7a958b5c 100644 --- a/compiler/testData/psi/CallWithManyClosures.txt +++ b/compiler/testData/psi/CallWithManyClosures.txt @@ -1,5 +1,5 @@ JetFile: CallWithManyClosures.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/CallsInWhen.txt b/compiler/testData/psi/CallsInWhen.txt index 6dbefaa681f..98131916f8f 100644 --- a/compiler/testData/psi/CallsInWhen.txt +++ b/compiler/testData/psi/CallsInWhen.txt @@ -1,5 +1,5 @@ JetFile: CallsInWhen.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/Constructors.txt b/compiler/testData/psi/Constructors.txt index 8efd50f3a54..c85e0adfd1a 100644 --- a/compiler/testData/psi/Constructors.txt +++ b/compiler/testData/psi/Constructors.txt @@ -1,5 +1,5 @@ JetFile: Constructors.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/ControlStructures.txt b/compiler/testData/psi/ControlStructures.txt index da92a50e321..5df35ab1add 100644 --- a/compiler/testData/psi/ControlStructures.txt +++ b/compiler/testData/psi/ControlStructures.txt @@ -1,5 +1,5 @@ JetFile: ControlStructures.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/DoubleColon.txt b/compiler/testData/psi/DoubleColon.txt index 7e2d2af2c96..a1e37dc967d 100644 --- a/compiler/testData/psi/DoubleColon.txt +++ b/compiler/testData/psi/DoubleColon.txt @@ -1,5 +1,5 @@ JetFile: DoubleColon.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/EOLsInComments.txt b/compiler/testData/psi/EOLsInComments.txt index 6985a3e298b..8ae92f0ef03 100644 --- a/compiler/testData/psi/EOLsInComments.txt +++ b/compiler/testData/psi/EOLsInComments.txt @@ -1,5 +1,5 @@ JetFile: EOLsInComments.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/EOLsOnRollback.txt b/compiler/testData/psi/EOLsOnRollback.txt index f771841bb2c..67fd5a0d6a1 100644 --- a/compiler/testData/psi/EOLsOnRollback.txt +++ b/compiler/testData/psi/EOLsOnRollback.txt @@ -1,5 +1,5 @@ JetFile: EOLsOnRollback.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/EmptyFile.txt b/compiler/testData/psi/EmptyFile.txt index 20f0592432e..8e883bb3be9 100644 --- a/compiler/testData/psi/EmptyFile.txt +++ b/compiler/testData/psi/EmptyFile.txt @@ -1,3 +1,3 @@ JetFile: EmptyFile.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/Enums.txt b/compiler/testData/psi/Enums.txt index 98dec18167e..c3ae749f6f3 100644 --- a/compiler/testData/psi/Enums.txt +++ b/compiler/testData/psi/Enums.txt @@ -1,5 +1,5 @@ JetFile: Enums.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/Expressions_ERR.txt b/compiler/testData/psi/Expressions_ERR.txt index b99b1448ddf..0339b8d92d6 100644 --- a/compiler/testData/psi/Expressions_ERR.txt +++ b/compiler/testData/psi/Expressions_ERR.txt @@ -1,5 +1,5 @@ JetFile: Expressions_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/ExtensionsWithQNReceiver.txt b/compiler/testData/psi/ExtensionsWithQNReceiver.txt index 76c8445b6f9..a41fa665c36 100644 --- a/compiler/testData/psi/ExtensionsWithQNReceiver.txt +++ b/compiler/testData/psi/ExtensionsWithQNReceiver.txt @@ -1,5 +1,5 @@ JetFile: ExtensionsWithQNReceiver.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/FileStart_ERR.txt b/compiler/testData/psi/FileStart_ERR.txt index d99d89b6a80..a18a75db412 100644 --- a/compiler/testData/psi/FileStart_ERR.txt +++ b/compiler/testData/psi/FileStart_ERR.txt @@ -1,5 +1,5 @@ JetFile: FileStart_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiErrorElement:Expecting package directive or top level declaration PsiElement(DIV)('/') diff --git a/compiler/testData/psi/FloatingPointLiteral.txt b/compiler/testData/psi/FloatingPointLiteral.txt index d398d7b2fd2..a306d798424 100644 --- a/compiler/testData/psi/FloatingPointLiteral.txt +++ b/compiler/testData/psi/FloatingPointLiteral.txt @@ -1,5 +1,5 @@ JetFile: FloatingPointLiteral.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/ForWithMultiDecl.txt b/compiler/testData/psi/ForWithMultiDecl.txt index 1eec409161d..72b4094e80e 100644 --- a/compiler/testData/psi/ForWithMultiDecl.txt +++ b/compiler/testData/psi/ForWithMultiDecl.txt @@ -1,5 +1,5 @@ JetFile: ForWithMultiDecl.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/FunctionCalls.txt b/compiler/testData/psi/FunctionCalls.txt index 8afc1b4d80b..e41f793b9d7 100644 --- a/compiler/testData/psi/FunctionCalls.txt +++ b/compiler/testData/psi/FunctionCalls.txt @@ -1,5 +1,5 @@ JetFile: FunctionCalls.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/FunctionLiterals.txt b/compiler/testData/psi/FunctionLiterals.txt index 3ec109d09bf..a6543b322e1 100644 --- a/compiler/testData/psi/FunctionLiterals.txt +++ b/compiler/testData/psi/FunctionLiterals.txt @@ -1,5 +1,5 @@ JetFile: FunctionLiterals.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/FunctionLiterals_ERR.txt b/compiler/testData/psi/FunctionLiterals_ERR.txt index b5b864e13cd..6e00bb48f9e 100644 --- a/compiler/testData/psi/FunctionLiterals_ERR.txt +++ b/compiler/testData/psi/FunctionLiterals_ERR.txt @@ -1,5 +1,5 @@ JetFile: FunctionLiterals_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/FunctionNoParameterList.txt b/compiler/testData/psi/FunctionNoParameterList.txt index c26c2677e64..00322a644cf 100644 --- a/compiler/testData/psi/FunctionNoParameterList.txt +++ b/compiler/testData/psi/FunctionNoParameterList.txt @@ -1,5 +1,5 @@ JetFile: FunctionNoParameterList.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/FunctionTypes.txt b/compiler/testData/psi/FunctionTypes.txt index 3677b6049c4..5b8ec73d331 100644 --- a/compiler/testData/psi/FunctionTypes.txt +++ b/compiler/testData/psi/FunctionTypes.txt @@ -1,5 +1,5 @@ JetFile: FunctionTypes.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE TYPEDEF PsiElement(type)('type') diff --git a/compiler/testData/psi/FunctionTypes_ERR.txt b/compiler/testData/psi/FunctionTypes_ERR.txt index de314e9d8c5..2e6f737d3b8 100644 --- a/compiler/testData/psi/FunctionTypes_ERR.txt +++ b/compiler/testData/psi/FunctionTypes_ERR.txt @@ -1,5 +1,5 @@ JetFile: FunctionTypes_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE TYPEDEF PsiElement(type)('type') diff --git a/compiler/testData/psi/Functions.txt b/compiler/testData/psi/Functions.txt index 5cd53d9dead..2c6d15df9f5 100644 --- a/compiler/testData/psi/Functions.txt +++ b/compiler/testData/psi/Functions.txt @@ -1,5 +1,5 @@ JetFile: Functions.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/Functions_ERR.txt b/compiler/testData/psi/Functions_ERR.txt index ca9af621084..3cde0a8adaa 100644 --- a/compiler/testData/psi/Functions_ERR.txt +++ b/compiler/testData/psi/Functions_ERR.txt @@ -1,5 +1,5 @@ JetFile: Functions_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/HangOnLonelyModifier.txt b/compiler/testData/psi/HangOnLonelyModifier.txt index 291aec92a15..5971d95c24e 100644 --- a/compiler/testData/psi/HangOnLonelyModifier.txt +++ b/compiler/testData/psi/HangOnLonelyModifier.txt @@ -1,5 +1,5 @@ JetFile: HangOnLonelyModifier.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/IfWithPropery.txt b/compiler/testData/psi/IfWithPropery.txt index 2b66ca94918..8f7f1a43996 100644 --- a/compiler/testData/psi/IfWithPropery.txt +++ b/compiler/testData/psi/IfWithPropery.txt @@ -1,5 +1,5 @@ JetFile: IfWithPropery.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/ImportSoftKW.txt b/compiler/testData/psi/ImportSoftKW.txt index 7b1f29b9f9d..ae07f5e4306 100644 --- a/compiler/testData/psi/ImportSoftKW.txt +++ b/compiler/testData/psi/ImportSoftKW.txt @@ -1,5 +1,5 @@ JetFile: ImportSoftKW.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE IMPORT_LIST IMPORT_DIRECTIVE diff --git a/compiler/testData/psi/Imports.txt b/compiler/testData/psi/Imports.txt index 938223be257..c20892204a1 100644 --- a/compiler/testData/psi/Imports.txt +++ b/compiler/testData/psi/Imports.txt @@ -1,5 +1,5 @@ JetFile: Imports.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/Imports_ERR.txt b/compiler/testData/psi/Imports_ERR.txt index 6a78a871177..60ff6011022 100644 --- a/compiler/testData/psi/Imports_ERR.txt +++ b/compiler/testData/psi/Imports_ERR.txt @@ -1,5 +1,5 @@ JetFile: Imports_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/Inner.txt b/compiler/testData/psi/Inner.txt index 33cb20e9df1..f12b27571ef 100644 --- a/compiler/testData/psi/Inner.txt +++ b/compiler/testData/psi/Inner.txt @@ -1,5 +1,5 @@ JetFile: Inner.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/IntegerLiteral.txt b/compiler/testData/psi/IntegerLiteral.txt index 34e6dea4665..326e1158b8d 100644 --- a/compiler/testData/psi/IntegerLiteral.txt +++ b/compiler/testData/psi/IntegerLiteral.txt @@ -1,5 +1,5 @@ JetFile: IntegerLiteral.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/Labels.txt b/compiler/testData/psi/Labels.txt index fe06595516d..814d8082606 100644 --- a/compiler/testData/psi/Labels.txt +++ b/compiler/testData/psi/Labels.txt @@ -1,5 +1,5 @@ JetFile: Labels.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/LocalDeclarations.txt b/compiler/testData/psi/LocalDeclarations.txt index dadc82b2c3a..81c6ae367df 100644 --- a/compiler/testData/psi/LocalDeclarations.txt +++ b/compiler/testData/psi/LocalDeclarations.txt @@ -1,5 +1,5 @@ JetFile: LocalDeclarations.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/ModifierAsSelector.txt b/compiler/testData/psi/ModifierAsSelector.txt index 3f4b9e04286..419854152ca 100644 --- a/compiler/testData/psi/ModifierAsSelector.txt +++ b/compiler/testData/psi/ModifierAsSelector.txt @@ -1,7 +1,7 @@ JetFile: ModifierAsSelector.kt PsiComment(EOL_COMMENT)('// JET-1') PsiWhiteSpace('\n\n') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/MultiVariableDeclarations.txt b/compiler/testData/psi/MultiVariableDeclarations.txt index 43f76c3a00c..42327e79cac 100644 --- a/compiler/testData/psi/MultiVariableDeclarations.txt +++ b/compiler/testData/psi/MultiVariableDeclarations.txt @@ -1,5 +1,5 @@ JetFile: MultiVariableDeclarations.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/NamespaceBlockFirst.txt b/compiler/testData/psi/NamespaceBlockFirst.txt index 9c7c46e2a97..aa622f10109 100644 --- a/compiler/testData/psi/NamespaceBlockFirst.txt +++ b/compiler/testData/psi/NamespaceBlockFirst.txt @@ -1,5 +1,5 @@ JetFile: NamespaceBlockFirst.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiErrorElement:Expecting package directive or top level declaration PsiElement(package)('package') diff --git a/compiler/testData/psi/NamespaceModifiers.txt b/compiler/testData/psi/NamespaceModifiers.txt index 0935f76b83b..0b02368e48c 100644 --- a/compiler/testData/psi/NamespaceModifiers.txt +++ b/compiler/testData/psi/NamespaceModifiers.txt @@ -1,5 +1,5 @@ JetFile: NamespaceModifiers.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE MODIFIER_LIST PsiElement(public)('public') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/NestedComments.txt b/compiler/testData/psi/NestedComments.txt index d629dfa0747..95052f017b2 100644 --- a/compiler/testData/psi/NestedComments.txt +++ b/compiler/testData/psi/NestedComments.txt @@ -1,5 +1,5 @@ JetFile: NestedComments.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/NewLinesValidOperations.txt b/compiler/testData/psi/NewLinesValidOperations.txt index fe9e89a2bac..0c5b866cad6 100644 --- a/compiler/testData/psi/NewLinesValidOperations.txt +++ b/compiler/testData/psi/NewLinesValidOperations.txt @@ -1,5 +1,5 @@ JetFile: NewLinesValidOperations.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/NewlinesInParentheses.txt b/compiler/testData/psi/NewlinesInParentheses.txt index 1f60facecec..6443a3f8c3c 100644 --- a/compiler/testData/psi/NewlinesInParentheses.txt +++ b/compiler/testData/psi/NewlinesInParentheses.txt @@ -1,5 +1,5 @@ JetFile: NewlinesInParentheses.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/NotIsAndNotIn.txt b/compiler/testData/psi/NotIsAndNotIn.txt index 75312870f11..65f4e754ff7 100644 --- a/compiler/testData/psi/NotIsAndNotIn.txt +++ b/compiler/testData/psi/NotIsAndNotIn.txt @@ -1,5 +1,5 @@ JetFile: NotIsAndNotIn.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/ObjectLiteralAsStatement.txt b/compiler/testData/psi/ObjectLiteralAsStatement.txt index d33d30820cb..4c77a0c647e 100644 --- a/compiler/testData/psi/ObjectLiteralAsStatement.txt +++ b/compiler/testData/psi/ObjectLiteralAsStatement.txt @@ -1,5 +1,5 @@ JetFile: ObjectLiteralAsStatement.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/ParameterNameMising.txt b/compiler/testData/psi/ParameterNameMising.txt index 718301cb67b..7223b8d4713 100644 --- a/compiler/testData/psi/ParameterNameMising.txt +++ b/compiler/testData/psi/ParameterNameMising.txt @@ -1,5 +1,5 @@ JetFile: ParameterNameMising.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/Precedence.txt b/compiler/testData/psi/Precedence.txt index ab3b26f8eff..4cd0db25abc 100644 --- a/compiler/testData/psi/Precedence.txt +++ b/compiler/testData/psi/Precedence.txt @@ -1,5 +1,5 @@ JetFile: Precedence.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/PrimaryConstructorModifiers_ERR.txt b/compiler/testData/psi/PrimaryConstructorModifiers_ERR.txt index c8c2a07bd1d..fb7cb081c85 100644 --- a/compiler/testData/psi/PrimaryConstructorModifiers_ERR.txt +++ b/compiler/testData/psi/PrimaryConstructorModifiers_ERR.txt @@ -1,5 +1,5 @@ JetFile: PrimaryConstructorModifiers_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/Properties.txt b/compiler/testData/psi/Properties.txt index b45436ba29d..5aed763cd98 100644 --- a/compiler/testData/psi/Properties.txt +++ b/compiler/testData/psi/Properties.txt @@ -1,5 +1,5 @@ JetFile: Properties.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/PropertiesFollowedByInitializers.txt b/compiler/testData/psi/PropertiesFollowedByInitializers.txt index a624256b37e..40ad2f2989a 100644 --- a/compiler/testData/psi/PropertiesFollowedByInitializers.txt +++ b/compiler/testData/psi/PropertiesFollowedByInitializers.txt @@ -1,5 +1,5 @@ JetFile: PropertiesFollowedByInitializers.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/Properties_ERR.txt b/compiler/testData/psi/Properties_ERR.txt index de7b812a489..9d811255714 100644 --- a/compiler/testData/psi/Properties_ERR.txt +++ b/compiler/testData/psi/Properties_ERR.txt @@ -1,5 +1,5 @@ JetFile: Properties_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(var)('var') diff --git a/compiler/testData/psi/QuotedIdentifiers.txt b/compiler/testData/psi/QuotedIdentifiers.txt index cc3ac6983a4..bbada0daf89 100644 --- a/compiler/testData/psi/QuotedIdentifiers.txt +++ b/compiler/testData/psi/QuotedIdentifiers.txt @@ -1,5 +1,5 @@ JetFile: QuotedIdentifiers.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN MODIFIER_LIST diff --git a/compiler/testData/psi/RootNamespace.txt b/compiler/testData/psi/RootNamespace.txt index 305431dd6fd..74ac8d22800 100644 --- a/compiler/testData/psi/RootNamespace.txt +++ b/compiler/testData/psi/RootNamespace.txt @@ -1,5 +1,5 @@ JetFile: RootNamespace.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/SemicolonAfterIf.txt b/compiler/testData/psi/SemicolonAfterIf.txt index c1cee2533bb..be8ad3c8715 100644 --- a/compiler/testData/psi/SemicolonAfterIf.txt +++ b/compiler/testData/psi/SemicolonAfterIf.txt @@ -1,5 +1,5 @@ JetFile: SemicolonAfterIf.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/ShortAnnotations.txt b/compiler/testData/psi/ShortAnnotations.txt index 8fa79f23fd9..aef96858f41 100644 --- a/compiler/testData/psi/ShortAnnotations.txt +++ b/compiler/testData/psi/ShortAnnotations.txt @@ -1,5 +1,5 @@ JetFile: ShortAnnotations.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE MODIFIER_LIST ANNOTATION_ENTRY CONSTRUCTOR_CALLEE diff --git a/compiler/testData/psi/SimpleClassMembers.txt b/compiler/testData/psi/SimpleClassMembers.txt index cbae7a024d2..6db3e1c804a 100644 --- a/compiler/testData/psi/SimpleClassMembers.txt +++ b/compiler/testData/psi/SimpleClassMembers.txt @@ -1,5 +1,5 @@ JetFile: SimpleClassMembers.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/SimpleClassMembers_ERR.txt b/compiler/testData/psi/SimpleClassMembers_ERR.txt index 16bcb6cfd77..881d446ba96 100644 --- a/compiler/testData/psi/SimpleClassMembers_ERR.txt +++ b/compiler/testData/psi/SimpleClassMembers_ERR.txt @@ -1,5 +1,5 @@ JetFile: SimpleClassMembers_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/SimpleExpressions.txt b/compiler/testData/psi/SimpleExpressions.txt index 3831497dc81..1556d610c3f 100644 --- a/compiler/testData/psi/SimpleExpressions.txt +++ b/compiler/testData/psi/SimpleExpressions.txt @@ -1,5 +1,5 @@ JetFile: SimpleExpressions.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/SimpleModifiers.txt b/compiler/testData/psi/SimpleModifiers.txt index 892ba437751..74e9e31cf09 100644 --- a/compiler/testData/psi/SimpleModifiers.txt +++ b/compiler/testData/psi/SimpleModifiers.txt @@ -1,5 +1,5 @@ JetFile: SimpleModifiers.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/SoftKeywords.txt b/compiler/testData/psi/SoftKeywords.txt index a77557ea810..16f0fa4b0ca 100644 --- a/compiler/testData/psi/SoftKeywords.txt +++ b/compiler/testData/psi/SoftKeywords.txt @@ -1,5 +1,5 @@ JetFile: SoftKeywords.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/SoftKeywordsInTypeArguments.txt b/compiler/testData/psi/SoftKeywordsInTypeArguments.txt index cca20db0b58..b260b9c60ab 100644 --- a/compiler/testData/psi/SoftKeywordsInTypeArguments.txt +++ b/compiler/testData/psi/SoftKeywordsInTypeArguments.txt @@ -1,5 +1,5 @@ JetFile: SoftKeywordsInTypeArguments.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/StringTemplates.txt b/compiler/testData/psi/StringTemplates.txt index a85ce59c11a..929754ef42a 100644 --- a/compiler/testData/psi/StringTemplates.txt +++ b/compiler/testData/psi/StringTemplates.txt @@ -1,5 +1,5 @@ JetFile: StringTemplates.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/Super.txt b/compiler/testData/psi/Super.txt index 4389d494084..f66cee6d7ee 100644 --- a/compiler/testData/psi/Super.txt +++ b/compiler/testData/psi/Super.txt @@ -1,7 +1,7 @@ JetFile: Super.kt PsiComment(EOL_COMMENT)('// KT-156 Fix the this syntax') PsiWhiteSpace('\n') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/ThisType.txt b/compiler/testData/psi/ThisType.txt index 62e51b41f90..dac72f5be76 100644 --- a/compiler/testData/psi/ThisType.txt +++ b/compiler/testData/psi/ThisType.txt @@ -1,5 +1,5 @@ JetFile: ThisType.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/TryRecovery.txt b/compiler/testData/psi/TryRecovery.txt index 6f2d99f3ba2..876556e2e5b 100644 --- a/compiler/testData/psi/TryRecovery.txt +++ b/compiler/testData/psi/TryRecovery.txt @@ -1,5 +1,5 @@ JetFile: TryRecovery.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/TypeAnnotations.txt b/compiler/testData/psi/TypeAnnotations.txt index bab8e69b646..87ec097d236 100644 --- a/compiler/testData/psi/TypeAnnotations.txt +++ b/compiler/testData/psi/TypeAnnotations.txt @@ -1,5 +1,5 @@ JetFile: TypeAnnotations.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/TypeConstraints.txt b/compiler/testData/psi/TypeConstraints.txt index cfff9631969..6b1754c8a1e 100644 --- a/compiler/testData/psi/TypeConstraints.txt +++ b/compiler/testData/psi/TypeConstraints.txt @@ -1,5 +1,5 @@ JetFile: TypeConstraints.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/TypeDef.txt b/compiler/testData/psi/TypeDef.txt index ead79566dfc..1ffa18263b5 100644 --- a/compiler/testData/psi/TypeDef.txt +++ b/compiler/testData/psi/TypeDef.txt @@ -1,5 +1,5 @@ JetFile: TypeDef.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/TypeDef_ERR.txt b/compiler/testData/psi/TypeDef_ERR.txt index c0965d2a740..1619d91f2b4 100644 --- a/compiler/testData/psi/TypeDef_ERR.txt +++ b/compiler/testData/psi/TypeDef_ERR.txt @@ -1,5 +1,5 @@ JetFile: TypeDef_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE TYPEDEF PsiElement(type)('type') diff --git a/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt b/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt index b29a50df64e..2d6196bb6a9 100644 --- a/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt +++ b/compiler/testData/psi/TypeExpressionAmbiguities_ERR.txt @@ -1,5 +1,5 @@ JetFile: TypeExpressionAmbiguities_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/TypeParametersBeforeName.txt b/compiler/testData/psi/TypeParametersBeforeName.txt index ef9db3c6bfb..7cf176a5cae 100644 --- a/compiler/testData/psi/TypeParametersBeforeName.txt +++ b/compiler/testData/psi/TypeParametersBeforeName.txt @@ -1,5 +1,5 @@ JetFile: TypeParametersBeforeName.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/When.txt b/compiler/testData/psi/When.txt index 54c6e0ad59e..d0ced58445a 100644 --- a/compiler/testData/psi/When.txt +++ b/compiler/testData/psi/When.txt @@ -1,5 +1,5 @@ JetFile: When.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/When_ERR.txt b/compiler/testData/psi/When_ERR.txt index ba3240f5c03..b917240394e 100644 --- a/compiler/testData/psi/When_ERR.txt +++ b/compiler/testData/psi/When_ERR.txt @@ -1,5 +1,5 @@ JetFile: When_ERR.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/examples/AnonymousObjects.txt b/compiler/testData/psi/examples/AnonymousObjects.txt index 78d7951a47a..4132c9dc9ff 100644 --- a/compiler/testData/psi/examples/AnonymousObjects.txt +++ b/compiler/testData/psi/examples/AnonymousObjects.txt @@ -1,5 +1,5 @@ JetFile: AnonymousObjects.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/examples/BinaryTree.txt b/compiler/testData/psi/examples/BinaryTree.txt index 6e9e2ea4c99..0d54d6a022f 100644 --- a/compiler/testData/psi/examples/BinaryTree.txt +++ b/compiler/testData/psi/examples/BinaryTree.txt @@ -1,5 +1,5 @@ JetFile: BinaryTree.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/BitArith.txt b/compiler/testData/psi/examples/BitArith.txt index eb824bb8557..d5a4efbe197 100644 --- a/compiler/testData/psi/examples/BitArith.txt +++ b/compiler/testData/psi/examples/BitArith.txt @@ -1,5 +1,5 @@ JetFile: BitArith.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/examples/Builder.txt b/compiler/testData/psi/examples/Builder.txt index 5cdc7a59b7d..39bd3068cc1 100644 --- a/compiler/testData/psi/examples/Builder.txt +++ b/compiler/testData/psi/examples/Builder.txt @@ -1,5 +1,5 @@ JetFile: Builder.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/examples/Color.txt b/compiler/testData/psi/examples/Color.txt index 1c661f5f299..5ecddf8d79b 100644 --- a/compiler/testData/psi/examples/Color.txt +++ b/compiler/testData/psi/examples/Color.txt @@ -1,5 +1,5 @@ JetFile: Color.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.txt b/compiler/testData/psi/examples/FunctionsAndTypes.txt index 7945092fb5e..28848594c25 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.txt +++ b/compiler/testData/psi/examples/FunctionsAndTypes.txt @@ -1,5 +1,5 @@ JetFile: FunctionsAndTypes.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE TYPEDEF PsiElement(type)('type') diff --git a/compiler/testData/psi/examples/Graph.txt b/compiler/testData/psi/examples/Graph.txt index 3d001d1ae6c..e8e93234f9c 100644 --- a/compiler/testData/psi/examples/Graph.txt +++ b/compiler/testData/psi/examples/Graph.txt @@ -1,5 +1,5 @@ JetFile: Graph.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/IPushPop.txt b/compiler/testData/psi/examples/IPushPop.txt index a734dc11bed..6d3f295236b 100644 --- a/compiler/testData/psi/examples/IPushPop.txt +++ b/compiler/testData/psi/examples/IPushPop.txt @@ -1,5 +1,5 @@ JetFile: IPushPop.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/LINQ.txt b/compiler/testData/psi/examples/LINQ.txt index c417359eddc..25c7a6723a2 100644 --- a/compiler/testData/psi/examples/LINQ.txt +++ b/compiler/testData/psi/examples/LINQ.txt @@ -1,5 +1,5 @@ JetFile: LINQ.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/examples/PolymorphicClassObjects.txt b/compiler/testData/psi/examples/PolymorphicClassObjects.txt index f432e7ddf7b..eea22e954a5 100644 --- a/compiler/testData/psi/examples/PolymorphicClassObjects.txt +++ b/compiler/testData/psi/examples/PolymorphicClassObjects.txt @@ -1,5 +1,5 @@ JetFile: PolymorphicClassObjects.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/Queue.txt b/compiler/testData/psi/examples/Queue.txt index 4542b09a549..17f0c673295 100644 --- a/compiler/testData/psi/examples/Queue.txt +++ b/compiler/testData/psi/examples/Queue.txt @@ -1,5 +1,5 @@ JetFile: Queue.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/Stack.txt b/compiler/testData/psi/examples/Stack.txt index 1373a53e027..beb10b7b6ff 100644 --- a/compiler/testData/psi/examples/Stack.txt +++ b/compiler/testData/psi/examples/Stack.txt @@ -1,5 +1,5 @@ JetFile: Stack.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/UnionFind.txt b/compiler/testData/psi/examples/UnionFind.txt index 092f1f5ed49..04be8a3f361 100644 --- a/compiler/testData/psi/examples/UnionFind.txt +++ b/compiler/testData/psi/examples/UnionFind.txt @@ -1,5 +1,5 @@ JetFile: UnionFind.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/UpdateOperation.txt b/compiler/testData/psi/examples/UpdateOperation.txt index fc7c5336efc..8423ddc9825 100644 --- a/compiler/testData/psi/examples/UpdateOperation.txt +++ b/compiler/testData/psi/examples/UpdateOperation.txt @@ -1,5 +1,5 @@ JetFile: UpdateOperation.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/With.txt b/compiler/testData/psi/examples/With.txt index 1ab3ced3cdf..4400744bdcf 100644 --- a/compiler/testData/psi/examples/With.txt +++ b/compiler/testData/psi/examples/With.txt @@ -1,5 +1,5 @@ JetFile: With.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN MODIFIER_LIST diff --git a/compiler/testData/psi/examples/array/MutableArray.txt b/compiler/testData/psi/examples/array/MutableArray.txt index 28009b5b578..aae90cd6700 100644 --- a/compiler/testData/psi/examples/array/MutableArray.txt +++ b/compiler/testData/psi/examples/array/MutableArray.txt @@ -6,7 +6,7 @@ JetFile: MutableArray.kt PsiWhiteSpace('\n') PsiElement(KDOC_END)('*/') PsiWhiteSpace('\n\n') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/ArrayList.txt b/compiler/testData/psi/examples/collections/ArrayList.txt index 9121e1a12aa..fde5b4f3311 100644 --- a/compiler/testData/psi/examples/collections/ArrayList.txt +++ b/compiler/testData/psi/examples/collections/ArrayList.txt @@ -1,5 +1,5 @@ JetFile: ArrayList.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/collections/HashMap.txt b/compiler/testData/psi/examples/collections/HashMap.txt index 10f02a817ef..29604e8fe9f 100644 --- a/compiler/testData/psi/examples/collections/HashMap.txt +++ b/compiler/testData/psi/examples/collections/HashMap.txt @@ -1,5 +1,5 @@ JetFile: HashMap.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/IIterable.txt b/compiler/testData/psi/examples/collections/IIterable.txt index 5a2986ac953..94afea66c00 100644 --- a/compiler/testData/psi/examples/collections/IIterable.txt +++ b/compiler/testData/psi/examples/collections/IIterable.txt @@ -1,5 +1,5 @@ JetFile: IIterable.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/IIterator.txt b/compiler/testData/psi/examples/collections/IIterator.txt index 7270c3eeb90..a5ad9553908 100644 --- a/compiler/testData/psi/examples/collections/IIterator.txt +++ b/compiler/testData/psi/examples/collections/IIterator.txt @@ -1,5 +1,5 @@ JetFile: IIterator.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/IList.txt b/compiler/testData/psi/examples/collections/IList.txt index 8d0eb9a8560..b31ba602706 100644 --- a/compiler/testData/psi/examples/collections/IList.txt +++ b/compiler/testData/psi/examples/collections/IList.txt @@ -1,5 +1,5 @@ JetFile: IList.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/IMutableIterable.txt b/compiler/testData/psi/examples/collections/IMutableIterable.txt index 9484af62b21..ec6864ab2db 100644 --- a/compiler/testData/psi/examples/collections/IMutableIterable.txt +++ b/compiler/testData/psi/examples/collections/IMutableIterable.txt @@ -1,5 +1,5 @@ JetFile: IMutableIterable.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/IMutableIterator.txt b/compiler/testData/psi/examples/collections/IMutableIterator.txt index b2b3514c221..928b28ff43b 100644 --- a/compiler/testData/psi/examples/collections/IMutableIterator.txt +++ b/compiler/testData/psi/examples/collections/IMutableIterator.txt @@ -1,5 +1,5 @@ JetFile: IMutableIterator.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/IMutableList.txt b/compiler/testData/psi/examples/collections/IMutableList.txt index 4676d0a8ef9..e0940a5cae5 100644 --- a/compiler/testData/psi/examples/collections/IMutableList.txt +++ b/compiler/testData/psi/examples/collections/IMutableList.txt @@ -1,5 +1,5 @@ JetFile: IMutableList.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/IMutableSet.txt b/compiler/testData/psi/examples/collections/IMutableSet.txt index 352ba989d66..73137efa3c9 100644 --- a/compiler/testData/psi/examples/collections/IMutableSet.txt +++ b/compiler/testData/psi/examples/collections/IMutableSet.txt @@ -1,5 +1,5 @@ JetFile: IMutableSet.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/ISet.txt b/compiler/testData/psi/examples/collections/ISet.txt index b0c314df151..e50a80359d9 100644 --- a/compiler/testData/psi/examples/collections/ISet.txt +++ b/compiler/testData/psi/examples/collections/ISet.txt @@ -1,5 +1,5 @@ JetFile: ISet.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/ISized.txt b/compiler/testData/psi/examples/collections/ISized.txt index 0e3260f7817..618be54dc4c 100644 --- a/compiler/testData/psi/examples/collections/ISized.txt +++ b/compiler/testData/psi/examples/collections/ISized.txt @@ -1,5 +1,5 @@ JetFile: ISized.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/collections/LinkedList.txt b/compiler/testData/psi/examples/collections/LinkedList.txt index cd2afbe46f3..bf534007c70 100644 --- a/compiler/testData/psi/examples/collections/LinkedList.txt +++ b/compiler/testData/psi/examples/collections/LinkedList.txt @@ -1,5 +1,5 @@ JetFile: LinkedList.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/io/IOSamples.txt b/compiler/testData/psi/examples/io/IOSamples.txt index 666e51064c2..6d00f8b9944 100644 --- a/compiler/testData/psi/examples/io/IOSamples.txt +++ b/compiler/testData/psi/examples/io/IOSamples.txt @@ -1,5 +1,5 @@ JetFile: IOSamples.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/map/IMap.txt b/compiler/testData/psi/examples/map/IMap.txt index c14dddf9f7a..dba9f1bc92c 100644 --- a/compiler/testData/psi/examples/map/IMap.txt +++ b/compiler/testData/psi/examples/map/IMap.txt @@ -1,5 +1,5 @@ JetFile: IMap.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/priorityqueues/BinaryHeap.txt b/compiler/testData/psi/examples/priorityqueues/BinaryHeap.txt index 290977483b2..8a5c7948c9e 100644 --- a/compiler/testData/psi/examples/priorityqueues/BinaryHeap.txt +++ b/compiler/testData/psi/examples/priorityqueues/BinaryHeap.txt @@ -1,5 +1,5 @@ JetFile: BinaryHeap.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/priorityqueues/IPriorityQueue.txt b/compiler/testData/psi/examples/priorityqueues/IPriorityQueue.txt index 35366e47659..1de24a7724e 100644 --- a/compiler/testData/psi/examples/priorityqueues/IPriorityQueue.txt +++ b/compiler/testData/psi/examples/priorityqueues/IPriorityQueue.txt @@ -1,5 +1,5 @@ JetFile: IPriorityQueue.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt b/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt index 05da7c3f2cc..b765cf5b3c9 100644 --- a/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt +++ b/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt @@ -1,5 +1,5 @@ JetFile: PriorityQueueAsPushPop.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/examples/util/Comparison.txt b/compiler/testData/psi/examples/util/Comparison.txt index a1b24fcb293..1cecdfbc166 100644 --- a/compiler/testData/psi/examples/util/Comparison.txt +++ b/compiler/testData/psi/examples/util/Comparison.txt @@ -1,5 +1,5 @@ JetFile: Comparison.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE TYPEDEF PsiElement(type)('type') diff --git a/compiler/testData/psi/examples/util/IComparable.txt b/compiler/testData/psi/examples/util/IComparable.txt index e903eef55a8..3ecc0834e24 100644 --- a/compiler/testData/psi/examples/util/IComparable.txt +++ b/compiler/testData/psi/examples/util/IComparable.txt @@ -1,5 +1,5 @@ JetFile: IComparable.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS MODIFIER_LIST diff --git a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt index 0e14cfd59d7..73c6b136111 100644 --- a/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt +++ b/compiler/testData/psi/functionReceivers/FunctionTypesWithFunctionReceivers.txt @@ -1,5 +1,5 @@ JetFile: FunctionTypesWithFunctionReceivers.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE TYPEDEF PsiElement(type)('type') diff --git a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt index 7b44fed1f17..6168ad7aff7 100644 --- a/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt +++ b/compiler/testData/psi/functionReceivers/FunctionsWithFunctionReceivers.txt @@ -1,5 +1,5 @@ JetFile: FunctionsWithFunctionReceivers.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt index 1294994a702..f82888cc5bc 100644 --- a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceivers.txt @@ -1,5 +1,5 @@ JetFile: PropertiesWithFunctionReceivers.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.txt b/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.txt index 0271d320279..85e54bdfe42 100644 --- a/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.txt +++ b/compiler/testData/psi/greatSyntacticShift/FunctionTypesAsArguments.txt @@ -1,5 +1,5 @@ JetFile: FunctionTypesAsArguments.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt index ab62bf033f3..4c0da14cd89 100644 --- a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt +++ b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt @@ -1,5 +1,5 @@ JetFile: functionLiterals.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/greatSyntacticShift/functionTypes.txt b/compiler/testData/psi/greatSyntacticShift/functionTypes.txt index 22d8abaeb29..1d2f2f55d61 100644 --- a/compiler/testData/psi/greatSyntacticShift/functionTypes.txt +++ b/compiler/testData/psi/greatSyntacticShift/functionTypes.txt @@ -1,5 +1,5 @@ JetFile: functionTypes.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/kdoc/AtTags.txt b/compiler/testData/psi/kdoc/AtTags.txt index 8f8e2ca9a89..dc947919a77 100644 --- a/compiler/testData/psi/kdoc/AtTags.txt +++ b/compiler/testData/psi/kdoc/AtTags.txt @@ -13,5 +13,5 @@ JetFile: AtTags.kt PsiElement(KDOC_TEXT)(' @') PsiWhiteSpace('\n ') PsiElement(KDOC_END)('*/') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile1.txt b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile1.txt index 2217171312a..357f480c612 100644 --- a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile1.txt +++ b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile1.txt @@ -1,5 +1,5 @@ JetFile: DocCommentAtBeginningOfFile1.kt KDoc PsiElement(KDOC_START)('/**') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile2.txt b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile2.txt index 0169b7f582c..e7d60df0edc 100644 --- a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile2.txt +++ b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile2.txt @@ -3,5 +3,5 @@ JetFile: DocCommentAtBeginningOfFile2.kt PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n') PsiElement(KDOC_TEXT)('/**') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile3.txt b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile3.txt index 61d1f9a4efd..93c8b5aa595 100644 --- a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile3.txt +++ b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile3.txt @@ -3,5 +3,5 @@ JetFile: DocCommentAtBeginningOfFile3.kt PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n\n') PsiElement(KDOC_TEXT)('fooo') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile4.txt b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile4.txt index 56dcdf01f9e..b1303e6322c 100644 --- a/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile4.txt +++ b/compiler/testData/psi/kdoc/DocCommentAtBeginningOfFile4.txt @@ -5,5 +5,5 @@ JetFile: DocCommentAtBeginningOfFile4.kt PsiElement(KDOC_TEXT)('/**foo*/') PsiWhiteSpace('\n\n') PsiElement(KDOC_TEXT)('asdfas') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/EndOnLeadingAsterisks.txt b/compiler/testData/psi/kdoc/EndOnLeadingAsterisks.txt index ae11f8e6eaf..01df82cf050 100644 --- a/compiler/testData/psi/kdoc/EndOnLeadingAsterisks.txt +++ b/compiler/testData/psi/kdoc/EndOnLeadingAsterisks.txt @@ -3,5 +3,5 @@ JetFile: EndOnLeadingAsterisks.kt PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n ') PsiElement(KDOC_END)('*/') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/EndRightAfterText.txt b/compiler/testData/psi/kdoc/EndRightAfterText.txt index 77d84b91e6c..a4388e32dc6 100644 --- a/compiler/testData/psi/kdoc/EndRightAfterText.txt +++ b/compiler/testData/psi/kdoc/EndRightAfterText.txt @@ -3,5 +3,5 @@ JetFile: EndRightAfterText.kt PsiElement(KDOC_START)('/**') PsiElement(KDOC_TEXT)('text') PsiElement(KDOC_END)('*/') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/Incomplete.txt b/compiler/testData/psi/kdoc/Incomplete.txt index 349ed596f2f..63a3269e7bf 100644 --- a/compiler/testData/psi/kdoc/Incomplete.txt +++ b/compiler/testData/psi/kdoc/Incomplete.txt @@ -3,5 +3,5 @@ JetFile: Incomplete.kt PsiElement(KDOC_START)('/**') PsiWhiteSpace('\n ') PsiElement(KDOC_TEXT)('contents') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/Markdown.txt b/compiler/testData/psi/kdoc/Markdown.txt index 318ee50ca37..e6b4fae5eba 100644 --- a/compiler/testData/psi/kdoc/Markdown.txt +++ b/compiler/testData/psi/kdoc/Markdown.txt @@ -16,5 +16,5 @@ JetFile: Markdown.kt PsiElement(KDOC_TEXT)(']') PsiWhiteSpace('\n ') PsiElement(KDOC_END)('*/') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/Simple.txt b/compiler/testData/psi/kdoc/Simple.txt index cba272a3bd0..81eeb7b235d 100644 --- a/compiler/testData/psi/kdoc/Simple.txt +++ b/compiler/testData/psi/kdoc/Simple.txt @@ -19,5 +19,5 @@ JetFile: Simple.kt PsiElement(KDOC_LEADING_ASTERISK)('**') PsiElement(KDOC_TEXT)(' line 6 ') PsiElement(KDOC_END)('*/') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/kdoc/TextRightAfterLeadAsterisks.txt b/compiler/testData/psi/kdoc/TextRightAfterLeadAsterisks.txt index 4123145ff44..86dad80bcf4 100644 --- a/compiler/testData/psi/kdoc/TextRightAfterLeadAsterisks.txt +++ b/compiler/testData/psi/kdoc/TextRightAfterLeadAsterisks.txt @@ -6,5 +6,5 @@ JetFile: TextRightAfterLeadAsterisks.kt PsiElement(KDOC_TEXT)('test') PsiWhiteSpace('\n ') PsiElement(KDOC_END)('*/') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE \ No newline at end of file diff --git a/compiler/testData/psi/propertyDelegate/BracketsInDelegate.txt b/compiler/testData/psi/propertyDelegate/BracketsInDelegate.txt index b4ea70eb1ed..a7ffe6f2240 100644 --- a/compiler/testData/psi/propertyDelegate/BracketsInDelegate.txt +++ b/compiler/testData/psi/propertyDelegate/BracketsInDelegate.txt @@ -1,5 +1,5 @@ JetFile: BracketsInDelegate.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/propertyDelegate/DelegateAndInitializer.txt b/compiler/testData/psi/propertyDelegate/DelegateAndInitializer.txt index ec3e3ba8d75..cb346cf9da1 100644 --- a/compiler/testData/psi/propertyDelegate/DelegateAndInitializer.txt +++ b/compiler/testData/psi/propertyDelegate/DelegateAndInitializer.txt @@ -1,5 +1,5 @@ JetFile: DelegateAndInitializer.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/propertyDelegate/GetterInSameLine.txt b/compiler/testData/psi/propertyDelegate/GetterInSameLine.txt index 47ce24b56ef..b0057fddf68 100644 --- a/compiler/testData/psi/propertyDelegate/GetterInSameLine.txt +++ b/compiler/testData/psi/propertyDelegate/GetterInSameLine.txt @@ -1,5 +1,5 @@ JetFile: GetterInSameLine.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/propertyDelegate/LocalProperty.txt b/compiler/testData/psi/propertyDelegate/LocalProperty.txt index 04ac985df78..69cdc2ad381 100644 --- a/compiler/testData/psi/propertyDelegate/LocalProperty.txt +++ b/compiler/testData/psi/propertyDelegate/LocalProperty.txt @@ -1,5 +1,5 @@ JetFile: LocalProperty.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/propertyDelegate/OnlyBy.txt b/compiler/testData/psi/propertyDelegate/OnlyBy.txt index ec51ff8ce06..2f13850ab80 100644 --- a/compiler/testData/psi/propertyDelegate/OnlyBy.txt +++ b/compiler/testData/psi/propertyDelegate/OnlyBy.txt @@ -1,5 +1,5 @@ JetFile: OnlyBy.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/propertyDelegate/PropertyInClass.txt b/compiler/testData/psi/propertyDelegate/PropertyInClass.txt index 297028c20c0..97630fb371b 100644 --- a/compiler/testData/psi/propertyDelegate/PropertyInClass.txt +++ b/compiler/testData/psi/propertyDelegate/PropertyInClass.txt @@ -1,5 +1,5 @@ JetFile: PropertyInClass.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/propertyDelegate/PropertyWithGetter.txt b/compiler/testData/psi/propertyDelegate/PropertyWithGetter.txt index 3388462b625..2e3a4e7089e 100644 --- a/compiler/testData/psi/propertyDelegate/PropertyWithGetter.txt +++ b/compiler/testData/psi/propertyDelegate/PropertyWithGetter.txt @@ -1,5 +1,5 @@ JetFile: PropertyWithGetter.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/propertyDelegate/PropertyWithInitializer.txt b/compiler/testData/psi/propertyDelegate/PropertyWithInitializer.txt index 616548a94d5..3cc00ceaeb2 100644 --- a/compiler/testData/psi/propertyDelegate/PropertyWithInitializer.txt +++ b/compiler/testData/psi/propertyDelegate/PropertyWithInitializer.txt @@ -1,5 +1,5 @@ JetFile: PropertyWithInitializer.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/propertyDelegate/PropertyWithoutTypeRef.txt b/compiler/testData/psi/propertyDelegate/PropertyWithoutTypeRef.txt index 141ebad4ba8..39929d11e2b 100644 --- a/compiler/testData/psi/propertyDelegate/PropertyWithoutTypeRef.txt +++ b/compiler/testData/psi/propertyDelegate/PropertyWithoutTypeRef.txt @@ -1,5 +1,5 @@ JetFile: PropertyWithoutTypeRef.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/propertyDelegate/TopLevelProperty.txt b/compiler/testData/psi/propertyDelegate/TopLevelProperty.txt index 95c4d8230a7..b34e182c1e1 100644 --- a/compiler/testData/psi/propertyDelegate/TopLevelProperty.txt +++ b/compiler/testData/psi/propertyDelegate/TopLevelProperty.txt @@ -1,5 +1,5 @@ JetFile: TopLevelProperty.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/propertyDelegate/TwoProperties.txt b/compiler/testData/psi/propertyDelegate/TwoProperties.txt index 441977f1d4f..40ea2c6cb72 100644 --- a/compiler/testData/psi/propertyDelegate/TwoProperties.txt +++ b/compiler/testData/psi/propertyDelegate/TwoProperties.txt @@ -1,5 +1,5 @@ JetFile: TwoProperties.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/recovery/AbsentLeftHandSide.txt b/compiler/testData/psi/recovery/AbsentLeftHandSide.txt index caa4488cb55..dd5b28e78ac 100644 --- a/compiler/testData/psi/recovery/AbsentLeftHandSide.txt +++ b/compiler/testData/psi/recovery/AbsentLeftHandSide.txt @@ -1,5 +1,5 @@ JetFile: AbsentLeftHandSide.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/recovery/ForRecovery.txt b/compiler/testData/psi/recovery/ForRecovery.txt index 2aa4037f288..83a91ae53aa 100644 --- a/compiler/testData/psi/recovery/ForRecovery.txt +++ b/compiler/testData/psi/recovery/ForRecovery.txt @@ -1,5 +1,5 @@ JetFile: ForRecovery.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/recovery/ImportRecovery.txt b/compiler/testData/psi/recovery/ImportRecovery.txt index f00d408bb7b..33d68ffa6ee 100644 --- a/compiler/testData/psi/recovery/ImportRecovery.txt +++ b/compiler/testData/psi/recovery/ImportRecovery.txt @@ -1,5 +1,5 @@ JetFile: ImportRecovery.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE IMPORT_LIST IMPORT_DIRECTIVE diff --git a/compiler/testData/psi/recovery/MissingCommaInConstructorValueParameterList.txt b/compiler/testData/psi/recovery/MissingCommaInConstructorValueParameterList.txt index 429eed1eb94..a7faeaf09f1 100644 --- a/compiler/testData/psi/recovery/MissingCommaInConstructorValueParameterList.txt +++ b/compiler/testData/psi/recovery/MissingCommaInConstructorValueParameterList.txt @@ -1,5 +1,5 @@ JetFile: MissingCommaInConstructorValueParameterList.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.txt b/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.txt index 76cd7f04939..07e56872772 100644 --- a/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.txt +++ b/compiler/testData/psi/recovery/MissingCommaInValueArgumentList.txt @@ -1,5 +1,5 @@ JetFile: MissingCommaInValueArgumentList.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PROPERTY PsiElement(val)('val') diff --git a/compiler/testData/psi/recovery/MissingCommaInValueParameterList.txt b/compiler/testData/psi/recovery/MissingCommaInValueParameterList.txt index 4513f1146d8..48a0a86301d 100644 --- a/compiler/testData/psi/recovery/MissingCommaInValueParameterList.txt +++ b/compiler/testData/psi/recovery/MissingCommaInValueParameterList.txt @@ -1,5 +1,5 @@ JetFile: MissingCommaInValueParameterList.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/recovery/PackageRecovery.txt b/compiler/testData/psi/recovery/PackageRecovery.txt index ad9da23aa98..09f8b1341eb 100644 --- a/compiler/testData/psi/recovery/PackageRecovery.txt +++ b/compiler/testData/psi/recovery/PackageRecovery.txt @@ -1,5 +1,5 @@ JetFile: PackageRecovery.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE PsiElement(package)('package') PsiWhiteSpace(' ') REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/SameLineStatementRecovery.txt b/compiler/testData/psi/recovery/SameLineStatementRecovery.txt index 227127074f0..0382c28f80a 100644 --- a/compiler/testData/psi/recovery/SameLineStatementRecovery.txt +++ b/compiler/testData/psi/recovery/SameLineStatementRecovery.txt @@ -1,5 +1,5 @@ JetFile: SameLineStatementRecovery.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE FUN PsiElement(fun)('fun') diff --git a/compiler/testData/psi/recovery/ValueParameterNoTypeRecovery.txt b/compiler/testData/psi/recovery/ValueParameterNoTypeRecovery.txt index d14bea35c4f..edc285eefe6 100644 --- a/compiler/testData/psi/recovery/ValueParameterNoTypeRecovery.txt +++ b/compiler/testData/psi/recovery/ValueParameterNoTypeRecovery.txt @@ -1,5 +1,5 @@ JetFile: ValueParameterNoTypeRecovery.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/recovery/kt2172.txt b/compiler/testData/psi/recovery/kt2172.txt index 62b81b16033..1be9fc091a2 100644 --- a/compiler/testData/psi/recovery/kt2172.txt +++ b/compiler/testData/psi/recovery/kt2172.txt @@ -1,5 +1,5 @@ JetFile: kt2172.kt - NAMESPACE_HEADER + PACKAGE_DIRECTIVE CLASS PsiElement(class)('class') diff --git a/compiler/testData/psi/script/ComplexScript.txt b/compiler/testData/psi/script/ComplexScript.txt index eeebb6aaa8f..50bee38ee68 100644 --- a/compiler/testData/psi/script/ComplexScript.txt +++ b/compiler/testData/psi/script/ComplexScript.txt @@ -1,5 +1,5 @@ JetFile: ComplexScript.ktscript - NAMESPACE_HEADER + PACKAGE_DIRECTIVE SCRIPT BLOCK diff --git a/compiler/testData/psi/script/Import.txt b/compiler/testData/psi/script/Import.txt index 5be89deca9e..2ed21609755 100644 --- a/compiler/testData/psi/script/Import.txt +++ b/compiler/testData/psi/script/Import.txt @@ -1,5 +1,5 @@ JetFile: Import.ktscript - NAMESPACE_HEADER + PACKAGE_DIRECTIVE SCRIPT IMPORT_DIRECTIVE diff --git a/compiler/testData/psi/script/Shebang.txt b/compiler/testData/psi/script/Shebang.txt index 5dcb4f97483..e67a0c0cd54 100644 --- a/compiler/testData/psi/script/Shebang.txt +++ b/compiler/testData/psi/script/Shebang.txt @@ -1,7 +1,7 @@ JetFile: Shebang.ktscript PsiComment(SHEBANG_COMMENT)('#!/usr/bin/env kotlin') PsiWhiteSpace('\n\n') - NAMESPACE_HEADER + PACKAGE_DIRECTIVE SCRIPT BLOCK diff --git a/compiler/testData/psi/script/ShebangIncorrect.txt b/compiler/testData/psi/script/ShebangIncorrect.txt index 9067541ed30..a6b59d43145 100644 --- a/compiler/testData/psi/script/ShebangIncorrect.txt +++ b/compiler/testData/psi/script/ShebangIncorrect.txt @@ -1,5 +1,5 @@ JetFile: ShebangIncorrect.ktscript - NAMESPACE_HEADER + PACKAGE_DIRECTIVE SCRIPT BLOCK diff --git a/compiler/testData/psi/script/SimpleScript.txt b/compiler/testData/psi/script/SimpleScript.txt index 49ccaa2aa37..f6d61720a97 100644 --- a/compiler/testData/psi/script/SimpleScript.txt +++ b/compiler/testData/psi/script/SimpleScript.txt @@ -1,5 +1,5 @@ JetFile: SimpleScript.ktscript - NAMESPACE_HEADER + PACKAGE_DIRECTIVE SCRIPT BLOCK diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveDescriptorRendererTest.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveDescriptorRendererTest.java index 7682d431a43..488d54fa0ab 100644 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveDescriptorRendererTest.java +++ b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/AbstractLazyResolveDescriptorRendererTest.java @@ -61,7 +61,7 @@ public abstract class AbstractLazyResolveDescriptorRendererTest extends KotlinTe psiFile.accept(new JetVisitorVoid() { @Override public void visitJetFile(@NotNull JetFile file) { - FqName fqName = file.getNamespaceHeader().getFqName(); + FqName fqName = file.getPackageDirective().getFqName(); if (!fqName.isRoot()) { PackageViewDescriptor packageDescriptor = lazyModule.getPackage(fqName); descriptors.add(packageDescriptor); diff --git a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveTestUtil.java b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveTestUtil.java index bd15b6012bd..abadcf2f2b5 100644 --- a/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveTestUtil.java +++ b/compiler/tests/org/jetbrains/jet/lang/resolve/lazy/LazyResolveTestUtil.java @@ -31,7 +31,7 @@ import org.jetbrains.jet.di.InjectorForTopDownAnalyzerForJvm; import org.jetbrains.jet.lang.descriptors.ModuleDescriptor; import org.jetbrains.jet.lang.descriptors.ModuleDescriptorImpl; import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.psi.JetNamespaceHeader; +import org.jetbrains.jet.lang.psi.JetPackageDirective; import org.jetbrains.jet.lang.psi.JetSimpleNameExpression; import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter; import org.jetbrains.jet.lang.resolve.BindingTrace; @@ -93,9 +93,9 @@ public class LazyResolveTestUtil { public static Set getTopLevelPackagesFromFileList(@NotNull List files) { Set shortNames = Sets.newLinkedHashSet(); for (JetFile file : files) { - JetNamespaceHeader header = file.getNamespaceHeader(); - if (header != null) { - List names = header.getNamespaceNames(); + JetPackageDirective directive = file.getPackageDirective(); + if (directive != null) { + List names = directive.getPackageNames(); Name name = names.isEmpty() ? SpecialNames.ROOT_PACKAGE : names.get(0).getReferencedNameAsName(); shortNames.add(name); } diff --git a/compiler/tests/org/jetbrains/jet/renderer/DescriptorRendererTest.java b/compiler/tests/org/jetbrains/jet/renderer/DescriptorRendererTest.java index cade2832dd8..d8d0f4adfac 100644 --- a/compiler/tests/org/jetbrains/jet/renderer/DescriptorRendererTest.java +++ b/compiler/tests/org/jetbrains/jet/renderer/DescriptorRendererTest.java @@ -97,7 +97,7 @@ public class DescriptorRendererTest extends JetLiteFixture { final BindingContext bindingContext = analyzeExhaust.getBindingContext(); final List descriptors = new ArrayList(); - FqName fqName = psiFile.getNamespaceHeader().getFqName(); + FqName fqName = psiFile.getPackageDirective().getFqName(); if (!fqName.isRoot()) { PackageViewDescriptor packageDescriptor = analyzeExhaust.getModuleDescriptor().getPackage(fqName); descriptors.add(packageDescriptor); diff --git a/compiler/tests/org/jetbrains/jet/resolve/ExpectedResolveData.java b/compiler/tests/org/jetbrains/jet/resolve/ExpectedResolveData.java index 952a0b0bd04..829b7eb038c 100644 --- a/compiler/tests/org/jetbrains/jet/resolve/ExpectedResolveData.java +++ b/compiler/tests/org/jetbrains/jet/resolve/ExpectedResolveData.java @@ -178,8 +178,8 @@ public abstract class ExpectedResolveData { else { ancestorOfType = getAncestorOfType(JetDeclaration.class, element); if (ancestorOfType == null) { - JetNamespaceHeader header = getAncestorOfType(JetNamespaceHeader.class, element); - assert header != null : "Not a declaration: " + name; + JetPackageDirective directive = getAncestorOfType(JetPackageDirective.class, element); + assert directive != null : "Not a declaration: " + name; ancestorOfType = element; } } @@ -262,10 +262,10 @@ public abstract class ExpectedResolveData { assert expected != null : "No declaration for " + name; if (referenceTarget instanceof PackageViewDescriptor) { - JetNamespaceHeader expectedHeader = PsiTreeUtil.getParentOfType(expected, JetNamespaceHeader.class); + JetPackageDirective expectedDirective = PsiTreeUtil.getParentOfType(expected, JetPackageDirective.class); FqName expectedFqName; - if (expectedHeader != null) { - expectedFqName = expectedHeader.getFqName(); + if (expectedDirective != null) { + expectedFqName = expectedDirective.getFqName(); } else if (expected instanceof PsiQualifiedNamedElement) { String qualifiedName = ((PsiQualifiedNamedElement) expected).getQualifiedName(); diff --git a/idea/src/org/jetbrains/jet/plugin/JetIconProvider.java b/idea/src/org/jetbrains/jet/plugin/JetIconProvider.java index a1268443475..acffc7a468d 100644 --- a/idea/src/org/jetbrains/jet/plugin/JetIconProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/JetIconProvider.java @@ -94,7 +94,7 @@ public class JetIconProvider extends IconProvider { } public static Icon getBaseIcon(PsiElement psiElement) { - if (psiElement instanceof JetNamespaceHeader) { + if (psiElement instanceof JetPackageDirective) { return PlatformIcons.PACKAGE_ICON; } diff --git a/idea/src/org/jetbrains/jet/plugin/JetQuickDocumentationProvider.java b/idea/src/org/jetbrains/jet/plugin/JetQuickDocumentationProvider.java index f105eeb3f2f..d1adf128ff9 100644 --- a/idea/src/org/jetbrains/jet/plugin/JetQuickDocumentationProvider.java +++ b/idea/src/org/jetbrains/jet/plugin/JetQuickDocumentationProvider.java @@ -26,16 +26,12 @@ import com.intellij.psi.tree.IElementType; import com.intellij.psi.util.PsiTreeUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.asJava.KotlinLightClass; -import org.jetbrains.jet.asJava.KotlinLightClassForExplicitDeclaration; -import org.jetbrains.jet.asJava.KotlinLightClassForPackage; import org.jetbrains.jet.kdoc.lexer.KDocTokens; import org.jetbrains.jet.kdoc.psi.api.KDoc; import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.java.jetAsJava.KotlinLightMethod; -import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache; import org.jetbrains.jet.renderer.DescriptorRenderer; @@ -45,7 +41,7 @@ public class JetQuickDocumentationProvider extends AbstractDocumentationProvider public boolean apply(PsiElement input) { // Skip empty namespace because there can be comments before it // Skip whitespaces - return (input instanceof JetNamespaceHeader && input.getChildren().length == 0) || input instanceof PsiWhiteSpace; + return (input instanceof JetPackageDirective && input.getChildren().length == 0) || input instanceof PsiWhiteSpace; } }; diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/TipsManager.java b/idea/src/org/jetbrains/jet/plugin/codeInsight/TipsManager.java index a4f236c2f3c..e0ac6d0b3ed 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/TipsManager.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/TipsManager.java @@ -28,7 +28,7 @@ import org.jetbrains.jet.lang.descriptors.PackageViewDescriptor; import org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor; import org.jetbrains.jet.lang.psi.JetExpression; import org.jetbrains.jet.lang.psi.JetImportDirective; -import org.jetbrains.jet.lang.psi.JetNamespaceHeader; +import org.jetbrains.jet.lang.psi.JetPackageDirective; import org.jetbrains.jet.lang.psi.JetSimpleNameExpression; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.calls.autocasts.AutoCastUtils; @@ -94,7 +94,7 @@ public final class TipsManager { public static Collection getVariantsNoReceiver(JetExpression expression, BindingContext context) { JetScope resolutionScope = context.get(BindingContext.RESOLUTION_SCOPE, expression); if (resolutionScope != null) { - if (expression.getParent() instanceof JetImportDirective || expression.getParent() instanceof JetNamespaceHeader) { + if (expression.getParent() instanceof JetImportDirective || expression.getParent() instanceof JetPackageDirective) { return excludeNonPackageDescriptors(resolutionScope.getAllDescriptors()); } else { 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 fda0d2b9b09..cf30f05f09f 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/upDownMover/JetDeclarationMover.java @@ -259,7 +259,7 @@ public class JetDeclarationMover extends AbstractJetUpDownMover { } private static boolean isEmptyNamespaceHeader(PsiElement adjustedSibling) { - return adjustedSibling instanceof JetNamespaceHeader && adjustedSibling.getTextLength() == 0; + return adjustedSibling instanceof JetPackageDirective && adjustedSibling.getTextLength() == 0; } @Override diff --git a/idea/src/org/jetbrains/jet/plugin/completion/JetPackagesContributor.java b/idea/src/org/jetbrains/jet/plugin/completion/JetPackagesContributor.java index d3f984f09f2..926c2464074 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/JetPackagesContributor.java +++ b/idea/src/org/jetbrains/jet/plugin/completion/JetPackagesContributor.java @@ -26,7 +26,7 @@ import com.intellij.psi.PsiReference; import com.intellij.util.ProcessingContext; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.psi.JetNamespaceHeader; +import org.jetbrains.jet.lang.psi.JetPackageDirective; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.plugin.codeInsight.TipsManager; import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache; @@ -42,7 +42,7 @@ public class JetPackagesContributor extends CompletionContributor { static final String DUMMY_IDENTIFIER = "___package___"; static final ElementPattern ACTIVATION_PATTERN = - PlatformPatterns.psiElement().inside(JetNamespaceHeader.class); + PlatformPatterns.psiElement().inside(JetPackageDirective.class); public JetPackagesContributor() { diff --git a/idea/src/org/jetbrains/jet/plugin/editor/importOptimizer/JetImportOptimizer.java b/idea/src/org/jetbrains/jet/plugin/editor/importOptimizer/JetImportOptimizer.java index 1424c926b6c..15b75059d48 100644 --- a/idea/src/org/jetbrains/jet/plugin/editor/importOptimizer/JetImportOptimizer.java +++ b/idea/src/org/jetbrains/jet/plugin/editor/importOptimizer/JetImportOptimizer.java @@ -33,7 +33,6 @@ import org.jetbrains.jet.lang.resolve.ImportPath; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.java.JavaResolverPsiUtils; import org.jetbrains.jet.lang.resolve.name.FqName; -import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe; import org.jetbrains.jet.lang.resolve.name.Name; import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache; import org.jetbrains.jet.util.QualifiedNamesUtil; @@ -131,7 +130,7 @@ public class JetImportOptimizer implements ImportOptimizer { @Override public void visitReferenceExpression(@NotNull JetReferenceExpression expression) { if (PsiTreeUtil.getParentOfType(expression, JetImportDirective.class) == null && - PsiTreeUtil.getParentOfType(expression, JetNamespaceHeader.class) == null) { + PsiTreeUtil.getParentOfType(expression, JetPackageDirective.class) == null) { PsiReference reference = expression.getReference(); if (reference != null) { @@ -199,9 +198,9 @@ public class JetImportOptimizer implements ImportOptimizer { } if (element instanceof JetSimpleNameExpression) { - JetNamespaceHeader namespaceHeader = PsiTreeUtil.getParentOfType(element, JetNamespaceHeader.class); - if (namespaceHeader != null) { - List simpleNameExpressions = PsiTreeUtil.getChildrenOfTypeAsList(namespaceHeader, JetSimpleNameExpression.class); + JetPackageDirective packageDirective = PsiTreeUtil.getParentOfType(element, JetPackageDirective.class); + if (packageDirective != null) { + List simpleNameExpressions = PsiTreeUtil.getChildrenOfTypeAsList(packageDirective, JetSimpleNameExpression.class); FqName fqName = null; for (JetSimpleNameExpression nameExpression : simpleNameExpressions) { Name referencedName = nameExpression.getReferencedNameAsName(); diff --git a/idea/src/org/jetbrains/jet/plugin/formatter/JetFormattingModelBuilder.java b/idea/src/org/jetbrains/jet/plugin/formatter/JetFormattingModelBuilder.java index 74cb8699789..5a8fd779048 100644 --- a/idea/src/org/jetbrains/jet/plugin/formatter/JetFormattingModelBuilder.java +++ b/idea/src/org/jetbrains/jet/plugin/formatter/JetFormattingModelBuilder.java @@ -49,7 +49,7 @@ public class JetFormattingModelBuilder implements FormattingModelBuilder { return new SpacingBuilder(settings, JetLanguage.INSTANCE) // ============ Line breaks ============== - .after(NAMESPACE_HEADER).blankLines(1) + .after(PACKAGE_DIRECTIVE).blankLines(1) .between(IMPORT_DIRECTIVE, IMPORT_DIRECTIVE).lineBreakInCode() .after(IMPORT_LIST).blankLines(1) diff --git a/idea/src/org/jetbrains/jet/plugin/liveTemplates/JetTemplateContextType.java b/idea/src/org/jetbrains/jet/plugin/liveTemplates/JetTemplateContextType.java index 8d6ca1b63f2..1ea1ba0114f 100644 --- a/idea/src/org/jetbrains/jet/plugin/liveTemplates/JetTemplateContextType.java +++ b/idea/src/org/jetbrains/jet/plugin/liveTemplates/JetTemplateContextType.java @@ -18,7 +18,6 @@ package org.jetbrains.jet.plugin.liveTemplates; import com.intellij.codeInsight.template.EverywhereContextType; import com.intellij.codeInsight.template.TemplateContextType; -import com.intellij.lang.ASTNode; import com.intellij.openapi.util.Condition; import com.intellij.psi.*; import com.intellij.psi.impl.source.tree.LeafPsiElement; @@ -32,8 +31,6 @@ import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lexer.JetTokens; import org.jetbrains.jet.plugin.JetLanguage; -import java.util.Arrays; - public abstract class JetTemplateContextType extends TemplateContextType { protected JetTemplateContextType(@NotNull @NonNls String id, @NotNull String presentableName, @Nullable java.lang.Class baseContextType) { super(id, presentableName, baseContextType); @@ -46,7 +43,7 @@ public abstract class JetTemplateContextType extends TemplateContextType { if (element instanceof PsiWhiteSpace || element instanceof PsiComment) { return false; } - else if (PsiTreeUtil.getParentOfType(element, JetNamespaceHeader.class) != null + else if (PsiTreeUtil.getParentOfType(element, JetPackageDirective.class) != null || PsiTreeUtil.getParentOfType(element, JetImportDirective.class) != null) { return false; } diff --git a/idea/src/org/jetbrains/jet/plugin/project/ResolveElementCache.java b/idea/src/org/jetbrains/jet/plugin/project/ResolveElementCache.java index 5d47438145a..126320e3e10 100644 --- a/idea/src/org/jetbrains/jet/plugin/project/ResolveElementCache.java +++ b/idea/src/org/jetbrains/jet/plugin/project/ResolveElementCache.java @@ -94,10 +94,10 @@ public class ResolveElementCache { JetAnnotationEntry.class, JetTypeParameter.class, JetTypeConstraint.class, - JetNamespaceHeader.class); + JetPackageDirective.class); if (elementOfAdditionalResolve != null && !(elementOfAdditionalResolve instanceof JetParameter)) { - if (elementOfAdditionalResolve instanceof JetNamespaceHeader) { + if (elementOfAdditionalResolve instanceof JetPackageDirective) { elementOfAdditionalResolve = jetElement; } @@ -163,7 +163,7 @@ public class ResolveElementCache { else if (resolveElement instanceof JetTypeConstraint) { typeConstraintAdditionalResolve(resolveSession, (JetTypeConstraint) resolveElement); } - else if (PsiTreeUtil.getParentOfType(resolveElement, JetNamespaceHeader.class) != null) { + else if (PsiTreeUtil.getParentOfType(resolveElement, JetPackageDirective.class) != null) { namespaceRefAdditionalResolve(resolveSession, trace, resolveElement); } else { @@ -175,7 +175,7 @@ public class ResolveElementCache { private static void namespaceRefAdditionalResolve(ResolveSession resolveSession, BindingTrace trace, JetElement jetElement) { if (jetElement instanceof JetSimpleNameExpression) { - JetNamespaceHeader header = PsiTreeUtil.getParentOfType(jetElement, JetNamespaceHeader.class); + JetPackageDirective header = PsiTreeUtil.getParentOfType(jetElement, JetPackageDirective.class); assert header != null; JetSimpleNameExpression packageNameExpression = (JetSimpleNameExpression) jetElement; @@ -402,7 +402,7 @@ public class ResolveElementCache { } // Inside package declaration - JetNamespaceHeader namespaceHeader = PsiTreeUtil.getParentOfType(expression, JetNamespaceHeader.class, false); + JetPackageDirective namespaceHeader = PsiTreeUtil.getParentOfType(expression, JetPackageDirective.class, false); if (namespaceHeader != null) { PackageViewDescriptor packageDescriptor = resolveSession.getModuleDescriptor().getPackage( namespaceHeader.getFqName((JetSimpleNameExpression) expression).parent()); diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java b/idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java index 90769340fa8..8c3e2f616b4 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java @@ -22,8 +22,6 @@ import com.intellij.openapi.editor.Document; import com.intellij.openapi.util.TextRange; import com.intellij.psi.*; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.ImportPath; import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM; @@ -105,12 +103,12 @@ public class ImportInsertHelper { } else { JetImportList newDirective = JetPsiFactory.createImportDirectiveWithImportList(file.getProject(), importPath); - JetNamespaceHeader header = file.getNamespaceHeader(); - if (header == null) { + JetPackageDirective packageDirective = file.getPackageDirective(); + if (packageDirective == null) { throw new IllegalStateException("Scripts are not supported: " + file.getName()); } - header.getParent().addAfter(newDirective, header); + packageDirective.getParent().addAfter(newDirective, packageDirective); } }