|
21 | 21 | */
|
22 | 22 | package com.github._1c_syntax.bsl.languageserver.diagnostics;
|
23 | 23 |
|
24 |
| -import com.github._1c_syntax.bsl.languageserver.configuration.Language; |
25 | 24 | import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
|
26 | 25 | import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticMetadata;
|
27 | 26 | import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticScope;
|
28 | 27 | import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticSeverity;
|
29 | 28 | import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticTag;
|
30 | 29 | import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticType;
|
31 | 30 | import com.github._1c_syntax.bsl.mdo.AttributeOwner;
|
32 |
| -import com.github._1c_syntax.bsl.mdo.ChildrenOwner; |
33 | 31 | import com.github._1c_syntax.bsl.mdo.MD;
|
34 |
| -import com.github._1c_syntax.bsl.types.MdoReference; |
35 | 32 | import com.github._1c_syntax.bsl.types.ModuleType;
|
36 | 33 | import com.github._1c_syntax.utils.CaseInsensitivePattern;
|
37 | 34 | import lombok.RequiredArgsConstructor;
|
@@ -134,23 +131,18 @@ public class ForbiddenMetadataNameDiagnostic extends AbstractMetadataDiagnostic
|
134 | 131 | protected void checkMetadata(MD mdo) {
|
135 | 132 |
|
136 | 133 | // проверка имени метаданного
|
137 |
| - checkName(mdo.getName(), mdo.getMdoReference()); |
| 134 | + checkName(mdo.getName(), mdo); |
138 | 135 |
|
139 | 136 | // проверка имен реквизитов и табличных частей
|
140 | 137 | if (mdo instanceof AttributeOwner childrenOwner) {
|
141 | 138 | childrenOwner.getPlainStorageFields()
|
142 |
| - .forEach(child -> checkName(child.getName(), child.getMdoReference())); |
| 139 | + .forEach(child -> checkName(child.getName(), child)); |
143 | 140 | }
|
144 | 141 | }
|
145 | 142 |
|
146 |
| - private void checkName(String name, MdoReference mdoReference) { |
| 143 | + private void checkName(String name, MD md) { |
147 | 144 | if (FORBIDDEN_NAMES_PATTERN.matcher(name).matches()) {
|
148 |
| - String mdoRef; |
149 |
| - if (serverConfiguration.getLanguage() == Language.RU) { |
150 |
| - mdoRef = mdoReference.getMdoRefRu(); |
151 |
| - } else { |
152 |
| - mdoRef = mdoReference.getMdoRef(); |
153 |
| - } |
| 145 | + var mdoRef = getMdoRefLocal(md); |
154 | 146 | addDiagnostic(info.getMessage(name, mdoRef));
|
155 | 147 | }
|
156 | 148 | }
|
|
0 commit comments