Skip to content

Commit e45956c

Browse files
committed
Перевод на новое API
1 parent a37a67c commit e45956c

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,24 @@
1919
* You should have received a copy of the GNU Lesser General Public
2020
* License along with BSL Language Server.
2121
*/
22-
package org.github._1c_syntax.bsl.languageserver.diagnostics;
23-
22+
package com.github._1c_syntax.bsl.languageserver.diagnostics;
23+
24+
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticMetadata;
25+
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticScope;
26+
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticSeverity;
27+
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticTag;
28+
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticType;
29+
import com.github._1c_syntax.bsl.parser.BSLParser;
2430
import org.antlr.v4.runtime.tree.ParseTree;
25-
import org.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticMetadata;
26-
import org.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticScope;
27-
import org.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticSeverity;
28-
import org.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticType;
29-
import org.github._1c_syntax.bsl.parser.BSLParser;
3031

3132
import java.util.regex.Pattern;
3233

3334
@DiagnosticMetadata(
3435
type = DiagnosticType.CODE_SMELL,
35-
scope = DiagnosticScope.BSL,
3636
severity = DiagnosticSeverity.MINOR,
37-
minutesToFix = 2
37+
scope = DiagnosticScope.BSL,
38+
minutesToFix = 1,
39+
tags = {DiagnosticTag.BRAINOVERLOAD}
3840
)
3941

4042
public class YodaStyleDiagnostic extends AbstractVisitorDiagnostic {
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
* You should have received a copy of the GNU Lesser General Public
2020
* License along with BSL Language Server.
2121
*/
22-
package org.github._1c_syntax.bsl.languageserver.diagnostics;
22+
package com.github._1c_syntax.bsl.languageserver.diagnostics;
2323

2424
import org.eclipse.lsp4j.Diagnostic;
25-
import org.github._1c_syntax.bsl.languageserver.utils.RangeHelper;
2625
import org.junit.jupiter.api.Test;
2726

2827
import java.util.List;
2928

30-
import static org.assertj.core.api.Assertions.assertThat;
29+
import static com.github._1c_syntax.bsl.languageserver.util.Assertions.assertThat;
3130

3231
class YodaStyleDiagnosticTest extends AbstractDiagnosticTest<YodaStyleDiagnostic> {
3332

@@ -41,11 +40,9 @@ void test() {
4140
List<Diagnostic> diagnostics = getDiagnostics();
4241
// then
4342
assertThat(diagnostics).hasSize(3);
44-
assertThat(diagnostics)
45-
.anyMatch(diagnostic -> diagnostic.getRange().equals(RangeHelper.newRange(3, 0 , 3, 23)));
46-
assertThat(diagnostics)
47-
.anyMatch(diagnostic -> diagnostic.getRange().equals(RangeHelper.newRange(9, 0 , 9, 28)));
48-
assertThat(diagnostics)
49-
.anyMatch(diagnostic -> diagnostic.getRange().equals(RangeHelper.newRange(13, 0 , 13, 32)));
43+
assertThat(diagnostics, true)
44+
.hasRange(3, 0, 3, 23)
45+
.hasRange(9, 0, 9, 28)
46+
.hasRange(13, 0, 13, 32);
5047
}
5148
}

0 commit comments

Comments
 (0)