Changeset 440 for java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/formatting/FramScriptFormatter.java
- Timestamp:
- 10/21/15 02:55:11 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/Framclipse/com.framsticks.framclipse/src/com/framsticks/framclipse/formatting/FramScriptFormatter.java
r437 r440 17 17 18 18 /** 19 * This class contains custom formatting de scription.19 * This class contains custom formatting declarations. 20 20 * 21 * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#formatting22 * on how and when to use it 21 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#formatting 22 * on how and when to use it. 23 23 * 24 * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an 25 * example 24 * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example 26 25 */ 27 26 public class FramScriptFormatter extends AbstractDeclarativeFormatter { 28 29 @Override30 protected FramScriptGrammarAccess getGrammarAccess() {31 return (FramScriptGrammarAccess) super.getGrammarAccess();32 }33 34 27 @Override 35 28 protected void configureFormatting(FormattingConfig c) { 36 FramScriptGrammarAccess f = getGrammarAccess();29 FramScriptGrammarAccess f = (FramScriptGrammarAccess) getGrammarAccess(); 37 30 38 31 //Headers … … 68 61 c.setNoSpace().before(f.getFlagsHeaderAccess().getIntValueAssignment_2()); 69 62 70 c.setNoSpace().after(f.getTypeHeaderAccess().getNameT ypeKeyword_0_0());63 c.setNoSpace().after(f.getTypeHeaderAccess().getNameTYPE_HEADERTerminalRuleCall_0_0()); 71 64 c.setLinewrap().after(f.getTypeHeaderAccess().getTypeAssignment_1()); 72 65 … … 94 87 // BlockIndentation 95 88 BlockElements block = f.getBlockAccess(); 96 c.setIndentation(block.getLeftCurlyBracketKeyword_ 1(),97 block.getRightCurlyBracketKeyword_ 3());98 c.setLinewrap().before(block.getLeftCurlyBracketKeyword_ 1());99 c.setLinewrap().after(block.getLeftCurlyBracketKeyword_ 1());100 c.setLinewrap().after(block.getRightCurlyBracketKeyword_ 3());89 c.setIndentation(block.getLeftCurlyBracketKeyword_0(), 90 block.getRightCurlyBracketKeyword_2()); 91 c.setLinewrap().before(block.getLeftCurlyBracketKeyword_0()); 92 c.setLinewrap().after(block.getLeftCurlyBracketKeyword_0()); 93 c.setLinewrap().after(block.getRightCurlyBracketKeyword_2()); 101 94 102 95 // Param … … 104 97 c.setNoLinewrap().around(fullStop); 105 98 c.setNoSpace().around(fullStop); 106 c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_0()); 99 c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_1()); 100 c.setNoSpace().after(f.getPropertyAccessAccess().getAlternatives_2()); 107 101 108 102 // Invocation … … 117 111 118 112 //Arrays 119 c.setNoSpace().after(f.getArrayAccess().getLeftSquareBracketKeyword_ 0());113 c.setNoSpace().after(f.getArrayAccess().getLeftSquareBracketKeyword_1()); 120 114 c.setNoSpace().before(f.getArrayAccess().getRightSquareBracketKeyword_3()); 121 c.setNoSpace().before(f.getArrayAccess().getCommaKeyword_2_ 0());115 c.setNoSpace().before(f.getArrayAccess().getCommaKeyword_2_1_0()); 122 116 123 117 // Unary expression
Note: See TracChangeset
for help on using the changeset viewer.