1
0
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:
Dmitriy Marmyshev 2022-08-10 09:35:45 +03:00 committed by GitHub
commit 48adf3d146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 28 deletions

View File

@ -92,6 +92,7 @@
- Отключение проверок для заимствованных объектов в расширении #1076
- Проверка: form-self-reference не находит ошибку #1086
- Ложное срабатывание проверки: module-structure-event-regions для обработчиков событий расположенных в общем модуле #1102
- Автосортировка падает при переводе кода #1106
## 0.2.0

View File

@ -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);
}
}
}