-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Выделен программный интерфейс для подключения сторонних реализаций клиента отладки #142
Conversation
|
||
public static List<DebugTargetType> getAutoconnectTargets() { | ||
|
||
var autoconnectTargets = new DebugTargetType[]{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, мб List.of(..) сразу?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это перенесенный код. Да, ListOf будет лучше.
@@ -93,22 +93,9 @@ public void setAutoconnectTargets(List<DebugTargetType> autoconnectTargets) { | |||
|
|||
public List<DebugTargetType> getAutoconnectTargets() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, как часто используется getAutoconnectTargets из опций? Может константу сделать с таргетами?
import java.net.URI; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
import java.util.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, может не надо мультиимпорт?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как IDE поставило, так и живем. ОК, попробую указать конкретные импорты.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDEA автоматически проставляет мультиимпорт.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDEA можно это настроить и сохранить в codestyle файл в проекте. Кажется, в bsl ls так и сделано.
}; | ||
|
||
private Map<String, URI> uriListByKey; | ||
Set<String> externalDataProcessorsUriSet = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, этот филд используется вне класса?
if (!coverMap.isEmpty() || rawMode) { | ||
if (!rawMode && !coverMap.containsKey(lineNo)) { | ||
if (verbose) { | ||
logger.info("Can't find line to cover {} in module {}", lineNo, uri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, если вынести этот блок в отдельный метод - будет немного читабельнее текущий метод )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Там много чего есть отрефакторить. Пока рефакторил то что подпадает под задачу реализовать подключение разных клиентов.
private static List<DebugTargetType> filterTargetsByApiVersion(List<DebugTargetType> debugTargets, ModuleDescriptor.Version ApiVersion) { | ||
List<DebugTargetType> debugTypes = new java.util.ArrayList<>(debugTargets); | ||
|
||
if (ModuleDescriptor.Version.parse("8.3.16").compareTo(ApiVersion) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, что такого произошло в "8.3.16"? Мб в константу вынесем и коммент туда кинем?)
|
||
this.collector = collector; | ||
|
||
configure(debugServerUrl, infobaseAlias); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, а configure точно должен быть в конструкторе, а не отдельным методом и вызовом его для дебагклиента?
connectAllTargets(debugTargets); | ||
} | ||
|
||
private List<DebugTargetId> getCurrentTargets(List<String> debugAreaNames) throws DebugClientException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, порядок паблик и приватных методов нарушен(
connectAllTargets(debugTargets); | ||
} | ||
|
||
private List<DebugTargetId> getCurrentTargets(List<String> debugAreaNames) throws DebugClientException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yukon39, порядок паблик и приватных методов нарушен(
Изменения:
Closes #141