WEB-27387: skip line comment offset when calculating indent in 'case'

This commit is contained in:
Maxim Kropotov
2017-06-21 20:21:04 +03:00
parent 835e019be0
commit e63d3a59d2
@@ -204,7 +204,8 @@ public abstract class JavaLikeLangLineIndentProvider implements LineIndentProvid
while (!position.isAtEnd()) {
if (currLanguage == Language.ANY || currLanguage == null) currLanguage = position.getLanguage();
if (position.isAt(Colon)) {
SemanticEditorPosition afterColon = getPosition(position.getEditor(), position.getStartOffset()).after().afterOptional(Whitespace);
SemanticEditorPosition afterColon = getPosition(position.getEditor(), position.getStartOffset())
.after().afterOptionalMix(Whitespace, LineComment);
if (getPosition(position.getEditor(), position.getStartOffset()).isAfterOnSameLine(SwitchCase, SwitchDefault)) {
return afterColon.getStartOffset();
}