Removed binding of comment after package directive
This commit is contained in:
@@ -201,7 +201,6 @@ public class JetParsing extends AbstractJetParsing {
|
|||||||
consumeIf(SEMICOLON);
|
consumeIf(SEMICOLON);
|
||||||
|
|
||||||
packageDirective.done(PACKAGE_DIRECTIVE);
|
packageDirective.done(PACKAGE_DIRECTIVE);
|
||||||
packageDirective.setCustomEdgeTokenBinders(null, TrailingWhitespacesAndCommentsBinder.INSTANCE$);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// When package directive is omitted we should not report error on non-file annotations at the beginning of the file.
|
// When package directive is omitted we should not report error on non-file annotations at the beginning of the file.
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ JetFile: CommentsBinding.kt
|
|||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
REFERENCE_EXPRESSION
|
REFERENCE_EXPRESSION
|
||||||
PsiElement(IDENTIFIER)('bar')
|
PsiElement(IDENTIFIER)('bar')
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
PsiComment(EOL_COMMENT)('// package directive')
|
PsiComment(EOL_COMMENT)('// package directive')
|
||||||
PsiWhiteSpace('\n\n')
|
PsiWhiteSpace('\n\n')
|
||||||
IMPORT_LIST
|
IMPORT_LIST
|
||||||
IMPORT_DIRECTIVE
|
IMPORT_DIRECTIVE
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
package p1.p2;/** some */
|
||||||
|
fun foo(){}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
JetFile: DocCommentOnPackageDirectiveLine.kt
|
||||||
|
PACKAGE_DIRECTIVE
|
||||||
|
PsiElement(package)('package')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
DOT_QUALIFIED_EXPRESSION
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('p1')
|
||||||
|
PsiElement(DOT)('.')
|
||||||
|
REFERENCE_EXPRESSION
|
||||||
|
PsiElement(IDENTIFIER)('p2')
|
||||||
|
PsiElement(SEMICOLON)(';')
|
||||||
|
FUN
|
||||||
|
KDoc
|
||||||
|
PsiElement(KDOC_START)('/**')
|
||||||
|
PsiElement(KDOC_TEXT)(' some ')
|
||||||
|
PsiElement(KDOC_END)('*/')
|
||||||
|
PsiWhiteSpace('\n')
|
||||||
|
PsiElement(fun)('fun')
|
||||||
|
PsiWhiteSpace(' ')
|
||||||
|
PsiElement(IDENTIFIER)('foo')
|
||||||
|
VALUE_PARAMETER_LIST
|
||||||
|
PsiElement(LPAR)('(')
|
||||||
|
PsiElement(RPAR)(')')
|
||||||
|
BLOCK
|
||||||
|
PsiElement(LBRACE)('{')
|
||||||
|
PsiElement(RBRACE)('}')
|
||||||
@@ -7,8 +7,8 @@ JetFile: PackageRecovery.kt
|
|||||||
PsiElement(DOT)('.')
|
PsiElement(DOT)('.')
|
||||||
PsiErrorElement:Package name must be a '.'-separated identifier list placed on a single line
|
PsiErrorElement:Package name must be a '.'-separated identifier list placed on a single line
|
||||||
<empty list>
|
<empty list>
|
||||||
PsiWhiteSpace(' ')
|
PsiWhiteSpace(' ')
|
||||||
PsiComment(EOL_COMMENT)('// Hello')
|
PsiComment(EOL_COMMENT)('// Hello')
|
||||||
PsiWhiteSpace('\n\n')
|
PsiWhiteSpace('\n\n')
|
||||||
PROPERTY
|
PROPERTY
|
||||||
PsiElement(val)('val')
|
PsiElement(val)('val')
|
||||||
|
|||||||
@@ -148,6 +148,12 @@ public class JetParsingTestGenerated extends AbstractJetParsingTest {
|
|||||||
doParsingTest(fileName);
|
doParsingTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("DocCommentOnPackageDirectiveLine.kt")
|
||||||
|
public void testDocCommentOnPackageDirectiveLine() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/DocCommentOnPackageDirectiveLine.kt");
|
||||||
|
doParsingTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("DoubleColon.kt")
|
@TestMetadata("DoubleColon.kt")
|
||||||
public void testDoubleColon() throws Exception {
|
public void testDoubleColon() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/DoubleColon.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/psi/DoubleColon.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user