mirror of
https://github.com/1C-Company/v8-code-style.git
synced 2024-12-03 03:09:03 +02:00
Merge pull request #1107 from 1C-Company/bugfix/1106-autosort-fix
Автосортировка падает при переводе кода #1106
This commit is contained in:
commit
48adf3d146
@ -92,6 +92,7 @@
|
||||
- Отключение проверок для заимствованных объектов в расширении #1076
|
||||
- Проверка: form-self-reference не находит ошибку #1086
|
||||
- Ложное срабатывание проверки: module-structure-event-regions для обработчиков событий расположенных в общем модуле #1102
|
||||
- Автосортировка падает при переводе кода #1106
|
||||
|
||||
## 0.2.0
|
||||
|
||||
|
@ -77,30 +77,13 @@ public class SortJob
|
||||
return Status.CANCEL_STATUS;
|
||||
}
|
||||
|
||||
Object handler = workspaceOrchestrator.beginBackgroundOperation("Sort-MD-objects", //$NON-NLS-1$
|
||||
Arrays.asList(dtProject), ProjectPipelineJob.BUILD);
|
||||
|
||||
try
|
||||
while (!queue.isEmpty() && !monitor.isCanceled())
|
||||
{
|
||||
while (!queue.isEmpty() && !monitor.isCanceled())
|
||||
{
|
||||
execute(monitor);
|
||||
}
|
||||
if (monitor.isCanceled())
|
||||
{
|
||||
queue.clear();
|
||||
}
|
||||
execute(monitor);
|
||||
}
|
||||
finally
|
||||
if (monitor.isCanceled())
|
||||
{
|
||||
if (monitor.isCanceled())
|
||||
{
|
||||
workspaceOrchestrator.cancelOperation(handler);
|
||||
}
|
||||
else
|
||||
{
|
||||
workspaceOrchestrator.endOperation(handler);
|
||||
}
|
||||
queue.clear();
|
||||
}
|
||||
|
||||
if (monitor.isCanceled())
|
||||
@ -122,16 +105,32 @@ public class SortJob
|
||||
|
||||
private void execute(IProgressMonitor monitor)
|
||||
{
|
||||
List<SortItem> items = new ArrayList<>();
|
||||
SortItem item = null;
|
||||
while ((item = queue.poll()) != null && !monitor.isCanceled())
|
||||
Object handler = workspaceOrchestrator.beginHalfExclusiveOperation("Sort-MD-objects", //$NON-NLS-1$
|
||||
Arrays.asList(dtProject), ProjectPipelineJob.BUILD);
|
||||
try
|
||||
{
|
||||
items.add(item);
|
||||
}
|
||||
List<SortItem> items = new ArrayList<>();
|
||||
SortItem item = null;
|
||||
while ((item = queue.poll()) != null && !monitor.isCanceled())
|
||||
{
|
||||
items.add(item);
|
||||
}
|
||||
|
||||
if (!monitor.isCanceled() && !items.isEmpty())
|
||||
if (!monitor.isCanceled() && !items.isEmpty())
|
||||
{
|
||||
sortService.sortObject(dtProject, items, monitor);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
sortService.sortObject(dtProject, items, monitor);
|
||||
if (monitor.isCanceled())
|
||||
{
|
||||
workspaceOrchestrator.cancelOperation(handler);
|
||||
}
|
||||
else
|
||||
{
|
||||
workspaceOrchestrator.endOperation(handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user