Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.gameforge.idea.Corona.lang.formatter;
- import com.intellij.formatting.Block;
- import com.intellij.formatting.FormattingDocumentModel;
- import com.intellij.formatting.FormattingModel;
- import com.intellij.lang.ASTNode;
- import com.intellij.openapi.editor.Document;
- import com.intellij.openapi.util.TextRange;
- import com.intellij.psi.PsiFile;
- import com.intellij.psi.formatter.FormattingDocumentModelImpl;
- import org.jetbrains.annotations.NotNull;
- import org.jetbrains.annotations.Nullable;
- /**
- * Created by felix.doerschner on 01.06.2016.
- */
- public class CoronaFormatModel implements FormattingModel {
- Block rootBlock;
- FormattingDocumentModel documentModel;
- PsiFile file;
- public CoronaFormatModel(Block root, PsiFile file) {
- rootBlock = root;
- this.file = file;
- documentModel = FormattingDocumentModelImpl.createOn(file);
- }
- @NotNull
- @Override
- public Block getRootBlock() {
- return rootBlock;
- }
- @NotNull
- @Override
- public FormattingDocumentModel getDocumentModel() {
- return documentModel;
- }
- @Override
- public TextRange replaceWhiteSpace(TextRange textRange, String s) {
- return null;
- }
- @Override
- public TextRange shiftIndentInsideRange(ASTNode astNode, TextRange textRange, int i) {
- return null;
- }
- @Override
- public void commitChanges() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement