File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
src/cz/juzna/intellij/nette/codeStyle Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 4747 groupName =" Nette"
4848 implementationClass =" cz.juzna.intellij.nette.inspections.CreateComponentReturnFormTypeInspection"
4949 level =" WARNING" enabledByDefault =" true" />
50+ <predefinedCodeStyle implementation =" cz.juzna.intellij.nette.codeStyle.NetteCodeStyle" />
5051 </extensions >
5152
5253 <actions >
Original file line number Diff line number Diff line change 1+ package cz .juzna .intellij .nette .codeStyle ;
2+
3+ import com .intellij .psi .codeStyle .CodeStyleSettings ;
4+ import com .intellij .psi .codeStyle .CommonCodeStyleSettings ;
5+ import com .jetbrains .php .lang .PhpFileType ;
6+ import com .jetbrains .php .lang .formatter .PhpCodeStyleSettings ;
7+ import com .jetbrains .php .lang .formatter .ui .PhpLanguageCodeStyleSettingsProvider ;
8+
9+ public class NetteCodeStyle extends PhpLanguageCodeStyleSettingsProvider .PSR1PSR2CodeStyle {
10+
11+ public NetteCodeStyle () {
12+ super ("Nette" );
13+ }
14+
15+ @ Override
16+ public void apply (CodeStyleSettings settings ) {
17+ super .apply (settings );
18+
19+ CommonCodeStyleSettings .IndentOptions indentOptions = settings .getIndentOptions (PhpFileType .INSTANCE );
20+ indentOptions .INDENT_SIZE = 4 ;
21+ indentOptions .TAB_SIZE = 4 ;
22+ indentOptions .CONTINUATION_INDENT_SIZE = 4 ;
23+ indentOptions .USE_TAB_CHARACTER = true ;
24+
25+ CommonCodeStyleSettings commonSettings = settings .getCommonSettings (this .getLanguage ());
26+ commonSettings .BLANK_LINES_AFTER_CLASS_HEADER = 0 ;
27+ commonSettings .ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION = false ;
28+
29+ PhpCodeStyleSettings phpSettings = settings .getCustomSettings (PhpCodeStyleSettings .class );
30+ phpSettings .PHPDOC_BLANK_LINE_BEFORE_TAGS = false ;
31+ phpSettings .LOWER_CASE_BOOLEAN_CONST = false ;
32+ phpSettings .LOWER_CASE_NULL_CONST = false ;
33+ phpSettings .UPPER_CASE_NULL_CONST = true ;
34+ phpSettings .UPPER_CASE_BOOLEAN_CONST = true ;
35+ phpSettings .BLANK_LINE_BEFORE_RETURN_STATEMENT = false ;
36+
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments