Skip to content

Commit fa919ef

Browse files
committed
1 parent 183bfdc commit fa919ef

File tree

5 files changed

+36
-10
lines changed

5 files changed

+36
-10
lines changed

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FieldsFromJoinsWithoutIsNullDiagnostic.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*/
2222
package com.github._1c_syntax.bsl.languageserver.diagnostics;
2323

24+
import com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure.Disabled;
2425
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticMetadata;
2526
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticSeverity;
2627
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticTag;
@@ -46,6 +47,7 @@
4647
import java.util.stream.Collectors;
4748
import java.util.stream.Stream;
4849

50+
@Disabled
4951
@DiagnosticMetadata(
5052
type = DiagnosticType.ERROR,
5153
severity = DiagnosticSeverity.CRITICAL,
@@ -55,8 +57,7 @@
5557
DiagnosticTag.SQL,
5658
DiagnosticTag.SUSPICIOUS,
5759
DiagnosticTag.UNPREDICTABLE
58-
},
59-
arturable = true
60+
}
6061
)
6162
public class FieldsFromJoinsWithoutIsNullDiagnostic extends AbstractSDBLVisitorDiagnostic {
6263

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/infrastructure/DiagnosticsConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ public List<BSLDiagnostic> diagnostics(DocumentContext documentContext) {
7777

7878
return diagnosticInfos.stream()
7979
.filter(diagnosticInfo -> isEnabled(diagnosticInfo, diagnosticsOptions))
80-
.filter(info -> !info.isArturable())
8180
.filter(info -> inScope(info, fileType))
8281
.filter(info -> correctModuleType(info, moduleType, fileType))
8382
.filter(info -> passedCompatibilityMode(info, compatibilityMode))
8483
.map(DiagnosticInfo::getDiagnosticClass)
84+
.filter(diagnostic -> !diagnostic.isAnnotationPresent(Disabled.class))
8585
.map(diagnosticObjectProvider::get)
8686
.collect(Collectors.toList());
8787
} else {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* This file is a part of BSL Language Server.
3+
*
4+
* Copyright (c) 2018-2022
5+
* Alexey Sosnoviy <labotamy@gmail.com>, Nikita Fedkin <nixel2007@gmail.com> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* BSL Language Server is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* BSL Language Server is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with BSL Language Server.
21+
*/
22+
package com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure;
23+
24+
import java.lang.annotation.ElementType;
25+
import java.lang.annotation.Retention;
26+
import java.lang.annotation.RetentionPolicy;
27+
import java.lang.annotation.Target;
28+
29+
@Target(ElementType.TYPE)
30+
@Retention(RetentionPolicy.RUNTIME)
31+
public @interface Disabled {
32+
}

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfo.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ public Map<String, Object> getDefaultConfiguration() {
199199
.collect(Collectors.toMap(DiagnosticParameterInfo::getName, DiagnosticParameterInfo::getDefaultValue));
200200
}
201201

202-
public boolean isArturable() {
203-
return diagnosticMetadata.arturable();
204-
}
205-
206202
private DiagnosticCode createDiagnosticCode() {
207203
String simpleName = diagnosticClass.getSimpleName();
208204
if (simpleName.endsWith("Diagnostic")) {

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticMetadata.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,4 @@
5454
DiagnosticCompatibilityMode compatibilityMode() default DiagnosticCompatibilityMode.UNDEFINED;
5555

5656
DiagnosticTag[] tags() default {};
57-
58-
boolean arturable() default false;
59-
6057
}

0 commit comments

Comments
 (0)