Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/edt-2023-3' into edt-2024-1
Browse files Browse the repository at this point in the history
  • Loading branch information
MaksimDzyuba committed Apr 9, 2024
2 parents d598fe9 + e8408c6 commit 7f7a9c7
Show file tree
Hide file tree
Showing 30 changed files with 737 additions and 17 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-latest-
- name: Build with Maven
working-directory: ./
run: |
Xvfb :5 -screen 0 1280x1024x8 -fbdir /tmp &
export DISPLAY=:5
mvn clean verify -PSDK,find-bugs -Dtycho.localArtifacts=ignore -B -V
- name: Cache SonarCloud packages
uses: actions/cache@v2
if: inputs.analyze
Expand All @@ -59,19 +66,22 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build with Maven
- name: Set up JDK 17
if: inputs.analyze
uses: actions/setup-java@v1
with:
java-version: 17
java-package: jdk

- name: Sonar scan
# Do not start Sonar-scanning for forks without label, and pass fork PR number directly
if: inputs.analyze
env:
# Do not start Sonar-scanning for forks without label, and pass fork PR number directly
SONAR_PARAM: "${{ inputs.analyze && format('{0}{1}', 'org.sonarsource.scanner.maven:sonar-maven-plugin:sonar', env.PR_NUMBER) || '' }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.sonar_token }}
working-directory: ./
run: |
Xvfb :5 -screen 0 1280x1024x8 -fbdir /tmp &
export DISPLAY=:5
echo "Sonar param: \"${SONAR_PARAM}\""
mvn clean verify ${SONAR_PARAM} -PSDK,find-bugs -Dtycho.localArtifacts=ignore -B -V
run: mvn compile org.sonarsource.scanner.maven:sonar-maven-plugin:sonar ${{ env.PR_NUMBER }} -Dtycho.localArtifacts=ignore -B -V

- name: Publish Test Report
uses: scacap/action-surefire-report@v1
if: inputs.analyze
Expand All @@ -96,7 +106,6 @@ jobs:
with:
name: jacoco
path: |
./**/target/jacoco.exec
./**/target/site/jacoco*/
- name: Upload test logs on failure
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

### Прочие изменения

- Контекстная команда форматирования документирующего комментария в редакторе модуля #1418

### Исправленные ошибки

Expand Down Expand Up @@ -313,6 +314,7 @@
- Исправлен расчета типов возвращаемых значений функций с вызовом сервера
- Испрвление проверки типа локальной переменной в variable-value-type
- Проверка типов invocation-parameter-type-intersect при вызове метода, если существуют документирующие комментарии использует только декларированные типы
- Исправлена ошибка, при которой не выполнялась автосортировка вложенных подсистем при включенной автосортировке верхнеуровневых объектов метаданных

## 0.1.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,32 @@ private void appendSubordinateObjects(Collection<SortItem> result, Map<EClass, L
}
}

private void appendSubordinateSubsystems(Collection<SortItem> result, IBmTransaction transaction)
{
for (Iterator<IBmObject> iterator =
transaction.getTopObjectIterator(MdClassPackage.Literals.SUBSYSTEM); iterator.hasNext();)
{
IBmObject subsystem = iterator.next();

EList<?> subordinateSubsystems =
(EList<?>)subsystem.eGet(MdClassPackage.Literals.SUBSYSTEM__SUBSYSTEMS, false);
if (subordinateSubsystems.size() > 1)
{
String fqn = subsystem.bmGetFqn();
result.add(new SortItem(fqn, MdClassPackage.Literals.SUBSYSTEM__SUBSYSTEMS, sorter));
}
}
}

private Map<EClass, List<EReference>> getSubordinateListsToSort(Iterator<EClass> eClassIterator,
IProject project)
{
Map<EClass, List<EReference>> sortListRefs = new HashMap<>();
while (eClassIterator.hasNext())
{
EClass topObjectEClass = eClassIterator.next();
if (topObjectEClass.equals(CONFIGURATION) || !MD_OBJECT.isSuperTypeOf(topObjectEClass))
if (topObjectEClass.equals(CONFIGURATION) || topObjectEClass.equals(MdClassPackage.Literals.SUBSYSTEM)
|| !MD_OBJECT.isSuperTypeOf(topObjectEClass))
{
continue;
}
Expand Down Expand Up @@ -516,6 +534,10 @@ private void appendByConfiguration(Collection<SortItem> result, IBmTransaction t
{
result.add(new SortItem(CONFIGURATION_FQN, feature, sorter));
}
if (feature.equals(MdClassPackage.Literals.CONFIGURATION__SUBSYSTEMS))
{
appendSubordinateSubsystems(result, transaction);
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.0
com._1c.g5.v8.dt.bsl.comment;version="[3.0.0,4.0.0)",
com._1c.g5.v8.dt.bsl.common;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.bsl.documentation.comment;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.bsl.formatting;version="[3.0.0,4.0.0)",
com._1c.g5.v8.dt.bsl.model;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.bsl.model.util;version="[4.7.0,5.0.0)",
com._1c.g5.v8.dt.bsl.resource.owner;version="[2.0.0,3.0.0)",
Expand All @@ -38,6 +39,7 @@ Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.0
com._1c.g5.v8.dt.core.model;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.core.platform;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.form.model;version="[11.1.0,12.0.0)",
com._1c.g5.v8.dt.lcore.nodemodel.util;version="[1.0.0,2.0.0)",
com._1c.g5.v8.dt.lcore.ui.texteditor;version="[1.1.0,2.0.0)",
com._1c.g5.v8.dt.mcore;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.metadata.mdclass;version="[9.0.0,10.0.0)",
Expand Down
2 changes: 2 additions & 0 deletions bundles/com.e1c.v8codestyle.bsl.ui/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

command.enableStrictTypes.mnemonic = E
command.enableStrictTypes.name = Enable @strict-types in modules
command.formatDocComment.mnemonic = F
command.formatDocComment.name = Format Method Documentation Comment

menu.label = Source

Expand Down
22 changes: 22 additions & 0 deletions bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@
id="com.e1c.v8codestyle.bsl.ui.commands.addStrictTypesAnnotationCommand"
name="%command.enableStrictTypes.name">
</command>
<command
id="com.e1c.v8codestyle.bsl.ui.commands.formatDocCommentCommand"
name="%command.formatDocComment.name">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
Expand Down Expand Up @@ -330,6 +334,16 @@
</reference>
</visibleWhen>
</command>
<command
commandId="com.e1c.v8codestyle.bsl.ui.commands.formatDocCommentCommand"
style="push">
<visibleWhen
checkEnabled="false">
<reference
definitionId="com._1c.g5.v8.dt.bsl.Bsl.Editor.editable">
</reference>
</visibleWhen>
</command>
</menu>
</menuContribution>
</extension>
Expand All @@ -343,6 +357,14 @@
definitionId="com._1c.g5.v8.dt.bsl.Bsl.Editor.editable">
</reference></activeWhen>
</handler>
<handler
class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.internal.bsl.ui.handlers.FormatDocCommentModuleEditorHandler"
commandId="com.e1c.v8codestyle.bsl.ui.commands.formatDocCommentCommand">
<activeWhen>
<reference
definitionId="com._1c.g5.v8.dt.bsl.Bsl.Editor.editable">
</reference></activeWhen>
</handler>
</extension>

<extension point="com.e1c.g5.v8.dt.check.fixes">
Expand Down
2 changes: 2 additions & 0 deletions bundles/com.e1c.v8codestyle.bsl.ui/plugin_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

command.enableStrictTypes.mnemonic = В
command.enableStrictTypes.name = Включить строгую типизацию (@strict-types) в модулях
command.formatDocComment.mnemonic = Ф
command.formatDocComment.name = Форматировать документирующий комментарий метода

menu.label = Исходники

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@

import com._1c.g5.v8.dt.bsl.common.IBslPreferences;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslMultiLineCommentDocumentationProvider;
import com._1c.g5.v8.dt.bsl.ui.contentassist.BslProposalProvider;
import com._1c.g5.v8.dt.core.filesystem.IQualifiedNameFilePathConverter;
import com._1c.g5.v8.dt.core.model.IModelEditingSupport;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.lcore.ui.texteditor.IndentTextEditorProvider;
import com._1c.g5.wiring.AbstractServiceAwareModule;
import com.e1c.g5.v8.dt.check.qfix.IFixRepository;
import com.e1c.v8codestyle.bsl.IModuleStructureProvider;
Expand Down Expand Up @@ -59,6 +61,8 @@ protected void doConfigure()
bind(BslMultiLineCommentDocumentationProvider.class)
.toProvider(() -> rsp.get(BslMultiLineCommentDocumentationProvider.class));
bind(EObjectAtOffsetHelper.class).toProvider(() -> rsp.get(EObjectAtOffsetHelper.class));
bind(BslProposalProvider.class).toProvider(() -> rsp.get(BslProposalProvider.class));
bind(IndentTextEditorProvider.class).toProvider(() -> rsp.get(IndentTextEditorProvider.class));

// CodeStyle Services
bind(IModuleStructureProvider.class).toService();
Expand Down
Loading

0 comments on commit 7f7a9c7

Please sign in to comment.