File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
src/main/kotlin/com/github/lppedd/cc Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ internal class CommitTabAction : TabAction() {
5656 val elementAtCaret = psiFile?.findElementAt(editor.getCaretOffset())
5757
5858 if (elementAtCaret is ConventionalCommitScopeOpenParenPsiElement ||
59- elementAtCaret is ConventionalCommitScopeCloseParenPsiElement ) {
59+ elementAtCaret is ConventionalCommitScopeCloseParenPsiElement ||
60+ elementAtCaret is ConventionalCommitBreakingChangePsiElement ) {
6061 editor.putUserData(moveCaretKey, 1 )
6162 return true
6263 } else if (elementAtCaret is ConventionalCommitSeparatorPsiElement ) {
Original file line number Diff line number Diff line change 11package com.github.lppedd.cc.language.parser
22
33import com.github.lppedd.cc.language.lexer.ConventionalCommitTokenType.Companion.BODY
4+ import com.github.lppedd.cc.language.lexer.ConventionalCommitTokenType.Companion.BREAKING_CHANGE
45import com.github.lppedd.cc.language.lexer.ConventionalCommitTokenType.Companion.FOOTER_TYPE
56import com.github.lppedd.cc.language.lexer.ConventionalCommitTokenType.Companion.FOOTER_TYPE_BREAKING_CHANGE
67import com.github.lppedd.cc.language.lexer.ConventionalCommitTokenType.Companion.FOOTER_VALUE
@@ -27,6 +28,7 @@ internal class ConventionalCommitASTFactory : ASTFactory() {
2728 tokensMap[SCOPE_OPEN_PAREN ] = ::ConventionalCommitScopeOpenParenPsiElement
2829 tokensMap[SCOPE ] = ::ConventionalCommitScopeValuePsiElement
2930 tokensMap[SCOPE_CLOSE_PAREN ] = ::ConventionalCommitScopeCloseParenPsiElement
31+ tokensMap[BREAKING_CHANGE ] = ::ConventionalCommitBreakingChangePsiElement
3032 tokensMap[SEPARATOR ] = ::ConventionalCommitSeparatorPsiElement
3133 tokensMap[SUBJECT ] = ::ConventionalCommitSubjectPsiElement
3234 tokensMap[BODY ] = ::ConventionalCommitBodyPsiElement
Original file line number Diff line number Diff line change 1+ package com.github.lppedd.cc.language.psi
2+
3+ import com.intellij.psi.impl.source.tree.LeafPsiElement
4+ import com.intellij.psi.tree.IElementType
5+
6+ /* *
7+ * @author Edoardo Luppi
8+ */
9+ class ConventionalCommitBreakingChangePsiElement (
10+ type : IElementType ,
11+ text : CharSequence ,
12+ ) : LeafPsiElement(type, text) {
13+ override fun toString (): String =
14+ " ConventionalCommitBreakingChangePsiElement"
15+ }
You can’t perform that action at this time.
0 commit comments