mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Tune missing brace heuristic
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
private static class My extends JComponent {
|
||||
private My(Map<String, List<Object>> param) {
|
||||
setBorder(null);
|
||||
param
|
||||
list();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
PsiJavaFile:Errors5.java
|
||||
PsiImportList
|
||||
<empty list>
|
||||
PsiClass:My
|
||||
PsiComment(C_STYLE_COMMENT)('/*\n * Copyright 2000-2012 JetBrains s.r.o.\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiModifierList:private static
|
||||
PsiKeyword:private('private')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiKeyword:static('static')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiKeyword:class('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiIdentifier:My('My')
|
||||
PsiTypeParameterList
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiReferenceList
|
||||
PsiKeyword:extends('extends')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaCodeReferenceElement:JComponent
|
||||
PsiIdentifier:JComponent('JComponent')
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiReferenceList
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiJavaToken:LBRACE('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiMethod:My
|
||||
PsiModifierList:private
|
||||
PsiKeyword:private('private')
|
||||
PsiTypeParameterList
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiIdentifier:My('My')
|
||||
PsiParameterList:(Map<String, List<Object>> param)
|
||||
PsiJavaToken:LPARENTH('(')
|
||||
PsiParameter:param
|
||||
PsiModifierList:
|
||||
<empty list>
|
||||
PsiTypeElement:Map<String, List<Object>>
|
||||
PsiJavaCodeReferenceElement:Map<String, List<Object>>
|
||||
PsiIdentifier:Map('Map')
|
||||
PsiReferenceParameterList
|
||||
PsiJavaToken:LT('<')
|
||||
PsiTypeElement:String
|
||||
PsiJavaCodeReferenceElement:String
|
||||
PsiIdentifier:String('String')
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiJavaToken:COMMA(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiTypeElement:List<Object>
|
||||
PsiJavaCodeReferenceElement:List<Object>
|
||||
PsiIdentifier:List('List')
|
||||
PsiReferenceParameterList
|
||||
PsiJavaToken:LT('<')
|
||||
PsiTypeElement:Object
|
||||
PsiJavaCodeReferenceElement:Object
|
||||
PsiIdentifier:Object('Object')
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiJavaToken:GT('>')
|
||||
PsiJavaToken:GT('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiIdentifier:param('param')
|
||||
PsiJavaToken:RPARENTH(')')
|
||||
PsiReferenceList
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiCodeBlock
|
||||
PsiJavaToken:LBRACE('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiExpressionStatement
|
||||
PsiMethodCallExpression:setBorder(null)
|
||||
PsiReferenceExpression:setBorder
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:setBorder('setBorder')
|
||||
PsiExpressionList
|
||||
PsiJavaToken:LPARENTH('(')
|
||||
PsiLiteralExpression:null
|
||||
PsiJavaToken:NULL_KEYWORD('null')
|
||||
PsiJavaToken:RPARENTH(')')
|
||||
PsiJavaToken:SEMICOLON(';')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiExpressionStatement
|
||||
PsiReferenceExpression:param
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:param('param')
|
||||
PsiErrorElement:';' expected
|
||||
<empty list>
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiExpressionStatement
|
||||
PsiMethodCallExpression:list()
|
||||
PsiReferenceExpression:list
|
||||
PsiReferenceParameterList
|
||||
<empty list>
|
||||
PsiIdentifier:list('list')
|
||||
PsiExpressionList
|
||||
PsiJavaToken:LPARENTH('(')
|
||||
PsiJavaToken:RPARENTH(')')
|
||||
PsiJavaToken:SEMICOLON(';')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiJavaToken:RBRACE('}')
|
||||
+17
-2
@@ -1,9 +1,22 @@
|
||||
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.lang.java.parser.declarationParsing;
|
||||
|
||||
import com.intellij.lang.java.parser.JavaParsingTestCase;
|
||||
|
||||
|
||||
public class ClassParsingTest extends JavaParsingTestCase {
|
||||
public ClassParsingTest() {
|
||||
super("parser-full/declarationParsing/class");
|
||||
@@ -52,4 +65,6 @@ public class ClassParsingTest extends JavaParsingTestCase {
|
||||
myFileExt = ext;
|
||||
}
|
||||
}
|
||||
|
||||
public void testErrors5() { doTest(true); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user