|
31 | 31 | import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticCompatibilityMode;
|
32 | 32 | import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticInfo;
|
33 | 33 | import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticScope;
|
34 |
| -import com.github._1c_syntax.bsl.languageserver.utils.MdoRefBuilder; |
35 | 34 | import com.github._1c_syntax.mdclasses.common.CompatibilityMode;
|
36 | 35 | import com.github._1c_syntax.mdclasses.mdo.AbstractMDO;
|
| 36 | +import com.github._1c_syntax.mdclasses.mdo.MDSubsystem; |
37 | 37 | import com.github._1c_syntax.mdclasses.mdo.support.ModuleType;
|
38 | 38 | import com.github._1c_syntax.mdclasses.supportconf.SupportConfiguration;
|
39 | 39 | import com.github._1c_syntax.mdclasses.supportconf.SupportVariant;
|
|
50 | 50 | import java.util.List;
|
51 | 51 | import java.util.Map;
|
52 | 52 | import java.util.stream.Collectors;
|
| 53 | +import java.util.stream.Stream; |
53 | 54 |
|
54 | 55 | @Configuration
|
55 | 56 | @RequiredArgsConstructor
|
@@ -107,7 +108,7 @@ private static boolean filterSubsystems(DocumentContext documentContext, Diagnos
|
107 | 108 | return true;
|
108 | 109 | }
|
109 | 110 |
|
110 |
| - var stringStream = MdoRefBuilder.subsystemFlatList(mdoObject.get().getIncludedSubsystems()).stream() |
| 111 | + var stringStream = subsystemFlatList(mdoObject.get().getIncludedSubsystems()).stream() |
111 | 112 | .map(AbstractMDO::getName)
|
112 | 113 | .collect(Collectors.toList());
|
113 | 114 |
|
@@ -230,4 +231,11 @@ private static boolean passedCompatibilityMode(
|
230 | 231 | return CompatibilityMode.compareTo(compatibilityMode.getCompatibilityMode(), contextCompatibilityMode) >= 0;
|
231 | 232 | }
|
232 | 233 |
|
| 234 | + // todo перенести в mdClasses |
| 235 | + private static List<MDSubsystem> subsystemFlatList(Collection<MDSubsystem> subsystems) { |
| 236 | + return subsystems.stream() |
| 237 | + .flatMap(subsys -> Stream.concat(Stream.of(subsys), subsystemFlatList(subsys.getIncludedSubsystems()).stream())) |
| 238 | + .collect(Collectors.toList()); |
| 239 | + } |
| 240 | + |
233 | 241 | }
|
0 commit comments