diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 992e84de..b8efe5c8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -28,10 +28,16 @@ jobs:
- uses: actions/checkout@v2
if: ${{ !inputs.analyze }}
- - name: Set up JDK 11
- uses: actions/setup-java@v1
+# - name: Set up JDK 17
+# uses: actions/setup-java@v1
+# with:
+# java-version: 17
+# java-package: jdk+fx
+
+ - name: Set up Maven 3.9.6
+ uses: s4u/setup-maven-action@v1.12.0
with:
- java-version: 11
+ java-version: 17
java-package: jdk+fx
- name: Free disk space
@@ -51,6 +57,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
@@ -59,19 +72,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
@@ -96,7 +112,6 @@ jobs:
with:
name: jacoco
path: |
- ./**/target/jacoco.exec
./**/target/site/jacoco*/
- name: Upload test logs on failure
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 4b6fa9c6..ab8fd6f5 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -14,7 +14,7 @@ jobs:
name: Build
# This build will run on master,release/* push, local PR and PR from forks without label Analyze
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name || !contains(github.event.pull_request.labels.*.name, 'Analyze')
- uses: 1C-company/v8-code-style/.github/workflows/build.yml@master
+ uses: 1C-company/v8-code-style/.github/workflows/build.yml@edt-2024-1
with:
analyze: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name }}
secrets:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f8a8bc2a..a3a35c35 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -13,10 +13,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Set up JDK 11
+ - name: Set up JDK 17
uses: actions/setup-java@v1
with:
- java-version: 11
+ java-version: 17
java-package: jdk+fx
- name: Cache maven repo
diff --git a/.gitignore b/.gitignore
index 47f8c696..821bd111 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,4 +11,6 @@ target/
*/reports
#Mac-specific directory that no other operating system needs.
.DS_Store
-.m2/
\ No newline at end of file
+.m2/
+
+org.sonarlint.eclipse.core.prefs
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3ac2c634..de644ca6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
## 0.7.0
+Выпуск бета-версии для 1C:EDT 2023.3
### Новые проверки
@@ -20,6 +21,7 @@
- Проверка на уникальность имени поля в doc-comment-field-name #1392
- Проверка модификации ключей структуры вне функции-конструктора #1054
+- По умолчанию проверка "Код не должен следовать за асинхронным вызовом" (code-after-async-call) выключена. См. обсуждение в https://github.com/1C-Company/v8-code-style/pull/1408
#### Запросы
@@ -28,6 +30,7 @@
### Прочие изменения
+- Контекстная команда форматирования документирующего комментария в редакторе модуля #1418
### Исправленные ошибки
@@ -311,6 +314,7 @@
- Исправлен расчета типов возвращаемых значений функций с вызовом сервера
- Испрвление проверки типа локальной переменной в variable-value-type
- Проверка типов invocation-parameter-type-intersect при вызове метода, если существуют документирующие комментарии использует только декларированные типы
+- Исправлена ошибка, при которой не выполнялась автосортировка вложенных подсистем при включенной автосортировке верхнеуровневых объектов метаданных
## 0.1.0
diff --git a/bom/pom.xml b/bom/pom.xml
index 3d33a8e4..2b7b792e 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -24,26 +24,26 @@
BOM
- 3.6.0
+ 3.9.4
- 2.7.0
- 2.7.0
+ 4.0.5
+ 4.0.5
2.3.1
${project.basedir}
- 3.1.12.2
+ 4.8.3.1
3.1.1
8.29
java.header
UTF-8
UTF-8
- 11
- 11
- 11
+ 17
+ 17
+ 17
'v'yyyyMMdd-HHmm
${maven.build.timestamp}
@@ -51,7 +51,7 @@
http://download.eclipse.org/releases/2022-03/
false
- 0.8.6
+ 0.8.8
1C-Company_v8-code-style
1c-company
@@ -87,6 +87,8 @@
/tests/**/*.java
**/*Plugin.java,/tests/**/*
+
+ 1.1.2_p3
@@ -98,7 +100,7 @@
${tycho.version}
p2
- JavaSE-11
+ JavaSE-17
false
@@ -239,7 +241,7 @@
maven-antrun-plugin
1.8
-
+
com.ruleoftech
markdown-page-generator-plugin
@@ -299,6 +301,20 @@
+
+ org.eclipse.cbi.maven.plugins
+ eclipse-jarsigner-plugin
+ ${eclipse.jarsigner.plugin.version}
+
+ ${signer.url}/jarsign.php
+ true
+ 5
+
+ ${env.SIGN_KEYSTORE_PATH}
+ ${keystorePassword}
+
+
+
@@ -380,12 +396,39 @@
com.github.spotbugs
spotbugs
- 4.0.0-beta2
+ 4.8.3
+
+
+ sign
+
+
+
+ org.eclipse.cbi.maven.plugins
+ eclipse-jarsigner-plugin
+ ${eclipse.jarsigner.plugin.version}
+
+
+ sign
+ package
+
+ sign
+
+
+
+
+ true
+
+
+
+
+
+
+
diff --git a/bundles/com.e1c.v8codestyle.autosort.ui/.classpath b/bundles/com.e1c.v8codestyle.autosort.ui/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.autosort.ui/.classpath
+++ b/bundles/com.e1c.v8codestyle.autosort.ui/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.autosort.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.autosort.ui/.settings/org.eclipse.jdt.core.prefs
index 64d1838c..6d3ed858 100644
--- a/bundles/com.e1c.v8codestyle.autosort.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.autosort.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.autosort.ui/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.autosort.ui/META-INF/MANIFEST.MF
index 46dbbce1..95fe8977 100644
--- a/bundles/com.e1c.v8codestyle.autosort.ui/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.autosort.ui/META-INF/MANIFEST.MF
@@ -9,8 +9,9 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.118.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.20.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.13.0,4.0.0)",
org.eclipse.ui.forms;bundle-version="[3.11.0,4.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.23.0,3.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+ org.eclipse.emf.ecore;bundle-version="[2.23.0,3.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.autosort.ui
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -23,5 +24,4 @@ Import-Package: com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
com._1c.g5.wiring.binder;version="[1.1.0,2.0.0)",
com.e1c.v8codestyle.autosort;version="[0.7.0,0.8.0)",
- com.google.common.base;version="[30.1.0,31.0.0)",
- com.google.inject;version="[5.0.0,6.0.0)"
+ com.google.common.base;version="[32.1.0,33.0.0)"
diff --git a/bundles/com.e1c.v8codestyle.autosort/.classpath b/bundles/com.e1c.v8codestyle.autosort/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.autosort/.classpath
+++ b/bundles/com.e1c.v8codestyle.autosort/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.autosort/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.autosort/.settings/org.eclipse.jdt.core.prefs
index 64d1838c..6d3ed858 100644
--- a/bundles/com.e1c.v8codestyle.autosort/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.autosort/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.autosort/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.autosort/META-INF/MANIFEST.MF
index 381dae4f..29493353 100644
--- a/bundles/com.e1c.v8codestyle.autosort/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.autosort/META-INF/MANIFEST.MF
@@ -9,8 +9,9 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.13.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)",
org.eclipse.core.resources;bundle-version="[3.12.0,4.0.0)",
com._1c.g5.wiring;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+ org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.autosort
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -28,11 +29,9 @@ Import-Package: com._1c.g5.v8.activitytracking.core;version="[1.0.0,2.0.0)",
com._1c.g5.v8.dt.md.sort;version="[1.0.0,2.0.0)",
com._1c.g5.v8.dt.metadata.mdclass;version="[9.0.0,10.0.0)",
com.e1c.g5.v8.dt.cli.api;version="[2.0.0,3.0.0)",
- com.e1c.g5.v8.dt.cli.api.components;version="[2.0.0,3.0.0)",
+ com.e1c.g5.v8.dt.cli.api.components;version="[3.0.0,4.0.0)",
com.e1c.v8codestyle;version="[0.7.0,0.8.0)",
- com.google.common.base;version="[30.1.0,31.0.0)",
- com.google.inject;version="[5.0.1,6.0.0)",
- com.google.inject.binder;version="[5.0.1,6.0.0)",
+ com.google.common.base;version="[32.1.0,33.0.0)",
org.slf4j;version="[1.7.2,2.0.0)"
Export-Package: com.e1c.v8codestyle.autosort;version="0.7.0";
uses:="org.eclipse.emf.ecore,
diff --git a/bundles/com.e1c.v8codestyle.autosort/src/com/e1c/v8codestyle/internal/autosort/SortService.java b/bundles/com.e1c.v8codestyle.autosort/src/com/e1c/v8codestyle/internal/autosort/SortService.java
index 70e5a53c..f4bea9b8 100644
--- a/bundles/com.e1c.v8codestyle.autosort/src/com/e1c/v8codestyle/internal/autosort/SortService.java
+++ b/bundles/com.e1c.v8codestyle.autosort/src/com/e1c/v8codestyle/internal/autosort/SortService.java
@@ -119,6 +119,20 @@ public class SortService
this.configurationProvider = configurationProvider;
this.workspaceOrchestrator = workspaceOrchestrator;
this.modelEditingSupport = modelEditingSupport;
+ workspaceOrchestrator.addListener(event -> {
+ if (event.isProjectClosing())
+ {
+ IProject project = event.getProject().getWorkspaceProject();
+ if (project != null)
+ {
+ SortJob job = jobs.remove(project);
+ if (job != null)
+ {
+ job.cancel();
+ }
+ }
+ }
+ });
}
@LifecycleParticipant(phase = LifecyclePhase.RESOURCE_LOADING,
@@ -467,6 +481,23 @@ public class SortService
}
}
+ private void appendSubordinateSubsystems(Collection result, IBmTransaction transaction)
+ {
+ for (Iterator 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> getSubordinateListsToSort(Iterator eClassIterator,
IProject project)
{
@@ -474,7 +505,8 @@ public class SortService
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;
}
@@ -516,6 +548,10 @@ public class SortService
{
result.add(new SortItem(CONFIGURATION_FQN, feature, sorter));
}
+ if (feature.equals(MdClassPackage.Literals.CONFIGURATION__SUBSYSTEMS))
+ {
+ appendSubordinateSubsystems(result, transaction);
+ }
}
}
}
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/.classpath b/bundles/com.e1c.v8codestyle.bsl.ui/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/.classpath
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.bsl.ui/.settings/org.eclipse.jdt.core.prefs
index 34feba4d..ab5e755f 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF
index 7e26d67d..4500f188 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF
@@ -13,27 +13,33 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.20.0,4.0.0)",
org.eclipse.xtext.ui;bundle-version="[2.24.0,3.0.0)",
org.eclipse.handly.xtext.ui;bundle-version="[1.5.0,2.0.0)",
org.eclipse.handly;bundle-version="[1.5.0,2.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.bsl.ui
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.0.0)",
com._1c.g5.v8.bm.core;version="[8.0.0,9.0.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.common;version="[7.0.0,8.0.0)",
+ com._1c.g5.v8.dt.bsl.documentation.comment;version="[5.0.0,6.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)",
com._1c.g5.v8.dt.bsl.services;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.bsl.ui;version="[9.0.0,10.0.0)",
- com._1c.g5.v8.dt.bsl.ui.contentassist;version="[8.0.0,9.0.0)",
- com._1c.g5.v8.dt.bsl.ui.editor;version="[9.0.0,10.0.0)",
- com._1c.g5.v8.dt.bsl.ui.menu;version="[6.0.0,7.0.0)",
+ com._1c.g5.v8.dt.bsl.ui.contentassist;version="[9.0.0,10.0.0)",
+ com._1c.g5.v8.dt.bsl.ui.editor;version="[10.0.0,11.0.0)",
+ com._1c.g5.v8.dt.bsl.ui.event;version="[6.0.0,7.0.0)",
+ com._1c.g5.v8.dt.bsl.ui.menu;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.bsl.ui.quickfix;version="[4.1.0,5.0.0)",
com._1c.g5.v8.dt.bsl.util;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.core.filesystem;version="[6.0.0,7.0.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)",
@@ -43,8 +49,8 @@ Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.0
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
com._1c.g5.wiring.binder;version="[1.1.0,2.0.0)",
com.e1c.g5.v8.dt.bsl.check.qfix;version="[3.0.0,4.0.0)",
- com.e1c.g5.v8.dt.check.qfix;version="[2.0.0,3.0.0)",
+ com.e1c.g5.v8.dt.check.qfix;version="[3.0.0,4.0.0)",
com.e1c.g5.v8.dt.check.qfix.components;version="[1.0.0,2.0.0)",
- com.e1c.g5.v8.dt.check.settings;version="[3.0.0,4.0.0)",
+ com.e1c.g5.v8.dt.check.settings;version="[4.0.0,5.0.0)",
com.e1c.v8codestyle.bsl;version="[0.7.0,0.8.0)",
com.e1c.v8codestyle.bsl.strict;version="[0.7.0,0.8.0)"
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.properties b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.properties
index 030d1477..125741e3 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.properties
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.properties
@@ -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
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml
index 9f0c599b..8e325cfd 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml
@@ -237,6 +237,10 @@
id="com.e1c.v8codestyle.bsl.ui.commands.addStrictTypesAnnotationCommand"
name="%command.enableStrictTypes.name">
+
+
@@ -330,6 +334,16 @@
+
+
+
+
+
+
@@ -343,6 +357,14 @@
definitionId="com._1c.g5.v8.dt.bsl.Bsl.Editor.editable">
+
+
+
+
+
@@ -368,5 +390,11 @@
class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.ui.qfix.ServerExecutionSafeModeFix">
+
+
+
+
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/plugin_ru.properties b/bundles/com.e1c.v8codestyle.bsl.ui/plugin_ru.properties
index a8dc3db0..4c929945 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/plugin_ru.properties
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/plugin_ru.properties
@@ -14,6 +14,8 @@
command.enableStrictTypes.mnemonic = В
command.enableStrictTypes.name = Включить строгую типизацию (@strict-types) в модулях
+command.formatDocComment.mnemonic = Ф
+command.formatDocComment.name = Форматировать документирующий комментарий метода
menu.label = Исходники
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/bsl/ui/qfix/OpenBslDocCommentViewFix.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/bsl/ui/qfix/OpenBslDocCommentViewFix.java
index f64cedb0..97fc2cb8 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/bsl/ui/qfix/OpenBslDocCommentViewFix.java
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/bsl/ui/qfix/OpenBslDocCommentViewFix.java
@@ -81,9 +81,6 @@ public class OpenBslDocCommentViewFix
@Override
protected TextEdit fixIssue(XtextResource state, IXtextBslModuleFixModel model) throws BadLocationException
{
- IXtextInteractiveBslModuleFixModel interactiveModel = (IXtextInteractiveBslModuleFixModel)model;
-
- Integer offset = model.getIssue().getOffset() + 1;
Display display = PlatformUI.getWorkbench().getDisplay();
if (display.isDisposed())
{
@@ -101,13 +98,18 @@ public class OpenBslDocCommentViewFix
}
});
+ IXtextInteractiveBslModuleFixModel interactiveModel = (IXtextInteractiveBslModuleFixModel)model;
+ Integer offset = model.getIssue().getOffset() + 1;
ITextViewer viewer = BslQuickFixUtil.getTextViewer(interactiveModel.getModificationContext());
if (viewer != null && !display.isDisposed())
{
display.asyncExec(() -> {
- viewer.revealRange(offset, 1);
- viewer.getTextWidget().setFocus();
- viewer.setSelectedRange(offset, 1);
+ if (viewer.getDocument() != null)
+ {
+ viewer.revealRange(offset, 1);
+ viewer.getTextWidget().setFocus();
+ viewer.setSelectedRange(offset, 1);
+ }
});
}
return null;
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/ExternalDependenciesModule.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/ExternalDependenciesModule.java
index 9e8deabe..6ccaedf7 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/ExternalDependenciesModule.java
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/ExternalDependenciesModule.java
@@ -19,10 +19,12 @@ import org.eclipse.xtext.resource.IResourceServiceProvider;
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;
@@ -59,6 +61,8 @@ class ExternalDependenciesModule
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();
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/handlers/FormatDocCommentModuleEditorHandler.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/handlers/FormatDocCommentModuleEditorHandler.java
new file mode 100644
index 00000000..041adfec
--- /dev/null
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/handlers/FormatDocCommentModuleEditorHandler.java
@@ -0,0 +1,235 @@
+/*******************************************************************************
+ * Copyright (C) 2024, 1C-Soft LLC and others.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * 1C-Soft LLC - initial API and implementation
+ *******************************************************************************/
+package com.e1c.v8codestyle.internal.bsl.ui.handlers;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.handly.buffer.BufferChange;
+import org.eclipse.handly.snapshot.NonExpiringSnapshot;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.xtext.nodemodel.ICompositeNode;
+import org.eclipse.xtext.nodemodel.ILeafNode;
+import org.eclipse.xtext.nodemodel.INode;
+import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.ui.editor.XtextEditor;
+import org.eclipse.xtext.ui.editor.model.IXtextDocument;
+import org.eclipse.xtext.util.CancelIndicator;
+import org.eclipse.xtext.util.Triple;
+import org.eclipse.xtext.util.Tuples;
+import org.eclipse.xtext.util.concurrent.CancelableUnitOfWork;
+
+import com._1c.g5.ides.ui.texteditor.xtext.embedded.EmbeddedEditorBuffer;
+import com._1c.g5.v8.dt.bsl.common.IBslPreferences;
+import com._1c.g5.v8.dt.bsl.documentation.comment.BslCommentUtils;
+import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocCommentSerializer;
+import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
+import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.Description;
+import com._1c.g5.v8.dt.bsl.documentation.comment.BslMultiLineCommentDocumentationProvider;
+import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
+import com._1c.g5.v8.dt.bsl.documentation.comment.TextPart;
+import com._1c.g5.v8.dt.bsl.model.Method;
+import com._1c.g5.v8.dt.bsl.model.Module;
+import com._1c.g5.v8.dt.bsl.ui.contentassist.BslProposalProvider;
+import com._1c.g5.v8.dt.bsl.ui.menu.BslHandlerUtil;
+import com._1c.g5.v8.dt.bsl.util.BslUtil;
+import com._1c.g5.v8.dt.common.PreferenceUtils;
+import com._1c.g5.v8.dt.common.StringUtils;
+import com._1c.g5.v8.dt.core.model.EditingMode;
+import com._1c.g5.v8.dt.core.model.IModelEditingSupport;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.lcore.nodemodel.util.CustomNodeModelUtils;
+import com._1c.g5.v8.dt.lcore.ui.texteditor.IndentTextEditorProvider;
+import com.e1c.v8codestyle.internal.bsl.ui.UiPlugin;
+import com.google.inject.Inject;
+
+/**
+ * The Handler to format current method's documentation comment in opened in BSL editor.
+ *
+ * @author Dmitriy Marmyshev
+ */
+public class FormatDocCommentModuleEditorHandler
+ extends AbstractHandler
+{
+
+ @Inject
+ private BslMultiLineCommentDocumentationProvider commentProvider;
+
+ @Inject
+ private BslProposalProvider proposalProvider;
+
+ @Inject
+ private IBslPreferences bslPreferences;
+
+ @Inject
+ private IV8ProjectManager v8projectManager;
+
+ @Inject
+ private IndentTextEditorProvider indentProvider;
+
+ @Inject
+ private IModelEditingSupport modelEditingSupport;
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException
+ {
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);
+
+ XtextEditor target = BslHandlerUtil.extractXtextEditor(part);
+ if (target != null)
+ {
+ final ITextViewer viewer = BslHandlerUtil.getTextViewer(target);
+ IXtextDocument document = target.getDocument();
+
+ Triple content =
+ document.readOnly(new CancelableUnitOfWork, XtextResource>()
+ {
+ @Override
+ public Triple exec(XtextResource resource, CancelIndicator monitor)
+ throws Exception
+ {
+ if (resource.getContents() != null && !resource.getContents().isEmpty())
+ {
+ EObject obj = resource.getContents().get(0);
+ if (obj instanceof Module)
+ return getFormatedDocComment((Module)obj, viewer);
+ }
+ return null;
+ }
+
+ });
+
+ if (content != null && content.getFirst() > -1 && content.getSecond() > -1 && content.getThird() != null)
+ {
+ replaceDocComment(document, content.getThird(), content.getFirst(), content.getSecond());
+ }
+
+ }
+ return null;
+ }
+
+ private void replaceDocComment(IXtextDocument document, String comment, int insertOffset, int length)
+ {
+ TextEdit change = new ReplaceEdit(insertOffset, length, comment);
+
+ try (EmbeddedEditorBuffer buffer = new EmbeddedEditorBuffer(document))
+ {
+ NonExpiringSnapshot snapshot = new NonExpiringSnapshot(buffer);
+ BufferChange bufferChange = new BufferChange(change);
+ bufferChange.setBase(snapshot);
+ buffer.applyChange(bufferChange, new NullProgressMonitor());
+ }
+ catch (CoreException e)
+ {
+ UiPlugin.logError(e);
+ }
+ }
+
+ private Triple getFormatedDocComment(Module module, ITextViewer viewer)
+ {
+ if (!modelEditingSupport.canEdit(module, EditingMode.DIRECT))
+ {
+ return null;
+ }
+
+ Method method = getNearestMethod(module, (viewer.getSelectedRange()).x);
+ if (method != null)
+ {
+ List lines = commentProvider.getDocumentationNodes(method);
+ if (lines.isEmpty())
+ {
+ return null;
+ }
+ int methodOffset = lines.get(0).getOffset();
+ int length = lines.get(lines.size() - 1).getEndOffset() - methodOffset;
+
+ String lineFormatter = proposalProvider.getLineFormatter(module, viewer.getDocument(), methodOffset);
+ IV8Project project = v8projectManager.getProject(module);
+ boolean oldFormat = (project != null && project.getProject() != null)
+ ? this.bslPreferences.getDocumentCommentProperties(project.getProject()).oldCommentFormat() : true;
+
+ BslDocumentationComment docComment =
+ BslCommentUtils.parseTemplateComment(method, oldFormat, commentProvider);
+ if (isEmpty(docComment.getDescription()))
+ {
+ docComment.getDescription().getParts().clear();
+ }
+
+ boolean isRussian = BslUtil.isRussian(method, v8projectManager);
+ String indent = indentProvider.getIndent();
+
+ String lineSeparator = resolveLineSeparator(project);
+ String comment = BslDocCommentSerializer.newBuilder()
+ .setOldFormat(oldFormat)
+ .setScriptVariant(isRussian)
+ .lineSeparator(lineSeparator)
+ .ignoreLineNumbers()
+ .build()
+ .serialize(docComment, lineFormatter, indent)
+ .concat(lineSeparator);
+
+ return Tuples.create(methodOffset, length, comment);
+ }
+ return null;
+ }
+
+ private boolean isEmpty(Description description)
+ {
+ for (IDescriptionPart part : description.getParts())
+ {
+ if (part instanceof TextPart)
+ {
+ String text = ((TextPart)part).getText();
+ if (StringUtils.isNotBlank(text))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private Method getNearestMethod(Module module, int offset)
+ {
+ ICompositeNode iCompositeNode = NodeModelUtils.findActualNodeFor(module);
+ ILeafNode node = CustomNodeModelUtils.findLeafNodeAtOffset(iCompositeNode, offset);
+ EObject actualObject = NodeModelUtils.findActualSemanticObjectFor(node);
+ if (actualObject instanceof Method)
+ return (Method)actualObject;
+ return EcoreUtil2.getContainerOfType(actualObject, Method.class);
+ }
+
+ private static String resolveLineSeparator(IV8Project v8project)
+ {
+ if (v8project == null)
+ return System.lineSeparator();
+ return PreferenceUtils.getLineSeparator(v8project.getProject());
+ }
+
+}
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleOffsets.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleOffsets.java
new file mode 100644
index 00000000..3637764a
--- /dev/null
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleOffsets.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (C) 2023, 1C-Soft LLC and others.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * 1C-Soft LLC - initial API and implementation
+ *******************************************************************************/
+package com.e1c.v8codestyle.internal.bsl.ui.services;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.xtext.nodemodel.INode;
+
+import com.e1c.v8codestyle.internal.bsl.ui.UiPlugin;
+
+/**
+ * Provides offsets and suffixes information of module region
+ *
+ * @author Kuznetsov Nikita
+ */
+public final class BslModuleOffsets
+{
+ private int startOffset;
+ private int endOffset;
+ private int insertOffset;
+
+ private boolean needReplace;
+
+ private Map suffixes;
+
+ /**
+ * Create and calculate module region offsets
+ *
+ * @param document actual {@link IDocument} to get offsets from, can't be {@code null}
+ * @param node {@link INode} to get offsets from, can't be {@code null}
+ * @param nodeAfter {@link INode} to get offsets from, can't be {@code null}
+ * @return module region information with calculated region offsets or {@code null}
+ */
+ public static BslModuleOffsets create(IDocument document, INode node, INode nodeAfter)
+ {
+ try
+ {
+ int startLine = node.getTotalStartLine() - 1;
+ int startOffset = document.getLineOffset((startLine <= 1) ? 0 : startLine);
+ int endOffset = nodeAfter.getTotalOffset();
+ int insertOffset = document.getLineOffset(document.getLineOfOffset(nodeAfter.getTotalOffset()));
+ return new BslModuleOffsets(startOffset, endOffset, insertOffset);
+ }
+ catch (BadLocationException ex)
+ {
+ UiPlugin.log(UiPlugin.createErrorStatus("Can't create module region information", ex)); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ /**
+ * Returns start offset of module region
+ *
+ * @return offset before region declaration
+ */
+ public int getStartOffset()
+ {
+ return startOffset;
+ }
+
+ /**
+ * Returns end offset of module region
+ *
+ * @return offset after region declaration
+ */
+ public int getEndOffset()
+ {
+ return endOffset;
+ }
+
+ /**
+ * Returns before end offset inside module region
+ *
+ * @return offset before end of region declaration
+ */
+ public int getBeforeEndOffset()
+ {
+ return insertOffset;
+ }
+
+ /**
+ * Is need to replace existing module region
+ *
+ * @return true
if need to replace existing region, false
otherwise
+ */
+ public boolean needReplace()
+ {
+ return needReplace;
+ }
+
+ /**
+ * Sets necessity of replacing existing module region
+ */
+ public void setNeedReplace()
+ {
+ needReplace = true;
+ }
+
+ /**
+ * Add suffix of the name of this module region
+ *
+ * @param suffix to add to suffixes map of this module region
+ * @param document to update offsets, can't be {@code null}
+ * @param node to update offsets, can't be {@code null}
+ * @param nodeAfter to update offsets, can't be {@code null}
+ */
+ public void addSuffix(String suffix, IDocument document, INode node, INode nodeAfter)
+ {
+ if (suffixes == null)
+ {
+ suffixes = new HashMap<>();
+ }
+ BslModuleOffsets suffixRegionInformation = create(document, node, nodeAfter);
+ if (suffixRegionInformation != null)
+ {
+ suffixes.put(suffix, suffixRegionInformation);
+ int suffixStartOffset = suffixRegionInformation.getStartOffset();
+ int suffixEndOffset = suffixRegionInformation.getEndOffset();
+ int suffixInsertOffset = suffixRegionInformation.getBeforeEndOffset();
+ if (insertOffset < suffixInsertOffset)
+ {
+ insertOffset = suffixInsertOffset;
+ endOffset = suffixEndOffset;
+ }
+ if (startOffset > suffixStartOffset)
+ {
+ startOffset = suffixStartOffset;
+ }
+ }
+ }
+
+ /**
+ * Is module region has suffixes
+ *
+ * @return {@code true} if module region has suffixes, {@code false} otherwise
+ */
+ public boolean hasSuffixes()
+ {
+ return suffixes != null;
+ }
+
+ /**
+ * Returns module region information by suffix if exists
+ *
+ * @param suffix {@link String} suffix of declared name module region
+ * @return {@link BslModuleOffsets} if suffix exists, {@code null} otherwise
+ */
+ public BslModuleOffsets getInformationBySuffix(String suffix)
+ {
+ if (hasSuffixes())
+ {
+ return suffixes.get(suffix);
+ }
+ return null;
+ }
+
+ private BslModuleOffsets(int startOffset, int endOffset, int insertOffset)
+ {
+ this.startOffset = startOffset;
+ this.endOffset = endOffset;
+ this.insertOffset = insertOffset;
+ }
+}
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfo.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfo.java
new file mode 100644
index 00000000..adec7eef
--- /dev/null
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfo.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (C) 2023-2024, 1C-Soft LLC and others.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * 1C-Soft LLC - initial API and implementation
+ *******************************************************************************/
+package com.e1c.v8codestyle.internal.bsl.ui.services;
+
+import org.eclipse.emf.common.util.URI;
+
+import com._1c.g5.v8.dt.bsl.common.IBslModuleTextInsertInfo;
+
+/**
+ * Built-in language module region information with {@link String} region wrap data
+ *
+ * @author Kuznetsov Nikita
+ */
+public class BslModuleRegionsInfo
+ implements IBslModuleTextInsertInfo
+{
+ private final URI resourceURI;
+ private final int insertPosition;
+ private final int clearPosition;
+ private final int clearLength;
+ private final String regionName;
+
+ /**
+ * {@link BslModuleRegionsInfo} constructor
+ *
+ * @param resourceURI current module or document resource {@link URI}, cannot be null
+ * @param insertPosition int
insertion offset, cannot be negative
+ * @param clearPosition text clear int
position, can be negative if no clear needed
+ * @param clearLength text clear int
length, can be negative if no clear needed
+ * @param regionName {@link String} region name, can be null
+ */
+ public BslModuleRegionsInfo(URI resourceURI, int insertPosition, int clearPosition, int clearLength,
+ String regionName)
+ {
+ this.resourceURI = resourceURI;
+ this.insertPosition = insertPosition;
+ this.clearPosition = clearPosition;
+ this.clearLength = clearLength;
+ this.regionName = regionName;
+ }
+
+ @Override
+ public URI getResourceURI()
+ {
+ return resourceURI;
+ }
+
+ @Override
+ public int getPosition()
+ {
+ return clearLength > 0 ? clearPosition : insertPosition;
+ }
+
+ @Override
+ public int getClearLength()
+ {
+ return clearLength;
+ }
+
+ /**
+ * Returns region name
+ *
+ * @return {@link String} region name, can be null
+ */
+ public String getRegionName()
+ {
+ return regionName;
+ }
+}
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfoService.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfoService.java
new file mode 100644
index 00000000..bc0be477
--- /dev/null
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfoService.java
@@ -0,0 +1,390 @@
+/*******************************************************************************
+ * Copyright (C) 2023-2024, 1C-Soft LLC and others.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * 1C-Soft LLC - initial API and implementation
+ *******************************************************************************/
+package com.e1c.v8codestyle.internal.bsl.ui.services;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.nodemodel.INode;
+import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
+import org.eclipse.xtext.resource.IResourceServiceProvider;
+import org.eclipse.xtext.resource.XtextResource;
+import org.eclipse.xtext.ui.editor.model.IXtextDocument;
+import org.eclipse.xtext.util.concurrent.IUnitOfWork;
+
+import com._1c.g5.v8.dt.bsl.common.EventItemType;
+import com._1c.g5.v8.dt.bsl.common.IBslModuleEventData;
+import com._1c.g5.v8.dt.bsl.common.IBslModuleTextInsertInfo;
+import com._1c.g5.v8.dt.bsl.common.IBslModuleTextInsertInfoService;
+import com._1c.g5.v8.dt.bsl.model.Module;
+import com._1c.g5.v8.dt.bsl.model.RegionPreprocessor;
+import com._1c.g5.v8.dt.bsl.model.util.BslUtil;
+import com._1c.g5.v8.dt.bsl.resource.owner.BslOwnerComputerService;
+import com._1c.g5.v8.dt.bsl.ui.BslGeneratorMultiLangProposals;
+import com._1c.g5.v8.dt.bsl.ui.editor.BslXtextDocument;
+import com._1c.g5.v8.dt.bsl.ui.event.BslModuleEventData;
+import com._1c.g5.v8.dt.common.PreferenceUtils;
+import com._1c.g5.v8.dt.common.StringUtils;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.form.model.FormPackage;
+import com._1c.g5.v8.dt.mcore.NamedElement;
+import com._1c.g5.v8.dt.metadata.mdclass.ScriptVariant;
+import com.e1c.v8codestyle.bsl.IModuleStructureProvider;
+import com.e1c.v8codestyle.bsl.ModuleStructureSection;
+import com.google.inject.Inject;
+
+/**
+ * Module regions related implementation of {@link IBslModuleTextInsertInfoService}
+ *
+ * @author Kuznetsov Nikita
+ */
+public class BslModuleRegionsInfoService
+ implements IBslModuleTextInsertInfoService
+{
+
+ @Inject
+ private IModuleStructureProvider moduleStructureProvider;
+
+ @Override
+ public IBslModuleTextInsertInfo getEventHandlerTextInsertInfo(IXtextDocument document, int defaultPosition,
+ IBslModuleEventData data)
+ {
+ if (!(data instanceof BslModuleEventData))
+ {
+ return IBslModuleTextInsertInfo.getDefaultModuleTextInsertInfo(document, defaultPosition);
+ }
+ BslModuleEventData bslModuleEventData = (BslModuleEventData)data;
+ URI resourceURI = document.getResourceURI();
+ IResourceServiceProvider rsp =
+ IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(resourceURI);
+ IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class);
+ IV8Project project = projectManager.getProject(resourceURI);
+ ModuleInfoUnitOfWork moduleInfoUnitOfWork = new ModuleInfoUnitOfWork(rsp.get(BslOwnerComputerService.class));
+ ModuleInfo moduleInfo = document instanceof BslXtextDocument bslXTextDocument
+ ? bslXTextDocument.readOnlyDataModelWithoutSync(moduleInfoUnitOfWork)
+ : document.readOnly(moduleInfoUnitOfWork);
+ EObject eventOwner = data.getEventOwner();
+ BslModuleEventData regionData = (BslModuleEventData)data;
+ EventItemType itemType = regionData.getEventItemType();
+ String suffix = getSuffix(eventOwner, itemType, bslModuleEventData.isInternal());
+ ScriptVariant scriptVariant = project.getScriptVariant();
+ String declaredRegionName =
+ getDeclaredRegionName(moduleInfo.owner, itemType, bslModuleEventData.isInternal(), scriptVariant);
+ Map regionOffsets =
+ getRegionOffsets(document, moduleInfo.regionPreprocessors, declaredRegionName, scriptVariant);
+ BslModuleOffsets bslModuleOffsets = regionOffsets.get(declaredRegionName);
+ int offset = getRegionOffset(regionOffsets, declaredRegionName, suffix, defaultPosition, scriptVariant);
+ String regionName = null;
+ boolean createRegion = !isRegionExists(regionOffsets, declaredRegionName, suffix);
+ int clearOffset = 0;
+ int clearLength = 0;
+ if (bslModuleOffsets != null && bslModuleOffsets.needReplace())
+ {
+ createRegion = true;
+ String lineSeparator = PreferenceUtils.getLineSeparator(project.getProject());
+ int lineSeparatorOffset =
+ bslModuleOffsets.getStartOffset() >= lineSeparator.length() ? lineSeparator.length() : 0;
+ clearOffset = bslModuleOffsets.getStartOffset() - lineSeparatorOffset;
+ clearLength = bslModuleOffsets.getEndOffset() - bslModuleOffsets.getStartOffset() + lineSeparatorOffset;
+ }
+ if (createRegion && project.getProject() != null
+ && moduleStructureProvider.canCreateStructure(project.getProject()))
+ {
+ regionName = suffix.isEmpty() ? declaredRegionName : (declaredRegionName + suffix);
+ }
+ return new BslModuleRegionsInfo(resourceURI, offset, clearOffset, clearLength, regionName);
+ }
+
+ @Override
+ public String wrap(IBslModuleTextInsertInfo moduleTextInsertInfo, String content)
+ {
+ if (moduleTextInsertInfo instanceof BslModuleRegionsInfo moduleRegionInformation)
+ {
+ String regionName = moduleRegionInformation.getRegionName();
+ if (regionName != null)
+ {
+ IResourceServiceProvider rsp = IResourceServiceProvider.Registry.INSTANCE
+ .getResourceServiceProvider(moduleTextInsertInfo.getResourceURI());
+ IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class);
+ BslGeneratorMultiLangProposals proposals = rsp.get(BslGeneratorMultiLangProposals.class);
+ IV8Project project = projectManager.getProject(moduleTextInsertInfo.getResourceURI());
+ String lineSeparator = PreferenceUtils.getLineSeparator(project.getProject());
+ proposals.setRussianLang(ScriptVariant.RUSSIAN.equals(project.getScriptVariant()));
+ String beginRegion = proposals.getBeginRegionPropStr();
+ String endRegion = proposals.getEndRegionPropStr();
+ String space = proposals.getSpacePropStr();
+ StringBuilder builder = new StringBuilder();
+ if (moduleTextInsertInfo.getPosition() != 0)
+ {
+ builder.append(lineSeparator);
+ }
+ builder.append(beginRegion).append(space).append(regionName);
+ builder.append(content);
+ builder.append(endRegion);
+ if (moduleTextInsertInfo.getPosition() == 0)
+ {
+ builder.append(lineSeparator);
+ }
+ return builder.toString();
+ }
+ }
+ return content;
+ }
+
+ private Map getRegionOffsets(IXtextDocument document,
+ List regionPreprocessors, String targetRegionName, ScriptVariant scriptVariant)
+ {
+ ModuleStructureSection[] declaredRegionNames = ModuleStructureSection.values();
+ Map regionOffsets = new HashMap<>(declaredRegionNames.length / 2);
+ for (RegionPreprocessor regionPreprocessor : regionPreprocessors)
+ {
+ INode nodeAfter = NodeModelUtils.findActualNodeFor(regionPreprocessor.getItemAfter());
+ if (nodeAfter != null)
+ {
+ String preprocessorRegionName = regionPreprocessor.getName();
+ for (int regionNameIndex = 0; regionNameIndex < declaredRegionNames.length; regionNameIndex++)
+ {
+ ModuleStructureSection moduleStructureSection = declaredRegionNames[regionNameIndex];
+ String declaredRegionName = moduleStructureSection.getName(scriptVariant);
+ if ((preprocessorRegionName != null)
+ && isMatchingRegion(preprocessorRegionName, declaredRegionName))
+ {
+ INode node = NodeModelUtils.findActualNodeFor(regionPreprocessor.getItem());
+ if (node != null)
+ {
+ BslModuleOffsets moduleRegionInformation = null;
+ if (!preprocessorRegionName.equals(declaredRegionName))
+ {
+ if (!moduleStructureSection.isSuffixed())
+ {
+ continue;
+ }
+ String suffix = getSuffixOfMatchingRegion(preprocessorRegionName, declaredRegionName);
+ moduleRegionInformation = regionOffsets.get(declaredRegionName);
+ if (moduleRegionInformation == null)
+ {
+ moduleRegionInformation = BslModuleOffsets.create(document, node, nodeAfter);
+ if (moduleRegionInformation == null)
+ {
+ return regionOffsets;
+ }
+ }
+ moduleRegionInformation.addSuffix(suffix, document, node, nodeAfter);
+ }
+ if (moduleRegionInformation == null && !moduleStructureSection.isSuffixed())
+ {
+ moduleRegionInformation = BslModuleOffsets.create(document, node, nodeAfter);
+ }
+ if (moduleRegionInformation != null)
+ {
+ regionOffsets.put(declaredRegionName, moduleRegionInformation);
+ if ((targetRegionName != null) && targetRegionName.equals(preprocessorRegionName))
+ {
+ if (node.getLength() == 0)
+ {
+ moduleRegionInformation.setNeedReplace();
+ }
+ return regionOffsets;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return regionOffsets;
+ }
+
+ private int getRegionOffset(Map regionOffsets, String declaredRegionName, String suffix,
+ int defaultOffset, ScriptVariant scriptVariant)
+ {
+ int offset = defaultOffset;
+ boolean createNewRegion = !isRegionExists(regionOffsets, declaredRegionName, suffix);
+ BslModuleOffsets regionOffset = regionOffsets.get(declaredRegionName);
+
+ if (regionOffset != null)
+ {
+ if (!suffix.isEmpty())
+ {
+ BslModuleOffsets suffixedRegionInformation = regionOffset.getInformationBySuffix(suffix);
+ if (suffixedRegionInformation != null)
+ {
+ return suffixedRegionInformation.getBeforeEndOffset();
+ }
+ else if (createNewRegion)
+ {
+ return getNewRegionOffset(regionOffsets, declaredRegionName, suffix, defaultOffset, scriptVariant);
+ }
+ }
+ return regionOffset.getBeforeEndOffset();
+ }
+ if (createNewRegion)
+ {
+ return getNewRegionOffset(regionOffsets, declaredRegionName, suffix, defaultOffset, scriptVariant);
+ }
+ return offset;
+ }
+
+ private boolean isRegionExists(Map regionOffsets, String declaredRegionName,
+ String suffix)
+ {
+ BslModuleOffsets moduleRegionInformation = regionOffsets.get(declaredRegionName);
+ return (moduleRegionInformation != null)
+ && (suffix.isEmpty() || moduleRegionInformation.getInformationBySuffix(suffix) != null);
+ }
+
+ private int getNewRegionOffset(Map regionOffsets, String regionName, String suffix,
+ int defaultOffset, ScriptVariant scriptVariant)
+ {
+ boolean placeBefore = false;
+ int offset = regionOffsets.isEmpty() ? 0 : defaultOffset;
+ ModuleStructureSection[] declaredRegionNames = ModuleStructureSection.values();
+ BslModuleOffsets lastRegionInformation = null;
+ BslModuleOffsets regionInformation = null;
+ for (int regionNameIndex = 0; regionNameIndex < declaredRegionNames.length; regionNameIndex++)
+ {
+ ModuleStructureSection moduleStructuredSection = declaredRegionNames[regionNameIndex];
+ String declaredRegionName = moduleStructuredSection.getName(scriptVariant);
+ if (declaredRegionName.equals(regionName))
+ {
+ placeBefore = true;
+ }
+ if (regionInformation != null)
+ {
+ lastRegionInformation = regionInformation;
+ }
+ regionInformation = regionOffsets.get(declaredRegionName);
+ if (regionInformation != null)
+ {
+ if (placeBefore && (suffix.isEmpty() || !declaredRegionName.equals(regionName)))
+ {
+ return lastRegionInformation != null ? lastRegionInformation.getEndOffset()
+ : regionInformation.getStartOffset();
+ }
+ offset = placeBefore ? regionInformation.getStartOffset() : regionInformation.getEndOffset();
+ }
+ }
+ return offset;
+ }
+
+ private String getDeclaredRegionName(EClass moduleOwnerClass, EventItemType itemType, boolean isInternal,
+ ScriptVariant scriptVariant)
+ {
+ if (isInternal)
+ {
+ return getPrivateRegionName(scriptVariant);
+ }
+ if (moduleOwnerClass.getName().equals("AbstractForm")) //$NON-NLS-1$
+ {
+ return getDeclaredRegionNameForForm(itemType, scriptVariant);
+ }
+ return getDefaultRegionName(scriptVariant);
+ }
+
+ private String getDeclaredRegionNameForForm(EventItemType itemType, ScriptVariant scriptVariant)
+ {
+ switch (itemType)
+ {
+ case MAIN:
+ return ModuleStructureSection.FORM_EVENT_HANDLERS.getName(scriptVariant);
+ case COMMAND:
+ return ModuleStructureSection.FORM_COMMAND_EVENT_HANDLERS.getName(scriptVariant);
+ case TABLE:
+ return ModuleStructureSection.FORM_TABLE_ITEMS_EVENT_HANDLERS.getName(scriptVariant);
+ default:
+ return ModuleStructureSection.FORM_HEADER_ITEMS_EVENT_HANDLERS.getName(scriptVariant);
+ }
+ }
+
+ private String getPrivateRegionName(ScriptVariant scriptVariant)
+ {
+ return ModuleStructureSection.PRIVATE.getName(scriptVariant);
+ }
+
+ private String getDefaultRegionName(ScriptVariant scriptVariant)
+ {
+ return ModuleStructureSection.EVENT_HANDLERS.getName(scriptVariant);
+ }
+
+ private String getSuffix(EObject eventOwner, EventItemType itemType, boolean isInternal)
+ {
+ if (isInternal)
+ {
+ return StringUtils.EMPTY;
+ }
+ if (itemType.equals(EventItemType.TABLE))
+ {
+ EObject container = eventOwner;
+ while (container != null)
+ {
+ if (container.eClass() == FormPackage.Literals.TABLE)
+ {
+ return ((NamedElement)container).getName();
+ }
+ else
+ {
+ container = container.eContainer();
+ }
+ }
+ }
+ return StringUtils.EMPTY;
+ }
+
+ private String getSuffixOfMatchingRegion(String regionName, String declaredRegionName)
+ {
+ return regionName.substring(declaredRegionName.length(), regionName.length());
+ }
+
+ private boolean isMatchingRegion(String regionName, String declaredRegionName)
+ {
+ int declaredRegionNameLength = declaredRegionName.length();
+ return regionName.length() >= declaredRegionNameLength
+ && regionName.substring(0, declaredRegionNameLength).equals(declaredRegionName);
+ }
+
+ private final class ModuleInfo
+ {
+ private final EClass owner;
+ private final List regionPreprocessors;
+
+ public ModuleInfo(EClass owner, List regionPreprocessors)
+ {
+ this.owner = owner;
+ this.regionPreprocessors = regionPreprocessors;
+ }
+ }
+
+ private final class ModuleInfoUnitOfWork
+ implements IUnitOfWork
+ {
+ private final BslOwnerComputerService bslOwnerComputerService;
+
+ public ModuleInfoUnitOfWork(BslOwnerComputerService bslOwnerComputerService)
+ {
+ this.bslOwnerComputerService = bslOwnerComputerService;
+ }
+
+ @Override
+ public ModuleInfo exec(XtextResource resource) throws Exception
+ {
+ Module module = (Module)resource.getParseResult().getRootASTElement();
+ return new ModuleInfo(bslOwnerComputerService.computeOwnerEClass(module),
+ BslUtil.getAllRegionPreprocessors(module));
+ }
+ }
+}
diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/views/BslDocCommentView.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/views/BslDocCommentView.java
index 0cbfb36f..d83e19cc 100644
--- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/views/BslDocCommentView.java
+++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/views/BslDocCommentView.java
@@ -14,7 +14,7 @@ package com.e1c.v8codestyle.internal.bsl.ui.views;
import java.text.MessageFormat;
-import javax.inject.Inject;
+import com.google.inject.Inject;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
diff --git a/bundles/com.e1c.v8codestyle.bsl/.classpath b/bundles/com.e1c.v8codestyle.bsl/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.bsl/.classpath
+++ b/bundles/com.e1c.v8codestyle.bsl/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.bsl/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.bsl/.settings/org.eclipse.jdt.core.prefs
index 64d1838c..6d3ed858 100644
--- a/bundles/com.e1c.v8codestyle.bsl/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.bsl/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF
index 610176e8..b037a897 100644
--- a/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF
@@ -13,26 +13,26 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.13.0,4.0.0)",
org.eclipse.xtext;bundle-version="[2.17.0,3.0.0)",
org.eclipse.xtext.builder;bundle-version="[2.18.0,3.0.0)",
org.eclipse.jdt.annotation;bundle-version="[2.2.0,3.0.0)";resolution:=optional
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.bsl
Bundle-ActivationPolicy: lazy
Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com._1c.g5.v8.bm.integration;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.bm.xtext;version="[15.0.0,16.0.0)",
- com._1c.g5.v8.dt.bsl;version="[6.0.0,7.0.0)",
+ com._1c.g5.v8.dt.bsl;version="[7.0.0,8.0.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.common;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.bsl.contextdef;version="[2.0.0,3.0.0)",
- com._1c.g5.v8.dt.bsl.documentation.comment;version="[4.0.0,5.0.0)",
+ com._1c.g5.v8.dt.bsl.documentation.comment;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.bsl.model;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.bsl.model.resource.owner;version="[2.0.0,3.0.0)",
com._1c.g5.v8.dt.bsl.model.util;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.bsl.resource;version="[15.0.0,16.0.0)",
com._1c.g5.v8.dt.bsl.services;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.bsl.typesystem;version="[10.0.0,11.0.0)",
- com._1c.g5.v8.dt.bsl.typesystem.util;version="[10.0.0,11.0.0)",
+ com._1c.g5.v8.dt.bsl.typesystem.util;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.bsl.util;version="[8.0.0,9.0.0)",
- com._1c.g5.v8.dt.bsl.validation;version="[17.0.0,18.0.0)",
+ com._1c.g5.v8.dt.bsl.validation;version="[18.0.0,19.0.0)",
com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)",
com._1c.g5.v8.dt.core.naming;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.core.platform;version="[11.0.0,12.0.0)",
@@ -47,13 +47,13 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com._1c.g5.wiring.binder;version="[1.0.0,2.0.0)",
com.e1c.g5.dt.core.api.naming;version="1.0.0",
com.e1c.g5.dt.core.api.platform;version="[1.1.0,2.0.0)",
- com.e1c.g5.v8.dt.bsl.check;version="[2.0.0,3.0.0)",
+ com.e1c.g5.v8.dt.bsl.check;version="[3.0.0,4.0.0)",
com.e1c.g5.v8.dt.bsl.check.qfix;version="[3.0.0,4.0.0)",
com.e1c.g5.v8.dt.check;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.components;version="[2.0.0,3.0.0)",
- com.e1c.g5.v8.dt.check.qfix;version="[2.0.0,3.0.0)",
+ com.e1c.g5.v8.dt.check.qfix;version="[3.0.0,4.0.0)",
com.e1c.g5.v8.dt.check.qfix.components;version="[1.0.0,2.0.0)",
- com.e1c.g5.v8.dt.check.settings;version="[3.0.0,4.0.0)",
+ com.e1c.g5.v8.dt.check.settings;version="[4.0.0,5.0.0)",
com.e1c.v8codestyle;version="[0.7.0,0.8.0)",
com.e1c.v8codestyle.check;version="[0.7.0,0.8.0)"
Export-Package: com.e1c.v8codestyle.bsl;version="0.7.0",
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/ModuleStructureSection.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/ModuleStructureSection.java
index 599ea313..31ef3d2c 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/ModuleStructureSection.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/ModuleStructureSection.java
@@ -15,29 +15,37 @@ package com.e1c.v8codestyle.bsl;
import com._1c.g5.v8.dt.metadata.mdclass.ScriptVariant;
/**
- * Standard module structure dually-named section.
+ * Standard module structure dually-named section;
+ *
Sorted by priority of module regions standard.
*
* @author Dmitriy Marmyshev
*/
public enum ModuleStructureSection
{
- PUBLIC("Public", "ПрограммныйИнтерфейс"), //$NON-NLS-1$ //$NON-NLS-2$
- INTERNAL("Internal", "СлужебныйПрограммныйИнтерфейс"), //$NON-NLS-1$ //$NON-NLS-2$
- PRIVATE("Private", "СлужебныеПроцедурыИФункции"), //$NON-NLS-1$ //$NON-NLS-2$
VARIABLES("Variables", "ОписаниеПеременных"), //$NON-NLS-1$ //$NON-NLS-2$
- INITIALIZE("Initialize", "Инициализация"), //$NON-NLS-1$ //$NON-NLS-2$
+ PUBLIC("Public", "ПрограммныйИнтерфейс"), //$NON-NLS-1$ //$NON-NLS-2$
EVENT_HANDLERS("EventHandlers", "ОбработчикиСобытий"), //$NON-NLS-1$ //$NON-NLS-2$
+ INTERNAL("Internal", "СлужебныйПрограммныйИнтерфейс"), //$NON-NLS-1$ //$NON-NLS-2$
FORM_EVENT_HANDLERS("FormEventHandlers", "ОбработчикиСобытийФормы"), //$NON-NLS-1$ //$NON-NLS-2$
FORM_HEADER_ITEMS_EVENT_HANDLERS("FormHeaderItemsEventHandlers", "ОбработчикиСобытийЭлементовШапкиФормы"), //$NON-NLS-1$ //$NON-NLS-2$
+ FORM_TABLE_ITEMS_EVENT_HANDLERS("FormTableItemsEventHandlers", "ОбработчикиСобытийЭлементовТаблицыФормы", true), //$NON-NLS-1$ //$NON-NLS-2$
FORM_COMMAND_EVENT_HANDLERS("FormCommandsEventHandlers", "ОбработчикиКомандФормы"), //$NON-NLS-1$ //$NON-NLS-2$
- FORM_TABLE_ITEMS_EVENT_HANDLERS("FormTableItemsEventHandlers", "ОбработчикиСобытийЭлементовТаблицыФормы"), //$NON-NLS-1$ //$NON-NLS-2$
+ PRIVATE("Private", "СлужебныеПроцедурыИФункции"), //$NON-NLS-1$ //$NON-NLS-2$
+ INITIALIZE("Initialize", "Инициализация"), //$NON-NLS-1$ //$NON-NLS-2$
DEPRECATED_REGION("Deprecated", "УстаревшиеПроцедурыИФункции"); //$NON-NLS-1$ //$NON-NLS-2$
private final String[] names;
+ private final boolean isSuffixed;
+
+ ModuleStructureSection(String name, String nameRu, boolean isSuffixed)
+ {
+ this.names = new String[] { name, nameRu };
+ this.isSuffixed = isSuffixed;
+ }
ModuleStructureSection(String name, String nameRu)
{
- this.names = new String[] { name, nameRu };
+ this(name, nameRu, false);
}
/**
@@ -61,4 +69,13 @@ public enum ModuleStructureSection
return names[scriptVariant.getValue()];
}
+ /**
+ * Is module region name used only with suffix
+ *
+ * @return true
if region name must be suffixed, false
otherwise
+ */
+ public boolean isSuffixed()
+ {
+ return isSuffixed;
+ }
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/CodeAfterAsyncCallCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/CodeAfterAsyncCallCheck.java
index 418a3f93..e400a400 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/CodeAfterAsyncCallCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/CodeAfterAsyncCallCheck.java
@@ -52,8 +52,6 @@ import com.e1c.g5.v8.dt.check.components.BasicCheck;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
import com.e1c.v8codestyle.bsl.IAsyncInvocationProvider;
-import com.e1c.v8codestyle.check.CommonSenseCheckExtension;
-import com.e1c.v8codestyle.internal.bsl.BslPlugin;
import com.google.common.collect.Lists;
import com.google.inject.Inject;
@@ -101,7 +99,7 @@ public final class CodeAfterAsyncCallCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MAJOR)
.issueType(IssueType.WARNING)
- .extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
+ .disable()
.module()
.checkedObjectType(INVOCATION)
.parameter(PARAMETER_NAME, Boolean.class, DEFAULT_CHECK, Messages.CodeAfterAsyncCallCheck_Parameter);
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ExportProcedureMissingCommentCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ExportProcedureMissingCommentCheck.java
index f7cfb7a2..96297bc0 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ExportProcedureMissingCommentCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ExportProcedureMissingCommentCheck.java
@@ -86,7 +86,7 @@ public class ExportProcedureMissingCommentCheck
private static boolean verifyTopRegion(Optional regionTop)
{
- if (regionTop.isEmpty())
+ if (regionTop.isEmpty() || regionTop.get().getName() == null)
{
return false;
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ModuleStructureTopRegionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ModuleStructureTopRegionCheck.java
index a6053573..027d3213 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ModuleStructureTopRegionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ModuleStructureTopRegionCheck.java
@@ -275,6 +275,10 @@ public class ModuleStructureTopRegionCheck
for (RegionPreprocessor region : allRegions)
{
String regionName = region.getName();
+ if (StringUtils.isBlank(regionName))
+ {
+ continue;
+ }
countRegions.putIfAbsent(regionName, new ArrayList<>());
countRegions.get(regionName).add(region);
if (getFirstParentRegion(region).isEmpty())
@@ -288,7 +292,7 @@ public class ModuleStructureTopRegionCheck
{
for (String name : regionNames)
{
- if (regionName.equalsIgnoreCase(name))
+ if (regionName == null || regionName.equalsIgnoreCase(name))
{
return true;
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/AbstractDocCommentTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/AbstractDocCommentTypeCheck.java
index 7e672587..748eafac 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/AbstractDocCommentTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/AbstractDocCommentTypeCheck.java
@@ -33,6 +33,8 @@ import com._1c.g5.v8.dt.bsl.resource.TypesComputer;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.Method;
import com._1c.g5.v8.dt.mcore.Parameter;
import com._1c.g5.v8.dt.mcore.Property;
@@ -52,14 +54,15 @@ public abstract class AbstractDocCommentTypeCheck
/**
* Constructs an instance
*
- * @param resourceLookup
- * @param namingService
- * @param bmModelManager
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
protected AbstractDocCommentTypeCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
/**
@@ -172,12 +175,12 @@ public abstract class AbstractDocCommentTypeCheck
|| (linkPart.getPartsWithOffset().get(linkPart.getPartsWithOffset().size() - 1)).getFirst().isEmpty()))
{
return Optional.ofNullable(linkPart.getActualObjectForPart(linkPart.getPartsWithOffset().size() - 2,
- scopeProvider, context, typeComputationContext));
+ scopeProvider, context, v8ProjectManager, typeComputationContext));
}
else
{
return Optional.ofNullable(linkPart.getActualObjectForPart(linkPart.getPartsWithOffset().size() - 1,
- scopeProvider, context, typeComputationContext));
+ scopeProvider, context, v8ProjectManager, typeComputationContext));
}
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/CollectionTypeDefinitionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/CollectionTypeDefinitionCheck.java
index c76d38e4..516de46f 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/CollectionTypeDefinitionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/CollectionTypeDefinitionCheck.java
@@ -17,6 +17,7 @@ import java.util.Set;
import java.util.TreeSet;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
@@ -25,6 +26,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.TypeSection.TypeDefinition;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.platform.IEObjectTypeNames;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
@@ -65,15 +68,16 @@ public class CollectionTypeDefinitionCheck
/**
* Constructs an instance
*
- * @param resourceLookup
- * @param namingService
- * @param bmModelManager
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public CollectionTypeDefinitionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/DocCommentUseMinusCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/DocCommentUseMinusCheck.java
index 99ad3508..e45cd6ee 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/DocCommentUseMinusCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/DocCommentUseMinusCheck.java
@@ -17,6 +17,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.Description;
@@ -24,6 +25,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
import com._1c.g5.v8.dt.bsl.documentation.comment.TextPart;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
@@ -65,11 +68,19 @@ public class DocCommentUseMinusCheck
private static final int SHOW_PREV_SYMBOLS = 7;
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public DocCommentUseMinusCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ExportFunctionReturnSectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ExportFunctionReturnSectionCheck.java
index bc474c4b..f925ac13 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ExportFunctionReturnSectionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ExportFunctionReturnSectionCheck.java
@@ -16,6 +16,7 @@ import static com._1c.g5.v8.dt.mcore.McorePackage.Literals.NAMED_ELEMENT__NAME;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.scoping.IScopeProvider;
import com._1c.g5.v8.dt.bsl.comment.DocumentationCommentProperties;
@@ -28,6 +29,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.LinkPart;
import com._1c.g5.v8.dt.bsl.model.Function;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
@@ -61,19 +64,20 @@ public class ExportFunctionReturnSectionCheck
/**
* Instantiates a new check of export function return section.
*
- * @param resourceLookup the resource lookup service, cannot be {@code null}.
- * @param namingService
- * @param bmModelManager
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param commentProvider the comment provider service, cannot be {@code null}.
* @param scopeProvider the scope provider service, cannot be {@code null}.
*/
@Inject
public ExportFunctionReturnSectionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager, IBslPreferences bslPreferences,
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager, IBslPreferences bslPreferences,
BslMultiLineCommentDocumentationProvider commentProvider, IScopeProvider scopeProvider)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.resourceLookup = resourceLookup;
this.bslPreferences = bslPreferences;
this.commentProvider = commentProvider;
@@ -117,7 +121,7 @@ public class ExportFunctionReturnSectionCheck
DocumentationCommentProperties props = bslPreferences.getDocumentCommentProperties(project);
docComment = BslCommentUtils.getLinkPartCommentContent(linkPart, scopeProvider, commentProvider,
- props.oldCommentFormat(), root.getMethod(), typeComputationContext);
+ props.oldCommentFormat(), root.getMethod(), v8ProjectManager, typeComputationContext);
}
if (docComment == null || docComment.getReturnSection() == null || isTypeEmptyAndNoLink(
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ExportProcedureCommentDescriptionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ExportProcedureCommentDescriptionCheck.java
index 7b3be3bc..1e169f2d 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ExportProcedureCommentDescriptionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ExportProcedureCommentDescriptionCheck.java
@@ -26,6 +26,8 @@ import com._1c.g5.v8.dt.bsl.model.PreprocessorItem;
import com._1c.g5.v8.dt.bsl.model.RegionPreprocessor;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
@@ -47,11 +49,19 @@ public class ExportProcedureCommentDescriptionCheck
{
private static final String CHECK_ID = "doc-comment-export-procedure-description-section"; //$NON-NLS-1$
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public ExportProcedureCommentDescriptionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionNameCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionNameCheck.java
index 9551a295..9423f4c9 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionNameCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionNameCheck.java
@@ -16,6 +16,7 @@ import java.text.MessageFormat;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
@@ -24,6 +25,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.TypeSection.TypeDefinition;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
@@ -47,11 +50,19 @@ public class FieldDefinitionNameCheck
{
private static final String CHECK_ID = "doc-comment-field-name"; //$NON-NLS-1$
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public FieldDefinitionNameCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionTypeCheck.java
index 3b6af249..0366c87b 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionTypeCheck.java
@@ -15,12 +15,15 @@ package com.e1c.v8codestyle.bsl.comment.check;
import java.text.MessageFormat;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
import com._1c.g5.v8.dt.bsl.documentation.comment.TypeSection.FieldDefinition;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
@@ -41,11 +44,19 @@ public class FieldDefinitionTypeCheck
{
private static final String CHECK_ID = "doc-comment-field-type"; //$NON-NLS-1$
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public FieldDefinitionTypeCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionTypeWithLinkRefCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionTypeWithLinkRefCheck.java
index 78c436f7..28c9b53c 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionTypeWithLinkRefCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FieldDefinitionTypeWithLinkRefCheck.java
@@ -30,6 +30,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.TypeSection.TypeDefinition;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.platform.IEObjectTypeNames;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
@@ -81,13 +83,17 @@ public class FieldDefinitionTypeWithLinkRefCheck
/**
* Instantiates a new field definition type with link reference to constructor function check.
*
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
* @param scopeProvider the scope provider service, cannot be {@code null}.
*/
@Inject
public FieldDefinitionTypeWithLinkRefCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager, IScopeProvider scopeProvider)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager, IScopeProvider scopeProvider)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.scopeProvider = scopeProvider;
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FunctionReturnSectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FunctionReturnSectionCheck.java
index 166a9a6b..5c16fbde 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FunctionReturnSectionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/FunctionReturnSectionCheck.java
@@ -18,6 +18,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
+import org.eclipse.xtext.naming.QualifiedName;
import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.scoping.IScopeProvider;
@@ -30,6 +31,8 @@ import com._1c.g5.v8.dt.bsl.model.Function;
import com._1c.g5.v8.dt.bsl.model.Method;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.McorePackage;
import com._1c.g5.v8.dt.mcore.TypeItem;
import com.e1c.g5.dt.core.api.naming.INamingService;
@@ -64,12 +67,25 @@ public class FunctionReturnSectionCheck
private final IQualifiedNameConverter qualifiedNameConverter;
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ * @param bslPreferences service for getting preferences for Built-In language, cannot be null
+ * @param qualifiedNameConverter service for getting {@link QualifiedName} by {@link EObject}, cannot be null
+ * @param scopeProvider service for getting {@link IScope} for Built-In language, cannot be null
+ * @param commentProvider service for getting comments content in Built-In language, cannot be null
+ */
@Inject
public FunctionReturnSectionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager, IBslPreferences bslPreferences, IQualifiedNameConverter qualifiedNameConverter,
- IScopeProvider scopeProvider, BslMultiLineCommentDocumentationProvider commentProvider)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager, IBslPreferences bslPreferences,
+ IQualifiedNameConverter qualifiedNameConverter, IScopeProvider scopeProvider,
+ BslMultiLineCommentDocumentationProvider commentProvider)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.resourceLookup = resourceLookup;
this.bslPreferences = bslPreferences;
this.qualifiedNameConverter = qualifiedNameConverter;
@@ -119,7 +135,7 @@ public class FunctionReturnSectionCheck
IScope typeScope = scopeProvider.getScope(method, McorePackage.Literals.TYPE_DESCRIPTION__TYPES);
Collection computedReturnTypes =
- root.computeReturnTypes(typeScope, scopeProvider, qualifiedNameConverter, commentProvider,
+ root.computeReturnTypes(typeScope, scopeProvider, qualifiedNameConverter, commentProvider, v8ProjectManager,
oldCommentFormat(root.getModule()), method, typeComputationContext);
if (computedReturnTypes.isEmpty())
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionEndsOnDotCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionEndsOnDotCheck.java
index 516e3035..7473a46f 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionEndsOnDotCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionEndsOnDotCheck.java
@@ -13,6 +13,7 @@
package com.e1c.v8codestyle.bsl.comment.check;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.Description;
@@ -20,6 +21,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
import com._1c.g5.v8.dt.bsl.documentation.comment.TextPart;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
@@ -40,11 +43,19 @@ public class MultilineDescriptionEndsOnDotCheck
private static final String CHECK_ID = "doc-comment-description-ends-on-dot"; //$NON-NLS-1$
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public MultilineDescriptionEndsOnDotCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionFieldSuggestionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionFieldSuggestionCheck.java
index fbde22e0..126791ed 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionFieldSuggestionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionFieldSuggestionCheck.java
@@ -16,6 +16,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.Description;
@@ -24,6 +25,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.TextPart;
import com._1c.g5.v8.dt.bsl.model.Procedure;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
@@ -57,11 +60,19 @@ public class MultilineDescriptionFieldSuggestionCheck
private static final Pattern PATTERN_FIELD =
Pattern.compile("^\\s*\\*+\\s*\\w+\\s*-", Pattern.UNICODE_CHARACTER_CLASS | Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public MultilineDescriptionFieldSuggestionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionParameterSuggestionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionParameterSuggestionCheck.java
index 03da8fff..07400487 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionParameterSuggestionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/MultilineDescriptionParameterSuggestionCheck.java
@@ -18,6 +18,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.Description;
@@ -27,6 +28,8 @@ import com._1c.g5.v8.dt.bsl.model.FormalParam;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
@@ -54,11 +57,19 @@ public class MultilineDescriptionParameterSuggestionCheck
private static final String CHECK_ID = "doc-comment-parameter-in-description-suggestion"; //$NON-NLS-1$
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public MultilineDescriptionParameterSuggestionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ParametersSectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ParametersSectionCheck.java
index 1d04a050..88ad6dff 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ParametersSectionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ParametersSectionCheck.java
@@ -20,6 +20,9 @@ import java.util.TreeSet;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.naming.QualifiedName;
+import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.scoping.IScopeProvider;
import com._1c.g5.v8.dt.bsl.comment.DocumentationCommentProperties;
@@ -36,6 +39,8 @@ import com._1c.g5.v8.dt.bsl.model.Method;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
@@ -63,21 +68,30 @@ public class ParametersSectionCheck
private static final String PARAMETER_PARMA_SECT_FOR_EXPORT = "requireParameterSectionOnlyForExport"; //$NON-NLS-1$
- private final IResourceLookup resourceLookup;
-
private final IBslPreferences bslPreferences;
private final IScopeProvider scopeProvider;
private final BslMultiLineCommentDocumentationProvider commentProvider;
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ * @param bslPreferences service for getting preferences for Built-In language, cannot be null
+ * @param qualifiedNameConverter service for getting {@link QualifiedName} by {@link EObject}, cannot be null
+ * @param scopeProvider service for getting {@link IScope} for Built-In language, cannot be null
+ * @param commentProvider service for getting comments content in Built-In language, cannot be null
+ */
@Inject
public ParametersSectionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager, IBslPreferences bslPreferences, IScopeProvider scopeProvider,
- BslMultiLineCommentDocumentationProvider commentProvider)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager, IBslPreferences bslPreferences,
+ IScopeProvider scopeProvider, BslMultiLineCommentDocumentationProvider commentProvider)
{
- super(resourceLookup, namingService, bmModelManager);
- this.resourceLookup = resourceLookup;
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.bslPreferences = bslPreferences;
this.scopeProvider = scopeProvider;
this.commentProvider = commentProvider;
@@ -159,7 +173,7 @@ public class ParametersSectionCheck
DocumentationCommentProperties props = bslPreferences.getDocumentCommentProperties(project);
docComment = BslCommentUtils.getLinkPartCommentContent(linkPart, scopeProvider, commentProvider,
- props.oldCommentFormat(), object.getMethod(), typeComputationContext);
+ props.oldCommentFormat(), object.getMethod(), v8ProjectManager, typeComputationContext);
}
if (docComment == null)
{
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ProcedureReturnSectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ProcedureReturnSectionCheck.java
index 1d863683..206d197d 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ProcedureReturnSectionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/ProcedureReturnSectionCheck.java
@@ -13,6 +13,7 @@
package com.e1c.v8codestyle.bsl.comment.check;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.ReturnSection;
@@ -20,6 +21,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
import com._1c.g5.v8.dt.bsl.model.Procedure;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
@@ -43,11 +46,19 @@ public class ProcedureReturnSectionCheck
private static final String CHECK_ID = "doc-comment-procedure-return-section"; //$NON-NLS-1$
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public ProcedureReturnSectionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/RedundantParametersSectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/RedundantParametersSectionCheck.java
index 7b046fb4..93128e37 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/RedundantParametersSectionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/RedundantParametersSectionCheck.java
@@ -13,12 +13,15 @@
package com.e1c.v8codestyle.bsl.comment.check;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.ParametersSection;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
@@ -41,11 +44,19 @@ public class RedundantParametersSectionCheck
{
private static final String CHECK_ID = "doc-comment-redundant-parameter-section"; //$NON-NLS-1$
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ */
@Inject
public RedundantParametersSectionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/RefLinkPartCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/RefLinkPartCheck.java
index deee01c0..20d44603 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/RefLinkPartCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/RefLinkPartCheck.java
@@ -13,6 +13,7 @@
package com.e1c.v8codestyle.bsl.comment.check;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.scoping.IScopeProvider;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
@@ -22,6 +23,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.LinkPart;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
@@ -61,13 +64,17 @@ public class RefLinkPartCheck
/**
* Instantiates a new reference link part check.
*
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
* @param scopeProvider the scope provider service, cannot be {@code null}.
*/
@Inject
public RefLinkPartCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager, IScopeProvider scopeProvider)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager, IScopeProvider scopeProvider)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.scopeProvider = scopeProvider;
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/TypeDefinitionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/TypeDefinitionCheck.java
index cba6cca8..9c1ec867 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/TypeDefinitionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/comment/check/TypeDefinitionCheck.java
@@ -15,7 +15,9 @@ package com.e1c.v8codestyle.bsl.comment.check;
import java.text.MessageFormat;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
+import org.eclipse.xtext.naming.QualifiedName;
import org.eclipse.xtext.resource.IEObjectDescription;
import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.scoping.IScopeProvider;
@@ -27,6 +29,8 @@ import com._1c.g5.v8.dt.bsl.documentation.comment.TypeSection.TypeDefinition;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.McorePackage;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
@@ -53,11 +57,22 @@ public class TypeDefinitionCheck
private final IQualifiedNameConverter qualifiedNameConverter;
+ /**
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ * @param qualifiedNameConverter service for getting {@link QualifiedName} by {@link EObject}, cannot be null
+ * @param scopeProvider service for getting {@link IScope} for Built-In language, cannot be null
+ */
@Inject
public TypeDefinitionCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager, IQualifiedNameConverter qualifiedNameConverter, IScopeProvider scopeProvider)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager,
+ IQualifiedNameConverter qualifiedNameConverter, IScopeProvider scopeProvider)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.qualifiedNameConverter = qualifiedNameConverter;
this.scopeProvider = scopeProvider;
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/AbstractDynamicFeatureAccessTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/AbstractDynamicFeatureAccessTypeCheck.java
index 2f044439..53232bb7 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/AbstractDynamicFeatureAccessTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/AbstractDynamicFeatureAccessTypeCheck.java
@@ -20,6 +20,7 @@ import java.util.Set;
import java.util.TreeSet;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
@@ -32,6 +33,8 @@ import com._1c.g5.v8.dt.bsl.model.util.BslUtil;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.Environmental;
import com._1c.g5.v8.dt.mcore.TypeItem;
import com._1c.g5.v8.dt.mcore.util.Environments;
@@ -66,11 +69,15 @@ public abstract class AbstractDynamicFeatureAccessTypeCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
protected AbstractDynamicFeatureAccessTypeCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/AbstractTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/AbstractTypeCheck.java
index 4ea7f905..17b7b04a 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/AbstractTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/AbstractTypeCheck.java
@@ -55,6 +55,8 @@ import com._1c.g5.v8.dt.bsl.typesystem.util.TypeSystemUtil;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IDtProject;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.Environmental;
import com._1c.g5.v8.dt.mcore.McorePackage;
import com._1c.g5.v8.dt.mcore.Type;
@@ -109,6 +111,11 @@ public abstract class AbstractTypeCheck
/** The comment provider service. */
protected final BslMultiLineCommentDocumentationProvider commentProvider;
+ /**
+ * {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}
+ */
+ protected final IV8ProjectManager v8ProjectManager;
+
private final InternalTypeNameRegistry internalTypeNameRegistry;
/**
@@ -117,15 +124,20 @@ public abstract class AbstractTypeCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
protected AbstractTypeCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
super();
this.resourceLookup = resourceLookup;
this.namingService = namingService;
this.bmModelManager = bmModelManager;
this.bslPreferences = bslPreferences;
+ this.v8ProjectManager = v8ProjectManager;
IResourceServiceProvider rsp =
IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(URI.createURI("*.bsl")); //$NON-NLS-1$
this.typeComputer = rsp.get(TypesComputer.class);
@@ -250,7 +262,7 @@ public abstract class AbstractTypeCheck
IProject project = resourceLookup.getProject(object);
boolean oldFormatComment = bslPreferences.getDocumentCommentProperties(project).oldCommentFormat();
return TypeSystemUtil.computeCommentTypes(object, typeScope, scopeProvider, qualifiedNameConverter,
- commentProvider, oldFormatComment,
+ commentProvider, v8ProjectManager, oldFormatComment,
new BmOperationContext(namingService, bmModelManager, bmTransaction));
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DocCommentFieldTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DocCommentFieldTypeCheck.java
index bb39af08..edfc0935 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DocCommentFieldTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DocCommentFieldTypeCheck.java
@@ -17,12 +17,15 @@ import static com.e1c.v8codestyle.bsl.strict.check.StrictTypeAnnotationCheckExte
import java.text.MessageFormat;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
import com._1c.g5.v8.dt.bsl.documentation.comment.TypeSection.FieldDefinition;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
@@ -46,15 +49,18 @@ public class DocCommentFieldTypeCheck
private static final String CHECK_ID = "doc-comment-field-type-strict"; //$NON-NLS-1$
/**
- * @param resourceLookup
- * @param namingService
- * @param bmModelManager
+ * Constructs an instance
+ *
+ * @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be null
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public DocCommentFieldTypeCheck(IResourceLookup resourceLookup, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DynamicFeatureAccessMethodNotFoundCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DynamicFeatureAccessMethodNotFoundCheck.java
index 9d85bcd1..f44a8803 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DynamicFeatureAccessMethodNotFoundCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DynamicFeatureAccessMethodNotFoundCheck.java
@@ -14,12 +14,15 @@ package com.e1c.v8codestyle.bsl.strict.check;
import java.text.MessageFormat;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
import com._1c.g5.v8.dt.bsl.common.IBslPreferences;
import com._1c.g5.v8.dt.bsl.model.DynamicFeatureAccess;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.google.inject.Inject;
@@ -40,12 +43,16 @@ public class DynamicFeatureAccessMethodNotFoundCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public DynamicFeatureAccessMethodNotFoundCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DynamicFeatureAccessTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DynamicFeatureAccessTypeCheck.java
index d038b27c..7885981f 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DynamicFeatureAccessTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/DynamicFeatureAccessTypeCheck.java
@@ -14,12 +14,15 @@ package com.e1c.v8codestyle.bsl.strict.check;
import java.text.MessageFormat;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
import com._1c.g5.v8.dt.bsl.common.IBslPreferences;
import com._1c.g5.v8.dt.bsl.model.DynamicFeatureAccess;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.google.inject.Inject;
@@ -39,12 +42,16 @@ public class DynamicFeatureAccessTypeCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public DynamicFeatureAccessTypeCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/FunctionCtorReturnSectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/FunctionCtorReturnSectionCheck.java
index 7e144529..7c64a0a9 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/FunctionCtorReturnSectionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/FunctionCtorReturnSectionCheck.java
@@ -29,6 +29,7 @@ import java.util.stream.StreamSupport;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
@@ -96,10 +97,6 @@ public class FunctionCtorReturnSectionCheck
private final BslMultiLineCommentDocumentationProvider commentProvider;
- private final IResourceLookup resourceLookup;
-
- private final IV8ProjectManager v8ProjectManager;
-
private final IBslPreferences bslPreferences;
/**
@@ -113,22 +110,23 @@ public class FunctionCtorReturnSectionCheck
* @param dynamicComputer the dynamic computer service, cannot be {@code null}.
* @param scopeProvider the scope provider service, cannot be {@code null}.
* @param commentProvider the comment provider service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
- public FunctionCtorReturnSectionCheck(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
+ public FunctionCtorReturnSectionCheck(IResourceLookup resourceLookup,
IQualifiedNameConverter qualifiedNameConverter, IBslPreferences bslPreferences, TypesComputer typesComputer,
DynamicFeatureAccessComputer dynamicComputer, IScopeProvider scopeProvider,
BslMultiLineCommentDocumentationProvider commentProvider, INamingService namingService,
- IBmModelManager bmModelManager)
+ IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, namingService, bmModelManager);
+ super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.typesComputer = typesComputer;
this.dynamicComputer = dynamicComputer;
this.scopeProvider = scopeProvider;
this.commentProvider = commentProvider;
this.qualifiedNameConverter = qualifiedNameConverter;
- this.resourceLookup = resourceLookup;
- this.v8ProjectManager = v8ProjectManager;
this.bslPreferences = bslPreferences;
}
@@ -181,7 +179,7 @@ public class FunctionCtorReturnSectionCheck
boolean oldFormat = props.oldCommentFormat();
Collection computedReturnTypes = root.computeReturnTypes(typeScope, scopeProvider,
- qualifiedNameConverter, commentProvider, oldFormat, method, context);
+ qualifiedNameConverter, commentProvider, v8ProjectManager, oldFormat, method, context);
Set checkTypes = getCheckTypes(parameters);
@@ -215,6 +213,10 @@ public class FunctionCtorReturnSectionCheck
for (TypeItem returnType : returnTypes)
{
+ if (returnType.eIsProxy())
+ {
+ continue;
+ }
String returnTypeName = McoreUtil.getTypeName(returnType);
if (returnTypeName != null && computedReturnTypeNames.contains(returnTypeName))
{
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/FunctionReturnTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/FunctionReturnTypeCheck.java
index a781e2b1..2a2d4a27 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/FunctionReturnTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/FunctionReturnTypeCheck.java
@@ -21,6 +21,8 @@ import com._1c.g5.v8.dt.bsl.common.IBslPreferences;
import com._1c.g5.v8.dt.bsl.model.BslPackage;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.McorePackage;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.v8.dt.check.CheckComplexity;
@@ -46,12 +48,16 @@ public class FunctionReturnTypeCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public FunctionReturnTypeCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/InvocationParamIntersectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/InvocationParamIntersectionCheck.java
index 9f4cb91e..d21413a5 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/InvocationParamIntersectionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/InvocationParamIntersectionCheck.java
@@ -126,8 +126,6 @@ public class InvocationParamIntersectionCheck
//@formatter:on
- private final IV8ProjectManager v8ProjectManager;
-
private final ExportMethodTypeProvider exportMethodTypeProvider;
/**
@@ -136,17 +134,18 @@ public class InvocationParamIntersectionCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
- * @param v8ProjectManager the v 8 project manager service, cannot be {@code null}.
* @param exportMethodTypeProvider the export method type provider service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public InvocationParamIntersectionCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, IV8ProjectManager v8ProjectManager,
- ExportMethodTypeProvider exportMethodTypeProvider, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, ExportMethodTypeProvider exportMethodTypeProvider,
+ INamingService namingService, IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
this.exportMethodTypeProvider = exportMethodTypeProvider;
- this.v8ProjectManager = v8ProjectManager;
}
@Override
@@ -295,7 +294,7 @@ public class InvocationParamIntersectionCheck
new BmOperationContext(namingService, bmModelManager, bmTransaction);
targetTypes = docComment.get()
.computeParameterTypes(parameter.getName(), typeScope, scopeProvider, qualifiedNameConverter,
- commentProvider, oldFormatComment, method, typeComputationContext);
+ commentProvider, v8ProjectManager, oldFormatComment, method, typeComputationContext);
}
if (targetTypes.isEmpty())
@@ -462,7 +461,7 @@ public class InvocationParamIntersectionCheck
// if parameter declared in doc-comment then check only declared types
targetTypes = docComment.get()
.computeParameterTypes(paramName, typeScope, scopeProvider, qualifiedNameConverter, commentProvider,
- oldFormatComment, method, typeComputationContext);
+ v8ProjectManager, oldFormatComment, method, typeComputationContext);
}
else
{
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/MethodParamTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/MethodParamTypeCheck.java
index fbc8300f..d0b49499 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/MethodParamTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/MethodParamTypeCheck.java
@@ -26,6 +26,8 @@ import com._1c.g5.v8.dt.bsl.common.IBslPreferences;
import com._1c.g5.v8.dt.bsl.model.FormalParam;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.v8.dt.check.CheckComplexity;
import com.e1c.g5.v8.dt.check.ICheckParameters;
@@ -51,12 +53,16 @@ public class MethodParamTypeCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public MethodParamTypeCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/SimpleStatementTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/SimpleStatementTypeCheck.java
index fb0b88b3..37ac4e94 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/SimpleStatementTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/SimpleStatementTypeCheck.java
@@ -39,6 +39,7 @@ import com._1c.g5.v8.dt.bsl.model.StaticFeatureAccess;
import com._1c.g5.v8.dt.bsl.model.Variable;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.Environmental;
import com._1c.g5.v8.dt.mcore.TypeItem;
@@ -68,23 +69,22 @@ public class SimpleStatementTypeCheck
private static final String DEFAULT_ALLOW_IMPLICIT_VAR_RESET_TO_UNDEFINED = Boolean.TRUE.toString();
- private final IV8ProjectManager v8ProjectManager;
-
/**
* Instantiates a new simple statement change type check.
*
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
- * @param v8ProjectManager the v8 project manager service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public SimpleStatementTypeCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IV8ProjectManager v8ProjectManager, IQualifiedNameConverter qualifiedNameConverter,
- INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
- this.v8ProjectManager = v8ProjectManager;
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/StructureCtorValueTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/StructureCtorValueTypeCheck.java
index b2f7c0a7..c783c33f 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/StructureCtorValueTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/StructureCtorValueTypeCheck.java
@@ -18,6 +18,7 @@ import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.STRING_LITERAL__LIN
import java.text.MessageFormat;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
import com._1c.g5.v8.bm.core.IBmTransaction;
@@ -28,6 +29,8 @@ import com._1c.g5.v8.dt.bsl.model.OperatorStyleCreator;
import com._1c.g5.v8.dt.bsl.model.StringLiteral;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.util.McoreUtil;
import com._1c.g5.v8.dt.platform.IEObjectTypeNames;
import com.e1c.g5.dt.core.api.naming.INamingService;
@@ -55,12 +58,16 @@ public class StructureCtorValueTypeCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public StructureCtorValueTypeCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/StructureKeyModificationCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/StructureKeyModificationCheck.java
index 83df7a8c..a2bfe986 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/StructureKeyModificationCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/StructureKeyModificationCheck.java
@@ -23,6 +23,7 @@ import java.util.stream.Collectors;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.xtext.EcoreUtil2;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
@@ -43,6 +44,8 @@ import com._1c.g5.v8.dt.bsl.model.util.BslUtil;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.DerivedProperty;
import com._1c.g5.v8.dt.mcore.Property;
import com._1c.g5.v8.dt.mcore.TypeItem;
@@ -85,12 +88,23 @@ public class StructureKeyModificationCheck
private final IStaticExpressionValueComputer staticExpressionValueComputer;
+ /**
+ * Instantiates a new structure constructor value type check.
+ *
+ * @param resourceLookup the resource lookup service, cannot be {@code null}.
+ * @param bslPreferences the BSL preferences service, cannot be {@code null}.
+ * @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
+ * @param staticExpressionValueComputer {@link IStaticExpressionValueComputer} for compute string literal type, cannot be null
+ */
@Inject
public StructureKeyModificationCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
- IStaticExpressionValueComputer staticExpressionValueComputer)
+ IV8ProjectManager v8ProjectManager, IStaticExpressionValueComputer staticExpressionValueComputer)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
this.staticExpressionValueComputer = staticExpressionValueComputer;
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/TypedValueAddingToUntypedCollectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/TypedValueAddingToUntypedCollectionCheck.java
index 1b5a5be8..88e31767 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/TypedValueAddingToUntypedCollectionCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/TypedValueAddingToUntypedCollectionCheck.java
@@ -37,6 +37,8 @@ import com._1c.g5.v8.dt.bsl.model.SourceObjectLinkProvider;
import com._1c.g5.v8.dt.bsl.model.util.BslUtil;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.Method;
import com._1c.g5.v8.dt.mcore.Type;
import com._1c.g5.v8.dt.mcore.TypeItem;
@@ -79,12 +81,15 @@ public class TypedValueAddingToUntypedCollectionCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public TypedValueAddingToUntypedCollectionCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
@@ -207,7 +212,10 @@ public class TypedValueAddingToUntypedCollectionCheck
}
else
{
- actualTypes.addAll(((Type)type).getCollectionElementTypes().allTypes());
+ if (((Type)type).getCollectionElementTypes() != null)
+ {
+ actualTypes.addAll(((Type)type).getCollectionElementTypes().allTypes());
+ }
}
}
diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/VariableTypeCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/VariableTypeCheck.java
index 046b84d7..1f10e8dc 100644
--- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/VariableTypeCheck.java
+++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/VariableTypeCheck.java
@@ -32,6 +32,8 @@ import com._1c.g5.v8.dt.bsl.model.StaticFeatureAccess;
import com._1c.g5.v8.dt.bsl.model.Variable;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
+import com._1c.g5.v8.dt.core.platform.IV8Project;
+import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.Environmental;
import com._1c.g5.v8.dt.mcore.util.Environments;
import com.e1c.g5.dt.core.api.naming.INamingService;
@@ -59,12 +61,16 @@ public class VariableTypeCheck
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param qualifiedNameConverter the qualified name converter service, cannot be {@code null}.
+ * @param namingService service for getting names of EDT object and resources, cannot be null
+ * @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be null
+ * @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be null
*/
@Inject
public VariableTypeCheck(IResourceLookup resourceLookup, IBslPreferences bslPreferences,
- IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager)
+ IQualifiedNameConverter qualifiedNameConverter, INamingService namingService, IBmModelManager bmModelManager,
+ IV8ProjectManager v8ProjectManager)
{
- super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager);
+ super(resourceLookup, bslPreferences, qualifiedNameConverter, namingService, bmModelManager, v8ProjectManager);
}
@Override
diff --git a/bundles/com.e1c.v8codestyle.bsl/templates/en/command_module.bsl b/bundles/com.e1c.v8codestyle.bsl/templates/en/command_module.bsl
index 67df44fe..8adad148 100644
--- a/bundles/com.e1c.v8codestyle.bsl/templates/en/command_module.bsl
+++ b/bundles/com.e1c.v8codestyle.bsl/templates/en/command_module.bsl
@@ -2,9 +2,7 @@
#Region EventHandlers
// Enter code here.
-
//%CURRENT_CODE%
-
#EndRegion
#Region Private
diff --git a/bundles/com.e1c.v8codestyle.bsl/templates/en/form_module.bsl b/bundles/com.e1c.v8codestyle.bsl/templates/en/form_module.bsl
index f2dda768..d2d1171a 100644
--- a/bundles/com.e1c.v8codestyle.bsl/templates/en/form_module.bsl
+++ b/bundles/com.e1c.v8codestyle.bsl/templates/en/form_module.bsl
@@ -6,9 +6,7 @@
#Region FormEventHandlers
// Enter code here.
-
//%CURRENT_CODE%
-
#EndRegion
#Region FormHeaderItemsEventHandlers
@@ -17,12 +15,6 @@
#EndRegion
-#Region FormTableItemsEventHandlers //
-
-// Enter code here.
-
-#EndRegion
-
#Region FormCommandsEventHandlers
// Enter code here.
diff --git a/bundles/com.e1c.v8codestyle.bsl/templates/ru/command_module.bsl b/bundles/com.e1c.v8codestyle.bsl/templates/ru/command_module.bsl
index 6fcfda8e..1be65a57 100644
--- a/bundles/com.e1c.v8codestyle.bsl/templates/ru/command_module.bsl
+++ b/bundles/com.e1c.v8codestyle.bsl/templates/ru/command_module.bsl
@@ -2,9 +2,7 @@
#Область ОбработчикиСобытий
// Код процедур и функций
-
//%CURRENT_CODE%
-
#КонецОбласти
#Область СлужебныеПроцедурыИФункции
diff --git a/bundles/com.e1c.v8codestyle.bsl/templates/ru/form_module.bsl b/bundles/com.e1c.v8codestyle.bsl/templates/ru/form_module.bsl
index ffedd000..d52a296d 100644
--- a/bundles/com.e1c.v8codestyle.bsl/templates/ru/form_module.bsl
+++ b/bundles/com.e1c.v8codestyle.bsl/templates/ru/form_module.bsl
@@ -6,9 +6,7 @@
#Область ОбработчикиСобытийФормы
// Код процедур и функций
-
//%CURRENT_CODE%
-
#КонецОбласти
#Область ОбработчикиСобытийЭлементовШапкиФормы
@@ -17,12 +15,6 @@
#КонецОбласти
-#Область ОбработчикиСобытийЭлементовТаблицыФормы //<ИмяТаблицыФормы>
-
-// Код процедур и функций
-
-#КонецОбласти
-
#Область ОбработчикиКомандФормы
// Код процедур и функций
diff --git a/bundles/com.e1c.v8codestyle.form/.classpath b/bundles/com.e1c.v8codestyle.form/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.form/.classpath
+++ b/bundles/com.e1c.v8codestyle.form/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.form/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.form/.settings/org.eclipse.jdt.core.prefs
index 34feba4d..ab5e755f 100644
--- a/bundles/com.e1c.v8codestyle.form/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.form/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.form/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.form/META-INF/MANIFEST.MF
index 39f6e067..db47e84e 100644
--- a/bundles/com.e1c.v8codestyle.form/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.form/META-INF/MANIFEST.MF
@@ -8,9 +8,9 @@ Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.20.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.23.0,3.0.0)",
org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)",
- javax.inject;bundle-version="[1.0.0,2.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)",
org.eclipse.xtext;bundle-version="[2.26.0,3.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.form
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -24,14 +24,14 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.dcs.model.settings;version="[3.2.0,4.0.0)",
com._1c.g5.v8.dt.form.model;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.form.model.util;version="[7.2.0,8.0.0)",
- com._1c.g5.v8.dt.form.service;version="[7.0.0,8.0.0)",
+ com._1c.g5.v8.dt.form.service;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.form.service.datasourceinfo;version="[3.0.0,4.0.0)",
com._1c.g5.v8.dt.mcore;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.metadata;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.metadata.dbview;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.metadata.mdclass;version="[9.0.0,10.0.0)",
com._1c.g5.v8.dt.platform.version;version="[2.14.0,3.0.0)",
- com._1c.g5.v8.dt.ql.model;version="[4.0.0,5.0.0)",
+ com._1c.g5.v8.dt.ql.model;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.ql.resource;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.ql.typesystem;version="[6.0.0,7.0.0)",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
@@ -40,10 +40,8 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com.e1c.g5.v8.dt.check.components;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.context;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.ext;version="[1.0.0,2.0.0)",
- com.e1c.g5.v8.dt.check.qfix;version="[2.0.0,3.0.0)",
+ com.e1c.g5.v8.dt.check.qfix;version="[3.0.0,4.0.0)",
com.e1c.g5.v8.dt.check.qfix.components;version="[1.0.0,2.0.0)",
- com.e1c.g5.v8.dt.check.settings;version="[3.0.0,4.0.0)",
+ com.e1c.g5.v8.dt.check.settings;version="[4.0.0,5.0.0)",
com.e1c.v8codestyle.check;version="[0.7.0,0.8.0)",
- com.google.common.base;version="[30.1.0,31.0.0)",
- com.google.inject;version="[5.0.1,6.0.0)",
- com.google.inject.binder;version="[5.0.1,6.0.0)"
+ com.google.common.base;version="[32.1.0,33.0.0)"
diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/DataCompositionConditionalAppearanceUseCheck.java b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/DataCompositionConditionalAppearanceUseCheck.java
index b7d4e51a..2f7b1fa1 100644
--- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/DataCompositionConditionalAppearanceUseCheck.java
+++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/DataCompositionConditionalAppearanceUseCheck.java
@@ -47,7 +47,6 @@ import com.google.inject.Inject;
public class DataCompositionConditionalAppearanceUseCheck
extends BasicCheck
{
-
private static final String CHECK_ID = "data-composition-conditional-appearance-use"; //$NON-NLS-1$
private final IBmModelManager bmModelManager;
@@ -78,10 +77,14 @@ public class DataCompositionConditionalAppearanceUseCheck
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.UI_STYLE)
- .extension(new StandardCheckExtension(710, getCheckId(), CorePlugin.PLUGIN_ID))
- .topObject(DATA_COMPOSITION_SETTINGS)
+ .extension(new StandardCheckExtension(710, getCheckId(), CorePlugin.PLUGIN_ID));
+
+ builder.topObject(DATA_COMPOSITION_SETTINGS)
.containment(DATA_COMPOSITION_CONDITIONAL_APPEARANCE)
.features(DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS);
+
+ builder.topObject(DATA_COMPOSITION_CONDITIONAL_APPEARANCE)
+ .features(DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS);
}
@Override
@@ -104,7 +107,6 @@ public class DataCompositionConditionalAppearanceUseCheck
}
EObject eObject = dcca;
-
DynamicListExtInfo dl = manager.getOwner(eObject, DynamicListExtInfo.class);
if (dl != null)
{
@@ -114,9 +116,8 @@ public class DataCompositionConditionalAppearanceUseCheck
return;
}
- resultAcceptor.addIssue(
- MessageFormat.format(
- Messages.DataCompositionConditionalAppearanceUseCheck_Form_attribute, formAttribute.getName()),
+ resultAcceptor.addIssue(MessageFormat
+ .format(Messages.DataCompositionConditionalAppearanceUseCheck_Form_attribute, formAttribute.getName()),
dcca, DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS);
}
@@ -128,12 +129,8 @@ public class DataCompositionConditionalAppearanceUseCheck
return;
}
- resultAcceptor.addIssue(
- MessageFormat.format(
- Messages.DataCompositionConditionalAppearanceUseCheck_Form, form.getMdForm().getName()),
- dcca, DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS);
-
+ resultAcceptor.addIssue(MessageFormat.format(Messages.DataCompositionConditionalAppearanceUseCheck_Form,
+ form.getMdForm().getName()), dcca, DATA_COMPOSITION_CONDITIONAL_APPEARANCE__ITEMS);
}
-
}
}
diff --git a/bundles/com.e1c.v8codestyle.md.ui/.classpath b/bundles/com.e1c.v8codestyle.md.ui/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.md.ui/.classpath
+++ b/bundles/com.e1c.v8codestyle.md.ui/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.md.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.md.ui/.settings/org.eclipse.jdt.core.prefs
index 0bdcd8f0..b8daa69d 100644
--- a/bundles/com.e1c.v8codestyle.md.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.md.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.md.ui/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.md.ui/META-INF/MANIFEST.MF
index 414f7611..cf27ca06 100644
--- a/bundles/com.e1c.v8codestyle.md.ui/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.md.ui/META-INF/MANIFEST.MF
@@ -13,8 +13,9 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.119.0,4.0.0)",
org.eclipse.ui.forms;bundle-version="[3.11.100,4.0.0)",
org.eclipse.emf.databinding;bundle-version="[1.5.0,2.0.0)",
org.eclipse.jface.databinding;bundle-version="[1.12.200,2.0.0)",
- org.eclipse.core.databinding.property;bundle-version="[1.8.100,2.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+ org.eclipse.core.databinding.property;bundle-version="[1.8.100,2.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.md.ui
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -27,5 +28,4 @@ Import-Package: com._1c.g5.v8.dt.common;version="[6.4.0,7.0.0)",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
com._1c.g5.wiring.binder;version="[1.1.0,2.0.0)",
com.e1c.v8codestyle.md;version="[0.7.0,0.8.0)",
- com.google.common.base;version="[30.1.0,31.0.0)",
- com.google.inject;version="[5.0.1,6.0.0)"
+ com.google.common.base;version="[32.1.0,33.0.0)"
diff --git a/bundles/com.e1c.v8codestyle.md/.classpath b/bundles/com.e1c.v8codestyle.md/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.md/.classpath
+++ b/bundles/com.e1c.v8codestyle.md/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.md/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.md/.settings/org.eclipse.jdt.core.prefs
index 34feba4d..ab5e755f 100644
--- a/bundles/com.e1c.v8codestyle.md/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.md/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.md/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.md/META-INF/MANIFEST.MF
index 7b4e807a..b6e36794 100644
--- a/bundles/com.e1c.v8codestyle.md/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.md/META-INF/MANIFEST.MF
@@ -7,8 +7,9 @@ Bundle-Activator: com.e1c.v8codestyle.internal.md.CorePlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.22.0,3.0.0)",
- org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+ org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.md
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -28,8 +29,7 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com.e1c.g5.v8.dt.check.components;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.context;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.ext;version="[1.0.0,2.0.0)",
- com.e1c.g5.v8.dt.check.settings;version="[3.0.0,4.0.0)",
+ com.e1c.g5.v8.dt.check.settings;version="[4.0.0,5.0.0)",
com.e1c.v8codestyle.check;version="[0.7.0,0.8.0)",
- com.google.common.base;version="[30.1.0,31.0.0)",
- com.google.inject;version="[5.0.1,6.0.0)"
+ com.google.common.base;version="[32.1.0,33.0.0)"
Export-Package: com.e1c.v8codestyle.md;version="0.7.0"
diff --git a/bundles/com.e1c.v8codestyle.ql/.classpath b/bundles/com.e1c.v8codestyle.ql/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.ql/.classpath
+++ b/bundles/com.e1c.v8codestyle.ql/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.ql/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.ql/.settings/org.eclipse.jdt.core.prefs
index 34feba4d..ab5e755f 100644
--- a/bundles/com.e1c.v8codestyle.ql/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.ql/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.ql/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.ql/META-INF/MANIFEST.MF
index b7f58ed2..eab44180 100644
--- a/bundles/com.e1c.v8codestyle.ql/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.ql/META-INF/MANIFEST.MF
@@ -8,8 +8,9 @@ Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.22.0,3.0.0)",
org.eclipse.xtext;bundle-version="[2.24.0,3.0.0)",
- org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+ org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.ql
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -19,7 +20,7 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.mcore;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.metadata.dbview;version="4.0.0",
com._1c.g5.v8.dt.metadata.mdclass;version="[9.0.0,10.0.0)",
- com._1c.g5.v8.dt.ql.model;version="[4.0.0,5.0.0)",
+ com._1c.g5.v8.dt.ql.model;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.ql.typesystem;version="5.0.0",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
com._1c.g5.wiring.binder;version="[1.1.0,2.0.0)",
@@ -27,5 +28,4 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com.e1c.g5.v8.dt.check.components;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.settings;version="1.0.0",
com.e1c.g5.v8.dt.ql.check;version="[1.0.0,2.0.0)",
- com.e1c.v8codestyle.check;version="[0.7.0,0.8.0)",
- com.google.inject;version="[5.0.1,6.0.0)"
+ com.e1c.v8codestyle.check;version="[0.7.0,0.8.0)"
diff --git a/bundles/com.e1c.v8codestyle.ql/src/com/e1c/v8codestyle/ql/check/TempTableHasIndex.java b/bundles/com.e1c.v8codestyle.ql/src/com/e1c/v8codestyle/ql/check/TempTableHasIndex.java
index 9f8f0d77..168c7852 100644
--- a/bundles/com.e1c.v8codestyle.ql/src/com/e1c/v8codestyle/ql/check/TempTableHasIndex.java
+++ b/bundles/com.e1c.v8codestyle.ql/src/com/e1c/v8codestyle/ql/check/TempTableHasIndex.java
@@ -82,7 +82,7 @@ public class TempTableHasIndex
return;
}
- if (selectQuery.getIndexes() == null || selectQuery.getIndexes().isEmpty())
+ if (selectQuery.getIndexSets().isEmpty())
{
AbstractQuerySchemaTable table = selectQuery.getPlacementTable();
String excludeTableNamePattern = parameters.getString(PARAMETER_EXCLUDE_TABLE_NAME_PATTERN);
diff --git a/bundles/com.e1c.v8codestyle.right/.classpath b/bundles/com.e1c.v8codestyle.right/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.right/.classpath
+++ b/bundles/com.e1c.v8codestyle.right/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.right/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.right/.settings/org.eclipse.jdt.core.prefs
index 34feba4d..ab5e755f 100644
--- a/bundles/com.e1c.v8codestyle.right/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.right/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF
index 2fa4fdff..1075fa84 100644
--- a/bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF
@@ -8,8 +8,9 @@ Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.22.0,3.0.0)",
org.eclipse.xtext;bundle-version="[2.24.0,3.0.0)",
- org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+ org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.right
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -21,10 +22,10 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.common;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.mcore;version="[7.0.0,8.0.0)",
- com._1c.g5.v8.dt.md;version="[19.0.0,20.0.0)",
+ com._1c.g5.v8.dt.md;version="[20.0.0,21.0.0)",
com._1c.g5.v8.dt.metadata.mdclass;version="[9.0.0,10.0.0)",
com._1c.g5.v8.dt.platform.version;version="[2.0.0,3.0.0)",
- com._1c.g5.v8.dt.rights;version="[6.1.0,7.0.0)",
+ com._1c.g5.v8.dt.rights;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.rights.model;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.rights.model.util;version="[6.0.0,7.0.0)",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
@@ -33,6 +34,5 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com.e1c.g5.v8.dt.check.components;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.context;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.ext;version="[1.0.0,2.0.0)",
- com.e1c.g5.v8.dt.check.settings;version="[3.0.0,4.0.0)",
- com.e1c.v8codestyle.check;version="[0.7.0,0.8.0)",
- com.google.inject;version="[5.0.1,6.0.0)"
+ com.e1c.g5.v8.dt.check.settings;version="[4.0.0,5.0.0)",
+ com.e1c.v8codestyle.check;version="[0.7.0,0.8.0)"
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/CorePlugin.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/CorePlugin.java
index 73fd579d..c7244833 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/CorePlugin.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/CorePlugin.java
@@ -153,7 +153,7 @@ public class CorePlugin
{
try
{
- return Guice.createInjector(new ServiceModule(), new ExternalDependenciesModule(this));
+ return Guice.createInjector(new ExternalDependenciesModule(this));
}
catch (Exception e)
{
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/ExternalDependenciesModule.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/ExternalDependenciesModule.java
index fd1dbdb1..6b8f789a 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/ExternalDependenciesModule.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/ExternalDependenciesModule.java
@@ -20,7 +20,7 @@ import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IConfigurationProvider;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
-import com._1c.g5.v8.dt.platform.version.IRuntimeVersionSupport;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.wiring.AbstractServiceAwareModule;
/**
@@ -32,7 +32,6 @@ import com._1c.g5.wiring.AbstractServiceAwareModule;
public class ExternalDependenciesModule
extends AbstractServiceAwareModule
{
-
/**
* @param plugin
*/
@@ -50,9 +49,6 @@ public class ExternalDependenciesModule
bind(IBmRightsIndexManager.class).toService();
bind(IBmEmfIndexManager.class).toService();
bind(IConfigurationProvider.class).toService();
-
- // XXX remove this when the IRightInfosService become OSGi service
- bind(IRuntimeVersionSupport.class).toService();
+ bind(IRightInfosService.class).toService();
}
-
}
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/InternalRightInfosService.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/InternalRightInfosService.java
deleted file mode 100644
index e0a868fd..00000000
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/InternalRightInfosService.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2022, 1C-Soft LLC and others.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * 1C-Soft LLC - initial API and implementation
- *******************************************************************************/
-package com.e1c.v8codestyle.internal.right;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-import com._1c.g5.v8.dt.core.platform.IConfigurationProvider;
-import com._1c.g5.v8.dt.metadata.mdclass.Configuration;
-import com._1c.g5.v8.dt.platform.version.IRuntimeVersionSupport;
-import com._1c.g5.v8.dt.platform.version.Version;
-import com._1c.g5.v8.dt.rights.IRightInfosService;
-import com._1c.g5.v8.dt.rights.model.Right;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
-/**
- * This service is a correct wrapper of {@link IRightInfosService} to get correct data corresponding
- * project runtime version.
- *
- * FIXME Replace this service after refactoring of {@link IRightInfosService}.
- *
- * @author Dmitriy Marmyshev
- */
-@Singleton
-public class InternalRightInfosService
-{
-
- private final IRuntimeVersionSupport runtimeVersionSupport;
-
- private final IConfigurationProvider configurationProvider;
-
- private final Provider rightInfosServiceProvider;
-
- private final Map infos = new ConcurrentHashMap<>();
-
- @Inject
- public InternalRightInfosService(IRuntimeVersionSupport runtimeVersionSupport,
- IConfigurationProvider configurationProvider, Provider rightInfosServiceProvider)
- {
- this.runtimeVersionSupport = runtimeVersionSupport;
- this.configurationProvider = configurationProvider;
- this.rightInfosServiceProvider = rightInfosServiceProvider;
- }
-
- /**
- * Gets the rights of some {@link EClass} of configuration metadata object that may have some rights.
- *
- * @param eClass the {@link EClass} of configuration metadata object that has some rights, cannot be {@code null}.
- * @param context the context object of the configuration to determine platform version, cannot be {@code null}.
- * @return the rights of the {@link EClass}
- */
- public Set getEClassRights(EClass eClass, EObject context)
- {
-
- Version version = runtimeVersionSupport.getRuntimeVersionOrDefault(context, Version.LATEST);
-
- IRightInfosService info = infos.computeIfAbsent(version, v -> {
-
- IRightInfosService service = rightInfosServiceProvider.get();
- Configuration configuration = configurationProvider.getConfiguration(context);
- service.init(configuration);
-
- return service;
- });
-
- if (info == null)
- {
- return Collections.emptySet();
- }
- return info.getEClassRights(eClass);
- }
-}
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/ServiceModule.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/ServiceModule.java
deleted file mode 100644
index ac862a49..00000000
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/ServiceModule.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2022, 1C-Soft LLC and others.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * 1C-Soft LLC - initial API and implementation
- *******************************************************************************/
-package com.e1c.v8codestyle.internal.right;
-
-import com._1c.g5.v8.dt.rights.IRightInfosService;
-import com.google.inject.AbstractModule;
-
-/**
- * The internal service module.
- *
- * @author Dmitriy Marmyshev
- */
-public class ServiceModule
- extends AbstractModule
-{
- private static final String SERVICE_CLASS = "com._1c.g5.v8.dt.internal.rights.RightsInfoService"; //$NON-NLS-1$
-
- @SuppressWarnings("unchecked")
- @Override
- protected void configure()
- {
-
- // XXX remove this when the IRightInfosService become OSGi service
- Class extends IRightInfosService> clazz = null;
- try
- {
- clazz = (Class extends IRightInfosService>)Class.forName(SERVICE_CLASS, true,
- IRightInfosService.class.getClassLoader());
- }
- catch (ClassNotFoundException e)
- {
- CorePlugin.logError(e);
- }
- // Here create new instance every time - this allows to bind it to specific platform Version
- // See com.e1c.v8codestyle.internal.right.InternalRightInfosService for details.
- bind(IRightInfosService.class).to(clazz);
- }
-}
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightActiveUsers.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightActiveUsers.java
index a4a93e5c..d031319f 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightActiveUsers.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightActiveUsers.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightActiveUsers
@Inject
public RightActiveUsers(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightAdministration.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightAdministration.java
index 818d1d79..0f12234d 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightAdministration.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightAdministration.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightAdministration
@Inject
public RightAdministration(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightAllFunctionsMode.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightAllFunctionsMode.java
index cd6af47a..a2fec74a 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightAllFunctionsMode.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightAllFunctionsMode.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightAllFunctionsMode
@Inject
public RightAllFunctionsMode(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightConfigurationExtensionsAdministration.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightConfigurationExtensionsAdministration.java
index 89d09e10..e61610f4 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightConfigurationExtensionsAdministration.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightConfigurationExtensionsAdministration.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightConfigurationExtensionsAdministration
@Inject
public RightConfigurationExtensionsAdministration(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightDataAdministration.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightDataAdministration.java
index c7ff51d6..25ed14fa 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightDataAdministration.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightDataAdministration.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightDataAdministration
@Inject
public RightDataAdministration(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightDelete.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightDelete.java
index fdadb08f..4a504c28 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightDelete.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightDelete.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightDelete
@Inject
public RightDelete(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightExclusiveMode.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightExclusiveMode.java
index 7bc8dfd9..44cad901 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightExclusiveMode.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightExclusiveMode.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -48,7 +48,7 @@ public class RightExclusiveMode
@Inject
public RightExclusiveMode(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveClearDeletionMarkPredefinedData.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveClearDeletionMarkPredefinedData.java
index c049b594..9150f190 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveClearDeletionMarkPredefinedData.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveClearDeletionMarkPredefinedData.java
@@ -18,10 +18,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -42,7 +42,7 @@ public class RightInteractiveClearDeletionMarkPredefinedData
@Inject
public RightInteractiveClearDeletionMarkPredefinedData(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDelete.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDelete.java
index cb2845d0..f19c33cb 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDelete.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDelete.java
@@ -18,10 +18,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -42,7 +42,7 @@ public class RightInteractiveDelete
@Inject
public RightInteractiveDelete(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDeleteMarkedPredefinedData.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDeleteMarkedPredefinedData.java
index 3f74aa98..e8de2f47 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDeleteMarkedPredefinedData.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDeleteMarkedPredefinedData.java
@@ -18,10 +18,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -42,7 +42,7 @@ public class RightInteractiveDeleteMarkedPredefinedData
@Inject
public RightInteractiveDeleteMarkedPredefinedData(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDeletePredefinedData.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDeletePredefinedData.java
index e8171f71..dfe22f27 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDeletePredefinedData.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveDeletePredefinedData.java
@@ -18,10 +18,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -42,7 +42,7 @@ public class RightInteractiveDeletePredefinedData
@Inject
public RightInteractiveDeletePredefinedData(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveOpenExternalDataProcessors.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveOpenExternalDataProcessors.java
index 96e5bb35..d1734a8a 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveOpenExternalDataProcessors.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveOpenExternalDataProcessors.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightInteractiveOpenExternalDataProcessors
@Inject
public RightInteractiveOpenExternalDataProcessors(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveOpenExternalReports.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveOpenExternalReports.java
index 5134b102..ebefd85a 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveOpenExternalReports.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveOpenExternalReports.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightInteractiveOpenExternalReports
@Inject
public RightInteractiveOpenExternalReports(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveSetDeletionMarkPredefinedData.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveSetDeletionMarkPredefinedData.java
index d3758db0..bdd50766 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveSetDeletionMarkPredefinedData.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightInteractiveSetDeletionMarkPredefinedData.java
@@ -18,10 +18,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -42,7 +42,7 @@ public class RightInteractiveSetDeletionMarkPredefinedData
@Inject
public RightInteractiveSetDeletionMarkPredefinedData(IResourceLookup resourceLookup,
IV8ProjectManager v8ProjectManager, IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightOutputToPrinterFileClipboard.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightOutputToPrinterFileClipboard.java
index 4982be37..16572c7d 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightOutputToPrinterFileClipboard.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightOutputToPrinterFileClipboard.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightOutputToPrinterFileClipboard
@Inject
public RightOutputToPrinterFileClipboard(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightSaveUserData.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightSaveUserData.java
index 77fecc0f..3f09e31d 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightSaveUserData.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightSaveUserData.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightSaveUserData
@Inject
public RightSaveUserData(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartAutomation.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartAutomation.java
index ca5611f9..aaeafb45 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartAutomation.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartAutomation.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightStartAutomation
@Inject
public RightStartAutomation(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartExternalConnection.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartExternalConnection.java
index 3f6fb2ed..b9869d40 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartExternalConnection.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartExternalConnection.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightStartExternalConnection
@Inject
public RightStartExternalConnection(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartThickClient.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartThickClient.java
index 9ba98675..2ebb6e94 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartThickClient.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartThickClient.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightStartThickClient
@Inject
public RightStartThickClient(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartThinClient.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartThinClient.java
index 6277674f..90663066 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartThinClient.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartThinClient.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightStartThinClient
@Inject
public RightStartThinClient(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartWebClient.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartWebClient.java
index cbbda02d..c3a82e25 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartWebClient.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightStartWebClient.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightStartWebClient
@Inject
public RightStartWebClient(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightUpdateDatabaseConfiguration.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightUpdateDatabaseConfiguration.java
index 597d4b0c..1201bb33 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightUpdateDatabaseConfiguration.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightUpdateDatabaseConfiguration.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -46,7 +46,7 @@ public class RightUpdateDatabaseConfiguration
@Inject
public RightUpdateDatabaseConfiguration(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
rightInfosService);
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightViewEventLog.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightViewEventLog.java
index 10ccc3cd..6c0da573 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightViewEventLog.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RightViewEventLog.java
@@ -19,10 +19,10 @@ import com._1c.g5.v8.dt.bm.index.rights.IBmRightsIndexManager;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.util.RightName;
import com.e1c.v8codestyle.check.StandardCheckExtension;
import com.e1c.v8codestyle.internal.right.CorePlugin;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
import com.google.inject.Inject;
/**
@@ -49,7 +49,7 @@ public class RightViewEventLog
@Inject
public RightViewEventLog(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService,
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService,
IBmModelManager bmModelManager2)
{
super(resourceLookup, v8ProjectManager, bmModelManager, bmRightsIndexManager, bmEmfIndexManager,
diff --git a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RoleRightSetCheck.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RoleRightSetCheck.java
index 275425e3..831d678f 100644
--- a/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RoleRightSetCheck.java
+++ b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RoleRightSetCheck.java
@@ -40,6 +40,7 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.xtext.naming.QualifiedName;
import org.eclipse.xtext.resource.IEObjectDescription;
import com._1c.g5.v8.bm.core.BmUriUtil;
@@ -61,6 +62,7 @@ import com._1c.g5.v8.dt.md.MdUtil;
import com._1c.g5.v8.dt.metadata.mdclass.MdObject;
import com._1c.g5.v8.dt.metadata.mdclass.Role;
import com._1c.g5.v8.dt.metadata.mdclass.ScriptVariant;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.rights.model.ObjectRight;
import com._1c.g5.v8.dt.rights.model.ObjectRights;
import com._1c.g5.v8.dt.rights.model.Right;
@@ -78,7 +80,6 @@ import com.e1c.g5.v8.dt.check.context.OnModelObjectAssociationContextCollector;
import com.e1c.g5.v8.dt.check.context.OnModelObjectRemovalContextCollector;
import com.e1c.g5.v8.dt.check.settings.IssueSeverity;
import com.e1c.g5.v8.dt.check.settings.IssueType;
-import com.e1c.v8codestyle.internal.right.InternalRightInfosService;
/**
* Abstract check that role has some right for any object.
@@ -114,7 +115,7 @@ public abstract class RoleRightSetCheck
private final IBmEmfIndexManager bmEmfIndexManager;
- private final InternalRightInfosService rightInfosService;
+ private final IRightInfosService rightInfosService;
/**
* Creates new instance which helps to check that role has specified right for an object.
@@ -127,7 +128,7 @@ public abstract class RoleRightSetCheck
*/
protected RoleRightSetCheck(IResourceLookup resourceLookup, IV8ProjectManager v8ProjectManager,
IBmModelManager bmModelManager, IBmRightsIndexManager bmRightsIndexManager,
- IBmEmfIndexManager bmEmfIndexManager, InternalRightInfosService rightInfosService)
+ IBmEmfIndexManager bmEmfIndexManager, IRightInfosService rightInfosService)
{
this.resourceLookup = resourceLookup;
this.v8ProjectManager = v8ProjectManager;
@@ -319,17 +320,27 @@ public abstract class RoleRightSetCheck
private String getMdObjectName(MdObject mdObject, IV8Project project)
{
- if (mdObject == null)
+ if (mdObject == null || project == null)
{
return "Unknown"; //$NON-NLS-1$
}
- if (project != null && project.getScriptVariant() == ScriptVariant.RUSSIAN)
+ if (project.getScriptVariant() == ScriptVariant.RUSSIAN)
{
- return MdUtil.getFullyQualifiedNameRu(mdObject).toString();
+ QualifiedName fqn = MdUtil.getFullyQualifiedNameRu(mdObject);
+ if (fqn != null)
+ {
+ return fqn.toString();
+ }
}
- return MdUtil.getFullyQualifiedName(mdObject).toString();
+ QualifiedName fqn = MdUtil.getFullyQualifiedName(mdObject);
+ if (fqn != null)
+ {
+ return fqn.toString();
+ }
+
+ return "Unknown"; //$NON-NLS-1$
}
private Collection getDefaultObjectsWithRight(RoleDescription description, IProgressMonitor monitor)
@@ -413,7 +424,7 @@ public abstract class RoleRightSetCheck
private boolean hasRight(EClass eClass, EObject context)
{
- Set rights = rightInfosService.getEClassRights(eClass, context);
+ Set rights = rightInfosService.getEClassRights(context, eClass);
Set rightNames = rights.stream().map(NamedElement::getName).collect(Collectors.toSet());
return rightNames.contains(getRightName().getName());
}
diff --git a/bundles/com.e1c.v8codestyle.ui/.classpath b/bundles/com.e1c.v8codestyle.ui/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle.ui/.classpath
+++ b/bundles/com.e1c.v8codestyle.ui/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle.ui/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle.ui/.settings/org.eclipse.jdt.core.prefs
index 34feba4d..ab5e755f 100644
--- a/bundles/com.e1c.v8codestyle.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle.ui/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle.ui/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.ui/META-INF/MANIFEST.MF
index f611897e..55ada2c8 100644
--- a/bundles/com.e1c.v8codestyle.ui/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle.ui/META-INF/MANIFEST.MF
@@ -13,8 +13,9 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.119.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.23.0,3.0.0)",
org.eclipse.jface.databinding;bundle-version="[1.12.200,2.0.0)",
org.eclipse.ui.forms;bundle-version="[3.11.100,4.0.0)",
- org.eclipse.emf.databinding;bundle-version="[1.5.0,2.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+ org.eclipse.emf.databinding;bundle-version="[1.5.0,2.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle.ui
Bundle-ActivationPolicy: lazy
Import-Package: com._1c.g5.v8.dt.common;version="[6.4.0,7.0.0)",
@@ -22,5 +23,4 @@ Import-Package: com._1c.g5.v8.dt.common;version="[6.4.0,7.0.0)",
com._1c.g5.v8.dt.ui.wizards;version="[8.1.0,9.0.0)",
com._1c.g5.wiring;version="[2.2.0,3.0.0)",
com._1c.g5.wiring.binder;version="[1.1.0,2.0.0)",
- com.e1c.v8codestyle;version="[0.7.0,0.8.0)",
- com.google.inject;version="[5.0.1,6.0.0)"
+ com.e1c.v8codestyle;version="[0.7.0,0.8.0)"
diff --git a/bundles/com.e1c.v8codestyle/.classpath b/bundles/com.e1c.v8codestyle/.classpath
index e801ebfb..81fe078c 100644
--- a/bundles/com.e1c.v8codestyle/.classpath
+++ b/bundles/com.e1c.v8codestyle/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/bundles/com.e1c.v8codestyle/.settings/org.eclipse.jdt.core.prefs b/bundles/com.e1c.v8codestyle/.settings/org.eclipse.jdt.core.prefs
index 64d1838c..6d3ed858 100644
--- a/bundles/com.e1c.v8codestyle/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/com.e1c.v8codestyle/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/bundles/com.e1c.v8codestyle/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle/META-INF/MANIFEST.MF
index 4bdb3233..8f333a91 100644
--- a/bundles/com.e1c.v8codestyle/META-INF/MANIFEST.MF
+++ b/bundles/com.e1c.v8codestyle/META-INF/MANIFEST.MF
@@ -7,8 +7,9 @@ Bundle-Activator: com.e1c.v8codestyle.internal.CorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.18.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+ org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)",
+ com.google.inject;bundle-version="[7.0.0,8.0.0)"
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: com.e1c.v8codestyle
Bundle-ActivationPolicy: lazy
Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
@@ -18,8 +19,6 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com.e1c.g5.v8.dt.check;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.components;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.ext;version="1.0.0",
- com.e1c.g5.v8.dt.check.settings;version="1.0.0",
- com.google.inject;version="[5.0.1,6.0.0)",
- com.google.inject.binder;version="[5.0.1,6.0.0)"
+ com.e1c.g5.v8.dt.check.settings;version="1.0.0"
Export-Package: com.e1c.v8codestyle;version="0.7.0",
com.e1c.v8codestyle.check;version="0.7.0"
diff --git a/bundles/com.e1c.v8codestyle/plugin.launch b/bundles/com.e1c.v8codestyle/plugin.launch
index 6242cf77..f65c1e15 100644
--- a/bundles/com.e1c.v8codestyle/plugin.launch
+++ b/bundles/com.e1c.v8codestyle/plugin.launch
@@ -20,7 +20,7 @@
-
+
diff --git a/docs/.classpath b/docs/.classpath
index 7ffd68b6..a730c5d7 100644
--- a/docs/.classpath
+++ b/docs/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/docs/.settings/org.eclipse.jdt.core.prefs b/docs/.settings/org.eclipse.jdt.core.prefs
index f2525a8b..8c9943d5 100644
--- a/docs/.settings/org.eclipse.jdt.core.prefs
+++ b/docs/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -11,4 +11,4 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/docs/META-INF/MANIFEST.MF b/docs/META-INF/MANIFEST.MF
index e3b82119..572239f8 100644
--- a/docs/META-INF/MANIFEST.MF
+++ b/docs/META-INF/MANIFEST.MF
@@ -5,5 +5,5 @@ Bundle-SymbolicName: com.e1c.v8codestyle.docs;singleton:=true
Bundle-Version: 0.7.0.qualifier
Bundle-Vendor: %providerName
Automatic-Module-Name: com.e1c.v8codestyle.docs
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: plugin
diff --git a/pom.xml b/pom.xml
index 910fb539..f0d2af22 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,9 +58,14 @@
eclipse-plugin
- org.eclipse.equinox.ds
+ org.apache.felix.scr
0.0.0
+
+ eclipse-plugin
+ org.apache.aries.spifly.dynamic.bundle
+ 1.3.7
+
@@ -68,5 +73,4 @@
-
diff --git a/targets/default/default.target b/targets/default/default.target
index 8e142fa4..10372a85 100644
--- a/targets/default/default.target
+++ b/targets/default/default.target
@@ -13,102 +13,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -122,14 +35,19 @@
-
+
-
-
+
+
+
+
+
+
+
diff --git a/targets/develop/develop.target b/targets/develop/develop.target
index d2ce2ca2..a015411f 100644
--- a/targets/develop/develop.target
+++ b/targets/develop/develop.target
@@ -13,7 +13,7 @@
-
+
@@ -80,7 +80,7 @@
-
+
@@ -96,6 +96,7 @@
+
@@ -149,7 +150,34 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/.classpath b/tests/com.e1c.v8codestyle.autosort.itests/.classpath
index e801ebfb..81fe078c 100644
--- a/tests/com.e1c.v8codestyle.autosort.itests/.classpath
+++ b/tests/com.e1c.v8codestyle.autosort.itests/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/.settings/org.eclipse.jdt.core.prefs b/tests/com.e1c.v8codestyle.autosort.itests/.settings/org.eclipse.jdt.core.prefs
index 65d12a17..2c8550f4 100644
--- a/tests/com.e1c.v8codestyle.autosort.itests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/com.e1c.v8codestyle.autosort.itests/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.autosort.itests/META-INF/MANIFEST.MF
index 050d2b4e..4a8ab0f1 100644
--- a/tests/com.e1c.v8codestyle.autosort.itests/META-INF/MANIFEST.MF
+++ b/tests/com.e1c.v8codestyle.autosort.itests/META-INF/MANIFEST.MF
@@ -6,8 +6,9 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Vendor: %providerName
Fragment-Host: com.e1c.v8codestyle.autosort;bundle-version="[0.7.0,0.8.0)"
Automatic-Module-Name: com.e1c.v8codestyle.autosort.itests
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment
-Import-Package: com._1c.g5.v8.dt.testing;version="[3.1.0,4.0.0)",
+Import-Package: com._1c.g5.v8.dt.platform.version;version="[2.14.0,3.0.0)",
+ com._1c.g5.v8.dt.testing;version="[3.1.0,4.0.0)",
org.junit;version="[4.13.0,5.0.0)",
org.junit.runner;version="[4.13.0,5.0.0)"
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/src/com/e1c/v8codestyle/autosort/itests/SortSubsystemsTest.java b/tests/com.e1c.v8codestyle.autosort.itests/src/com/e1c/v8codestyle/autosort/itests/SortSubsystemsTest.java
new file mode 100644
index 00000000..aed3e4d4
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/src/com/e1c/v8codestyle/autosort/itests/SortSubsystemsTest.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (C) 2024, 1C-Soft LLC and others.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * 1C-Soft LLC - initial API and implementation
+ *******************************************************************************/
+package com.e1c.v8codestyle.autosort.itests;
+
+import static com._1c.g5.v8.dt.metadata.mdclass.MdClassPackage.Literals.CONFIGURATION;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com._1c.g5.v8.bm.core.IBmObject;
+import com._1c.g5.v8.bm.core.IBmTransaction;
+import com._1c.g5.v8.bm.integration.AbstractBmTask;
+import com._1c.g5.v8.bm.integration.IBmModel;
+import com._1c.g5.v8.dt.core.platform.IBmModelManager;
+import com._1c.g5.v8.dt.core.platform.IDtProject;
+import com._1c.g5.v8.dt.core.platform.IDtProjectManager;
+import com._1c.g5.v8.dt.metadata.mdclass.Configuration;
+import com._1c.g5.v8.dt.platform.version.Version;
+import com._1c.g5.v8.dt.testing.GuiceModules;
+import com._1c.g5.v8.dt.testing.JUnitGuiceRunner;
+import com._1c.g5.v8.dt.testing.TestingPlatformSupport;
+import com._1c.g5.v8.dt.testing.TestingWorkspace;
+import com.e1c.v8codestyle.autosort.ISortService;
+import com.google.inject.Inject;
+
+/**
+ * Test ensuring subsystems are sorted properly when top metadata sorting enabled.
+ *
+ * @author Tihon Tihonin
+ */
+@RunWith(JUnitGuiceRunner.class)
+@GuiceModules(modules = { ExternalDependenciesModule.class })
+public class SortSubsystemsTest
+{
+ private static final String PROJECT_NAME = "SubsystemsAutoSort";
+
+ @Rule
+ public TestingWorkspace testingWorkspace = new TestingWorkspace(true, true);
+
+ @ClassRule
+ public static final TestingPlatformSupport testingPlatformSupport = new TestingPlatformSupport(Version.V8_3_19);
+
+ @Inject
+ private ISortService sortService;
+
+ @Inject
+ public IDtProjectManager dtProjectManager;
+
+ @Inject
+ public IBmModelManager bmModelManager;
+
+ @Test
+ public void testSortSubsystems() throws Exception
+ {
+ IProject project = testingWorkspace.setUpProject(PROJECT_NAME, getClass());
+ assertNotNull(project);
+ IDtProject dtProject = dtProjectManager.getDtProject(project);
+ assertNotNull(dtProject);
+
+ IBmObject object = getTopObjectByFqn(CONFIGURATION.getName(), dtProject);
+ Configuration configuration = (Configuration)object;
+
+ assertEquals("Subsystem2", configuration.getSubsystems().get(0).getSubsystems().get(0).getName());
+ assertEquals("Subsystem1", configuration.getSubsystems().get(0).getSubsystems().get(1).getName());
+
+ sortService.sortAllMetadata(dtProject, new NullProgressMonitor());
+
+ assertEquals("Subsystem1", configuration.getSubsystems().get(0).getSubsystems().get(0).getName());
+ assertEquals("Subsystem2", configuration.getSubsystems().get(0).getSubsystems().get(1).getName());
+ }
+
+ protected IBmObject getTopObjectByFqn(final String fqn, IDtProject dtProject)
+ {
+ IBmModel model = bmModelManager.getModel(dtProject);
+ return model.executeReadonlyTask(new AbstractBmTask("GetObject")
+ {
+ @Override
+ public IBmObject execute(IBmTransaction transaction, IProgressMonitor progressMonitor)
+ {
+ return transaction.getTopObjectByFqn(fqn);
+ }
+ });
+ }
+}
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.project b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.project
new file mode 100644
index 00000000..a04e0788
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.project
@@ -0,0 +1,18 @@
+
+
+ SubsystemsAutoSort
+
+
+
+
+
+ org.eclipse.xtext.ui.shared.xtextBuilder
+
+
+
+
+
+ org.eclipse.xtext.ui.shared.xtextNature
+ com._1c.g5.v8.dt.core.V8ConfigurationNature
+
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/com.e1c.v8codestyle.autosort.prefs b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/com.e1c.v8codestyle.autosort.prefs
new file mode 100644
index 00000000..23b06250
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/com.e1c.v8codestyle.autosort.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+topObjects=true
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/com.e1c.v8codestyle.prefs b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/com.e1c.v8codestyle.prefs
new file mode 100644
index 00000000..9e9b57e5
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/com.e1c.v8codestyle.prefs
@@ -0,0 +1,3 @@
+commonChecks=true
+eclipse.preferences.version=1
+standardChecks=true
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/org.eclipse.core.resources.prefs b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000..99f26c02
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/=UTF-8
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/DT-INF/PROJECT.PMF b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/DT-INF/PROJECT.PMF
new file mode 100644
index 00000000..6835f1cd
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/DT-INF/PROJECT.PMF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Runtime-Version: 8.3.19
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/CommandInterface.cmi b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/CommandInterface.cmi
new file mode 100644
index 00000000..0cf6de8a
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/CommandInterface.cmi
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/Configuration.mdo b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/Configuration.mdo
new file mode 100644
index 00000000..01bbe7a3
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/Configuration.mdo
@@ -0,0 +1,42 @@
+
+
+ SubsystemsAutoSort
+
+ en
+ Subsystems auto sort
+
+
+
+
+
+
+
+
+ 8.3.19
+ ManagedApplication
+ PersonalComputer
+
+
+
+
+
+ OSBackup
+
+
+
+ Language.English
+ Managed
+ NotAutoFree
+ DontUse
+ DontUse
+ 8.3.19
+
+ English
+
+ en
+ English
+
+ en
+
+ Subsystem.Subsystem
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/MainSectionCommandInterface.cmi b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/MainSectionCommandInterface.cmi
new file mode 100644
index 00000000..0cf6de8a
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Configuration/MainSectionCommandInterface.cmi
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/CommandInterface.cmi b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/CommandInterface.cmi
new file mode 100644
index 00000000..0cf6de8a
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/CommandInterface.cmi
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystem.mdo b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystem.mdo
new file mode 100644
index 00000000..5e4e5d0e
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystem.mdo
@@ -0,0 +1,12 @@
+
+
+ Subsystem
+
+ en
+ Subsystem
+
+ true
+ true
+ Subsystem2
+ Subsystem1
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem1/CommandInterface.cmi b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem1/CommandInterface.cmi
new file mode 100644
index 00000000..0cf6de8a
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem1/CommandInterface.cmi
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem1/Subsystem1.mdo b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem1/Subsystem1.mdo
new file mode 100644
index 00000000..3c0a817d
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem1/Subsystem1.mdo
@@ -0,0 +1,11 @@
+
+
+ Subsystem1
+
+ en
+ Subsystem1
+
+ true
+ true
+ Subsystem.Subsystem
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem2/CommandInterface.cmi b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem2/CommandInterface.cmi
new file mode 100644
index 00000000..0cf6de8a
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem2/CommandInterface.cmi
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem2/Subsystem2.mdo b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem2/Subsystem2.mdo
new file mode 100644
index 00000000..f68805aa
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.autosort.itests/workspace/SubsystemsAutoSort/src/Subsystems/Subsystem/Subsystems/Subsystem2/Subsystem2.mdo
@@ -0,0 +1,11 @@
+
+
+ Subsystem2
+
+ en
+ Subsystem2
+
+ true
+ true
+ Subsystem.Subsystem
+
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/.classpath b/tests/com.e1c.v8codestyle.bsl.itests/.classpath
index e801ebfb..81fe078c 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/.classpath
+++ b/tests/com.e1c.v8codestyle.bsl.itests/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/.settings/org.eclipse.jdt.core.prefs b/tests/com.e1c.v8codestyle.bsl.itests/.settings/org.eclipse.jdt.core.prefs
index 0249a552..a1bbcc4c 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/com.e1c.v8codestyle.bsl.itests/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.bsl.itests/META-INF/MANIFEST.MF
index a82d354b..171cc967 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/META-INF/MANIFEST.MF
+++ b/tests/com.e1c.v8codestyle.bsl.itests/META-INF/MANIFEST.MF
@@ -6,15 +6,13 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Vendor: %providerName
Fragment-Host: com.e1c.v8codestyle.bsl;bundle-version="[0.7.0,0.8.0)"
Automatic-Module-Name: com.e1c.v8codestyle.md.itests
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment
Import-Package: com._1c.g5.v8.dt.core.naming;version="[7.0.0,8.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.0.0,12.0.0)",
com._1c.g5.v8.dt.md.naming;version="[5.1.0,6.0.0)",
com._1c.g5.v8.dt.testing;version="[3.1.0,4.0.0)",
- com._1c.g5.v8.dt.ui.util;version="[7.0.0,8.0.0)",
- com._1c.g5.v8.dt.ui.validation;version="[5.0.0,6.0.0)",
- com._1c.g5.v8.dt.validation.marker;version="[7.0.0,8.0.0)",
+ com._1c.g5.v8.dt.validation.marker;version="[9.0.0,10.0.0)",
com.e1c.g5.v8.dt.testing.check;version="[1.0.0,2.0.0)",
org.junit;version="[4.13.0,5.0.0)"
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/RedundantExportMethodCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/RedundantExportMethodCheckTest.java
index 7e4c2868..50f204ad 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/RedundantExportMethodCheckTest.java
+++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/RedundantExportMethodCheckTest.java
@@ -18,6 +18,7 @@ import java.util.List;
import java.util.stream.Collectors;
import org.eclipse.core.runtime.Path;
+import org.junit.Ignore;
import org.junit.Test;
import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
@@ -68,6 +69,7 @@ public class RedundantExportMethodCheckTest
}
@Test
+ @Ignore
public void testCallNoPublic() throws Exception
{
List markers = getMarkers(MODULE_CALL_NO_PUBLIC_FILE_NAME);
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/SelfReferenceCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/SelfReferenceCheckTest.java
index 924852c6..6a511c89 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/SelfReferenceCheckTest.java
+++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/SelfReferenceCheckTest.java
@@ -72,10 +72,10 @@ public class SelfReferenceCheckTest
List markers = getMarkers(COMMON_MODULE_FILE_NAME);
assertEquals(4, markers.size());
- assertEquals("6", markers.get(0).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
- assertEquals("6", markers.get(1).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
- assertEquals("10", markers.get(2).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
- assertEquals("10", markers.get(3).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
+ assertEquals("6", markers.get(2).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
+ assertEquals("6", markers.get(3).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
+ assertEquals("10", markers.get(0).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
+ assertEquals("10", markers.get(1).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
}
/**
@@ -150,6 +150,9 @@ public class SelfReferenceCheckTest
assertNotNull(chekcId);
return markers.stream()
.filter(marker -> chekcId.equals(getCheckIdFromMarker(marker, getProject())))
+ .sorted((marker1, marker2) -> marker1.getExtraInfo()
+ .get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY)
+ .compareTo(marker2.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY)))
.collect(Collectors.toList());
}
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/ServerExecutionSafeModeCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/ServerExecutionSafeModeCheckTest.java
index d834a122..85637ee6 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/ServerExecutionSafeModeCheckTest.java
+++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/ServerExecutionSafeModeCheckTest.java
@@ -19,6 +19,7 @@ import java.util.List;
import java.util.stream.Collectors;
import org.eclipse.core.runtime.Path;
+import org.junit.Ignore;
import org.junit.Test;
import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
@@ -73,6 +74,7 @@ public class ServerExecutionSafeModeCheckTest
* @throws Exception
*/
@Test
+ @Ignore("https://github.com/1C-Company/v8-code-style/issues/1377")
public void testCommonModuleServerCall() throws Exception
{
List markers = getMarkers(COMMON_MODULE_SERVER_CALL_FILE_NAME);
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/ExportProcedureCommentDescriptionCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/ExportProcedureCommentDescriptionCheckTest.java
index 9a99484a..f17bce19 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/ExportProcedureCommentDescriptionCheckTest.java
+++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/ExportProcedureCommentDescriptionCheckTest.java
@@ -18,6 +18,7 @@ import static org.junit.Assert.assertTrue;
import java.text.MessageFormat;
import java.util.List;
+import org.junit.Ignore;
import org.junit.Test;
import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
@@ -62,6 +63,7 @@ public class ExportProcedureCommentDescriptionCheckTest
* @throws Exception the exception
*/
@Test
+ @Ignore("https://github.com/1C-Company/v8-code-style/issues/1377")
public void testFunctionHasNoDescriptionSection() throws Exception
{
updateModule(FOLDER_RESOURCE + "doc-comment-export-function-no-description-section.bsl");
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/RefLinkPartCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/RefLinkPartCheckTest.java
index a3f13ba1..39d30fe5 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/RefLinkPartCheckTest.java
+++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/comment/check/itests/RefLinkPartCheckTest.java
@@ -18,6 +18,7 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
+import org.junit.Ignore;
import org.junit.Test;
import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys;
@@ -66,6 +67,7 @@ public class RefLinkPartCheckTest
* @throws Exception the exception
*/
@Test
+ @Ignore("https://github.com/1C-Company/v8-code-style/issues/1376")
public void testInvalidLinks() throws Exception
{
updateModule(FOLDER_RESOURCE + "doc-comment-ref-link.bsl");
diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/fix/itests/ConsecutiveEmptyLinesFixTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/fix/itests/ConsecutiveEmptyLinesFixTest.java
index 78528cdf..e9b5e0da 100644
--- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/fix/itests/ConsecutiveEmptyLinesFixTest.java
+++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/fix/itests/ConsecutiveEmptyLinesFixTest.java
@@ -16,14 +16,8 @@ import org.junit.Ignore;
import org.junit.Test;
import com._1c.g5.v8.bm.core.IBmObject;
-import com._1c.g5.v8.dt.core.naming.ISymbolicLinkLocalizer;
import com._1c.g5.v8.dt.core.platform.IDtProject;
-import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
-import com._1c.g5.v8.dt.md.naming.MdSymbolicLinkLocalizer;
import com._1c.g5.v8.dt.metadata.mdclass.CommonModule;
-import com._1c.g5.v8.dt.ui.util.OpenHelper;
-import com._1c.g5.v8.dt.ui.validation.BmMarkerWrapper;
-import com._1c.g5.v8.dt.validation.marker.IMarkerWrapper;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com._1c.g5.wiring.ServiceAccess;
import com.e1c.g5.v8.dt.check.qfix.FixProcessHandle;
@@ -47,9 +41,6 @@ public class ConsecutiveEmptyLinesFixTest
private static final String DESCRIPTION = "Clear extra empty lines";
private static final String COMMON_MODULE_FILE_NAME = "/src/CommonModules/CommonModule/Module.bsl";
private IFixManager fixManager = ServiceAccess.get(IFixManager.class);
- private IV8ProjectManager projectManager = ServiceAccess.get(IV8ProjectManager.class);
- private ISymbolicLinkLocalizer symbolicLinkLocalizer = new MdSymbolicLinkLocalizer();
- private final OpenHelper openHelper = new OpenHelper();
//after fixing the problem in EDT - delete it
@Ignore
@@ -96,10 +87,7 @@ public class ConsecutiveEmptyLinesFixTest
*/
private void applyFix(Marker marker, IDtProject dtProject)
{
- IMarkerWrapper markerWrapper = new BmMarkerWrapper(marker, dtProject.getWorkspaceProject(), bmModelManager,
- projectManager, symbolicLinkLocalizer, openHelper);
-
- FixProcessHandle handle = fixManager.prepareFix(markerWrapper, dtProject);
+ FixProcessHandle handle = fixManager.prepareFix(marker, dtProject);
FixVariantDescriptor variantDescr = null;
diff --git a/tests/com.e1c.v8codestyle.bsl.ui.itests/.classpath b/tests/com.e1c.v8codestyle.bsl.ui.itests/.classpath
index e801ebfb..81fe078c 100644
--- a/tests/com.e1c.v8codestyle.bsl.ui.itests/.classpath
+++ b/tests/com.e1c.v8codestyle.bsl.ui.itests/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/tests/com.e1c.v8codestyle.bsl.ui.itests/.settings/org.eclipse.jdt.core.prefs b/tests/com.e1c.v8codestyle.bsl.ui.itests/.settings/org.eclipse.jdt.core.prefs
index 0249a552..a1bbcc4c 100644
--- a/tests/com.e1c.v8codestyle.bsl.ui.itests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/com.e1c.v8codestyle.bsl.ui.itests/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/tests/com.e1c.v8codestyle.bsl.ui.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.bsl.ui.itests/META-INF/MANIFEST.MF
index c1badea2..1a2d5bde 100644
--- a/tests/com.e1c.v8codestyle.bsl.ui.itests/META-INF/MANIFEST.MF
+++ b/tests/com.e1c.v8codestyle.bsl.ui.itests/META-INF/MANIFEST.MF
@@ -6,10 +6,11 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Vendor: %providerName
Fragment-Host: com.e1c.v8codestyle.bsl.ui;bundle-version="[0.7.0,0.8.0)"
Automatic-Module-Name: com.e1c.v8codestyle.bsl.ui.itests
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment
-Import-Package: com._1c.g5.v8.dt.bsl.ui.editor;version="[9.0.0,10.0.0)",
+Import-Package: com._1c.g5.v8.dt.bsl.ui.editor;version="[10.0.0,11.0.0)",
com._1c.g5.v8.dt.testing;version="[3.1.0,4.0.0)",
com._1c.g5.v8.dt.ui.util;version="[7.0.0,8.0.0)",
org.junit;version="[4.13.0,5.0.0)"
-Require-Bundle: org.eclipse.ui.forms;bundle-version="[3.11.0,4.0.0)"
+Require-Bundle: org.eclipse.ui.forms;bundle-version="[3.11.0,4.0.0)",
+ org.eclipse.core.expressions;bundle-version="[3.8.0,4.0.0)"
diff --git a/tests/com.e1c.v8codestyle.bsl.ui.itests/resources/doc-comment-format-result.bsl b/tests/com.e1c.v8codestyle.bsl.ui.itests/resources/doc-comment-format-result.bsl
new file mode 100644
index 00000000..bf478940
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.bsl.ui.itests/resources/doc-comment-format-result.bsl
@@ -0,0 +1,9 @@
+
+// Method description
+//
+// Parameters:
+// Parameters - Structure - :
+// * Key1 - has not type for key
+Procedure Test(Parameters) Export
+ // empty
+EndProcedure
diff --git a/tests/com.e1c.v8codestyle.bsl.ui.itests/resources/doc-comment-format.bsl b/tests/com.e1c.v8codestyle.bsl.ui.itests/resources/doc-comment-format.bsl
new file mode 100644
index 00000000..c4a64fd1
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.bsl.ui.itests/resources/doc-comment-format.bsl
@@ -0,0 +1,11 @@
+
+// Method description
+//
+//
+//
+// Parameters:
+// Parameters - Structure:
+// * Key1 - has not type for key
+Procedure Test(Parameters) Export
+ // empty
+EndProcedure
diff --git a/tests/com.e1c.v8codestyle.bsl.ui.itests/src/com/e1c/v8codestyle/bsl/ui/itests/BslDocCommentViewTest.java b/tests/com.e1c.v8codestyle.bsl.ui.itests/src/com/e1c/v8codestyle/bsl/ui/itests/BslDocCommentViewTest.java
index eb15b9e0..5f38af77 100644
--- a/tests/com.e1c.v8codestyle.bsl.ui.itests/src/com/e1c/v8codestyle/bsl/ui/itests/BslDocCommentViewTest.java
+++ b/tests/com.e1c.v8codestyle.bsl.ui.itests/src/com/e1c/v8codestyle/bsl/ui/itests/BslDocCommentViewTest.java
@@ -74,6 +74,16 @@ public class BslDocCommentViewTest
@Before
public void setUp() throws CoreException
{
+ IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
+ PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
+
+ boolean closed = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ assertTrue(closed);
+ Display display = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay();
+ while (!display.isDisposed() && display.readAndDispatch())
+ {
+ // do it
+ }
project = testingWorkspace.getProject(PROJECT_NAME);
@@ -82,16 +92,17 @@ public class BslDocCommentViewTest
testingWorkspace.cleanUpWorkspace();
project = this.testingWorkspace.setUpProject(PROJECT_NAME, getClass());
}
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
-
- IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
- PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
}
@After
public void shutDown()
{
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ Display display = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay();
+ while (!display.isDisposed() && display.readAndDispatch())
+ {
+ // do it
+ }
}
/**
diff --git a/tests/com.e1c.v8codestyle.bsl.ui.itests/src/com/e1c/v8codestyle/bsl/ui/itests/handlers/FormatDocCommentModuleEditorHandlerTest.java b/tests/com.e1c.v8codestyle.bsl.ui.itests/src/com/e1c/v8codestyle/bsl/ui/itests/handlers/FormatDocCommentModuleEditorHandlerTest.java
new file mode 100644
index 00000000..e1d72509
--- /dev/null
+++ b/tests/com.e1c.v8codestyle.bsl.ui.itests/src/com/e1c/v8codestyle/bsl/ui/itests/handlers/FormatDocCommentModuleEditorHandlerTest.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (C) 2024, 1C-Soft LLC and others.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * 1C-Soft LLC - initial API and implementation
+ *******************************************************************************/
+package com.e1c.v8codestyle.bsl.ui.itests.handlers;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.intro.IIntroPart;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import com._1c.g5.v8.dt.bsl.ui.editor.BslXtextEditor;
+import com._1c.g5.v8.dt.testing.TestingWorkspace;
+import com._1c.g5.v8.dt.ui.util.OpenHelper;
+import com.e1c.v8codestyle.internal.bsl.ui.handlers.FormatDocCommentModuleEditorHandler;
+
+/**
+ * Test {@link FormatDocCommentModuleEditorHandler}
+ *
+ * @author Dmitriy Marmyshev
+ */
+public class FormatDocCommentModuleEditorHandlerTest
+{
+
+ private static final String COMMAND_ID = "com.e1c.v8codestyle.bsl.ui.commands.formatDocCommentCommand";
+
+ private static final String PROJECT_NAME = "CommonModule";
+
+ private static final String COMMON_MODULE_FILE_NAME = "/src/CommonModules/CommonModule/Module.bsl";
+
+ @Rule
+ public TestingWorkspace testingWorkspace = new TestingWorkspace(true, false);
+
+ protected static final String FOLDER_RESOURCE = "/resources/";
+
+ private IProject project;
+
+ private OpenHelper openHelper = new OpenHelper();
+
+ private ICommandService commandService;
+ private IHandlerService handlerService;
+
+ @Before
+ public void setUp() throws CoreException
+ {
+ commandService = PlatformUI.getWorkbench().getService(ICommandService.class);
+ handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class);
+
+ IIntroPart introPart = PlatformUI.getWorkbench().getIntroManager().getIntro();
+ PlatformUI.getWorkbench().getIntroManager().closeIntro(introPart);
+
+ boolean closed = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ assertTrue(closed);
+ Display display = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay();
+ while (!display.isDisposed() && display.readAndDispatch())
+ {
+ // do it
+ }
+
+ project = testingWorkspace.getProject(PROJECT_NAME);
+
+ if (!project.exists() || !project.isAccessible())
+ {
+ testingWorkspace.cleanUpWorkspace();
+ project = this.testingWorkspace.setUpProject(PROJECT_NAME, getClass());
+ }
+ }
+
+ @After
+ public void shutDown()
+ {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ Display display = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay();
+ while (!display.isDisposed() && display.readAndDispatch())
+ {
+ // do it
+ }
+ }
+
+ /**
+ * Test format of doc comment.
+ *
+ * @throws Exception the exception
+ */
+ @Test
+ public void testFormatDocComment() throws Exception
+ {
+ updateModule(FOLDER_RESOURCE + "doc-comment-format.bsl");
+
+ IFile file = project.getFile(COMMON_MODULE_FILE_NAME);
+
+ ISelection selection = new TextSelection(14, 1);
+ IEditorPart fEditor = openHelper.openEditor(file, selection);
+ assertTrue(fEditor instanceof FormEditor);
+
+ IEditorPart editor = ((FormEditor)fEditor).getActiveEditor();
+ assertTrue(editor instanceof BslXtextEditor);
+
+
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(editor);
+
+ BslXtextEditor bslEditor = (BslXtextEditor)editor;
+ String expected = getResourceText(FOLDER_RESOURCE + "doc-comment-format.bsl");
+ assertEquals(expected, bslEditor.getDocument().get());
+
+ Command command = commandService.getCommand(COMMAND_ID);
+ assertNotNull(command);
+
+ ExecutionEvent executionEvent = handlerService.createExecutionEvent(command, new Event());
+ assertNotNull(executionEvent);
+
+ command.executeWithChecks(executionEvent);
+
+ expected = getResourceText(FOLDER_RESOURCE + "doc-comment-format-result.bsl");
+ assertEquals(expected, bslEditor.getDocument().get());
+ }
+
+ private String getResourceText(String pathToResource) throws Exception
+ {
+ try (InputStream in = getClass().getResourceAsStream(pathToResource))
+ {
+ return new String(in.readAllBytes(), StandardCharsets.UTF_8);
+ }
+ }
+
+ private void updateModule(String pathToResource) throws Exception
+ {
+ IFile file = project.getFile(COMMON_MODULE_FILE_NAME);
+ try (InputStream in = getClass().getResourceAsStream(pathToResource))
+ {
+ if (file.exists())
+ {
+ file.setContents(in, true, true, new NullProgressMonitor());
+ }
+ else
+ {
+ file.create(in, true, new NullProgressMonitor());
+ }
+ }
+ testingWorkspace.waitForBuildCompletion();
+ }
+}
diff --git a/tests/com.e1c.v8codestyle.form.itests/.classpath b/tests/com.e1c.v8codestyle.form.itests/.classpath
index e801ebfb..81fe078c 100644
--- a/tests/com.e1c.v8codestyle.form.itests/.classpath
+++ b/tests/com.e1c.v8codestyle.form.itests/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/tests/com.e1c.v8codestyle.form.itests/.settings/org.eclipse.jdt.core.prefs b/tests/com.e1c.v8codestyle.form.itests/.settings/org.eclipse.jdt.core.prefs
index 0249a552..a1bbcc4c 100644
--- a/tests/com.e1c.v8codestyle.form.itests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/com.e1c.v8codestyle.form.itests/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/tests/com.e1c.v8codestyle.form.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.form.itests/META-INF/MANIFEST.MF
index 357dc061..fcdfa282 100644
--- a/tests/com.e1c.v8codestyle.form.itests/META-INF/MANIFEST.MF
+++ b/tests/com.e1c.v8codestyle.form.itests/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Vendor: %providerName
Fragment-Host: com.e1c.v8codestyle.form;bundle-version="[0.7.0,0.8.0)"
Automatic-Module-Name: com.e1c.v8codestyle.form.itests
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment
Import-Package: com._1c.g5.v8.bm.integration;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.core.naming;version="[7.0.0,8.0.0)",
@@ -16,9 +16,7 @@ Import-Package: com._1c.g5.v8.bm.integration;version="[11.0.0,12.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)",
com._1c.g5.v8.dt.testing;version="[3.1.0,4.0.0)",
- com._1c.g5.v8.dt.ui.util;version="[7.0.0,8.0.0)",
- com._1c.g5.v8.dt.ui.validation;version="[5.0.0,6.0.0)",
- com._1c.g5.v8.dt.validation.marker;version="[7.0.0,8.0.0)",
+ com._1c.g5.v8.dt.validation.marker;version="[9.0.0,10.0.0)",
com.e1c.g5.v8.dt.testing.check;version="[1.0.0,2.0.0)",
org.junit;version="[4.13.0,5.0.0)"
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.13.0,4.0.0)"
diff --git a/tests/com.e1c.v8codestyle.form.itests/src/com/e1c/v8codestyle/form/fix/itests/FormFixTestBase.java b/tests/com.e1c.v8codestyle.form.itests/src/com/e1c/v8codestyle/form/fix/itests/FormFixTestBase.java
index 56253936..a8aabfd9 100644
--- a/tests/com.e1c.v8codestyle.form.itests/src/com/e1c/v8codestyle/form/fix/itests/FormFixTestBase.java
+++ b/tests/com.e1c.v8codestyle.form.itests/src/com/e1c/v8codestyle/form/fix/itests/FormFixTestBase.java
@@ -16,13 +16,7 @@ import java.util.Collection;
import org.eclipse.core.runtime.NullProgressMonitor;
-import com._1c.g5.v8.dt.core.naming.ISymbolicLinkLocalizer;
import com._1c.g5.v8.dt.core.platform.IDtProject;
-import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
-import com._1c.g5.v8.dt.form.naming.FormSymbolicLinkLocalizer;
-import com._1c.g5.v8.dt.ui.util.OpenHelper;
-import com._1c.g5.v8.dt.ui.validation.BmMarkerWrapper;
-import com._1c.g5.v8.dt.validation.marker.IMarkerWrapper;
import com._1c.g5.v8.dt.validation.marker.Marker;
import com._1c.g5.wiring.ServiceAccess;
import com.e1c.g5.v8.dt.check.qfix.FixProcessHandle;
@@ -41,9 +35,6 @@ public abstract class FormFixTestBase
private final String fixDescriptionPattern;
private IFixManager fixManager = ServiceAccess.get(IFixManager.class);
- private IV8ProjectManager projectManager = ServiceAccess.get(IV8ProjectManager.class);
- private ISymbolicLinkLocalizer symbolicLinkLocalizer = new FormSymbolicLinkLocalizer();
- private final OpenHelper openHelper = new OpenHelper();
/**
* Instantiates a new form fix test base.
@@ -64,10 +55,7 @@ public abstract class FormFixTestBase
*/
protected void applyFix(Marker marker, IDtProject dtProject)
{
- IMarkerWrapper markerWrapper = new BmMarkerWrapper(marker, dtProject.getWorkspaceProject(), bmModelManager,
- projectManager, symbolicLinkLocalizer, openHelper);
-
- FixProcessHandle handle = fixManager.prepareFix(markerWrapper, dtProject);
+ FixProcessHandle handle = fixManager.prepareFix(marker, dtProject);
FixVariantDescriptor variantDescr = null;
diff --git a/tests/com.e1c.v8codestyle.md.itests/.classpath b/tests/com.e1c.v8codestyle.md.itests/.classpath
index e801ebfb..81fe078c 100644
--- a/tests/com.e1c.v8codestyle.md.itests/.classpath
+++ b/tests/com.e1c.v8codestyle.md.itests/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/tests/com.e1c.v8codestyle.md.itests/.settings/org.eclipse.jdt.core.prefs b/tests/com.e1c.v8codestyle.md.itests/.settings/org.eclipse.jdt.core.prefs
index 0249a552..a1bbcc4c 100644
--- a/tests/com.e1c.v8codestyle.md.itests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/com.e1c.v8codestyle.md.itests/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/tests/com.e1c.v8codestyle.md.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.md.itests/META-INF/MANIFEST.MF
index 3836a2ef..3606648d 100644
--- a/tests/com.e1c.v8codestyle.md.itests/META-INF/MANIFEST.MF
+++ b/tests/com.e1c.v8codestyle.md.itests/META-INF/MANIFEST.MF
@@ -6,12 +6,12 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Vendor: %providerName
Fragment-Host: com.e1c.v8codestyle.md;bundle-version="[0.7.0,0.8.0)"
Automatic-Module-Name: com.e1c.v8codestyle.md.itests
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment
Import-Package: com._1c.g5.v8.bm.integration;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.core.platform;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.testing;version="[3.1.0,4.0.0)",
- com._1c.g5.v8.dt.validation.marker;version="[7.0.0,8.0.0)",
+ com._1c.g5.v8.dt.validation.marker;version="[9.0.0,10.0.0)",
com.e1c.g5.v8.dt.testing.check;version="[1.0.0,2.0.0)",
org.junit;version="[4.13.0,5.0.0)"
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.13.0,4.0.0)"
diff --git a/tests/com.e1c.v8codestyle.md.itests/src/com/e1c/v8codestyle/md/configuration/check/itests/ConfigurationDataLockTest.java b/tests/com.e1c.v8codestyle.md.itests/src/com/e1c/v8codestyle/md/configuration/check/itests/ConfigurationDataLockTest.java
index 605911a1..b4906bd4 100644
--- a/tests/com.e1c.v8codestyle.md.itests/src/com/e1c/v8codestyle/md/configuration/check/itests/ConfigurationDataLockTest.java
+++ b/tests/com.e1c.v8codestyle.md.itests/src/com/e1c/v8codestyle/md/configuration/check/itests/ConfigurationDataLockTest.java
@@ -16,6 +16,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.junit.Ignore;
import org.junit.Test;
import com._1c.g5.v8.bm.core.IBmTransaction;
@@ -58,6 +59,7 @@ public class ConfigurationDataLockTest
}
@Test
+ @Ignore("https://github.com/1C-Company/v8-code-style/issues/1375")
public void testManagedDataLockMode() throws Exception
{
IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME);
diff --git a/tests/com.e1c.v8codestyle.ql.itests/.classpath b/tests/com.e1c.v8codestyle.ql.itests/.classpath
index e801ebfb..81fe078c 100644
--- a/tests/com.e1c.v8codestyle.ql.itests/.classpath
+++ b/tests/com.e1c.v8codestyle.ql.itests/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/tests/com.e1c.v8codestyle.ql.itests/.settings/org.eclipse.jdt.core.prefs b/tests/com.e1c.v8codestyle.ql.itests/.settings/org.eclipse.jdt.core.prefs
index 0249a552..a1bbcc4c 100644
--- a/tests/com.e1c.v8codestyle.ql.itests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/com.e1c.v8codestyle.ql.itests/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF
index a717004a..d9f95472 100644
--- a/tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF
+++ b/tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Vendor: %providerName
Fragment-Host: com.e1c.v8codestyle.ql;bundle-version="[0.7.0,0.8.0)"
Automatic-Module-Name: com.e1c.v8codestyle.ql.itests
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment
Import-Package: com._1c.g5.v8.bm.integration;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.core.platform;version="[11.0.0,12.0.0)",
@@ -14,7 +14,7 @@ Import-Package: com._1c.g5.v8.bm.integration;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.form.model;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.mcore;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.testing;version="[3.0.0,4.0.0)",
- com._1c.g5.v8.dt.validation.marker;version="[7.0.0,8.0.0)",
+ com._1c.g5.v8.dt.validation.marker;version="[9.0.0,10.0.0)",
com.e1c.g5.v8.dt.testing.check;version="[1.0.0,2.0.0)",
org.junit;version="[4.13.0,5.0.0)"
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.13.900,4.0.0)",
diff --git a/tests/com.e1c.v8codestyle.right.itests/.classpath b/tests/com.e1c.v8codestyle.right.itests/.classpath
index e801ebfb..81fe078c 100644
--- a/tests/com.e1c.v8codestyle.right.itests/.classpath
+++ b/tests/com.e1c.v8codestyle.right.itests/.classpath
@@ -1,6 +1,6 @@
-
+
diff --git a/tests/com.e1c.v8codestyle.right.itests/.settings/org.eclipse.jdt.core.prefs b/tests/com.e1c.v8codestyle.right.itests/.settings/org.eclipse.jdt.core.prefs
index 0249a552..a1bbcc4c 100644
--- a/tests/com.e1c.v8codestyle.right.itests/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/com.e1c.v8codestyle.right.itests/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
diff --git a/tests/com.e1c.v8codestyle.right.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.right.itests/META-INF/MANIFEST.MF
index 1427c378..cd0c3004 100644
--- a/tests/com.e1c.v8codestyle.right.itests/META-INF/MANIFEST.MF
+++ b/tests/com.e1c.v8codestyle.right.itests/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 0.7.0.qualifier
Bundle-Vendor: %providerName
Fragment-Host: com.e1c.v8codestyle.right;bundle-version="[0.7.0,0.8.0)"
Automatic-Module-Name: com.e1c.v8codestyle.right.itests
-Bundle-RequiredExecutionEnvironment: JavaSE-11
+Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Localization: fragment
Import-Package: com._1c.g5.v8.dt.core.platform;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.md.refactoring.core;version="[1.0.0,2.0.0)",
@@ -14,6 +14,6 @@ Import-Package: com._1c.g5.v8.dt.core.platform;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.platform.version;version="[2.13.0,3.0.0)",
com._1c.g5.v8.dt.refactoring.core;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.testing;version="[3.1.0,4.0.0)",
- com._1c.g5.v8.dt.validation.marker;version="[7.0.0,8.0.0)",
+ com._1c.g5.v8.dt.validation.marker;version="[9.0.0,10.0.0)",
com.e1c.g5.v8.dt.testing.check;version="[1.0.0,2.0.0)",
org.junit;version="[4.13.0,5.0.0)"
diff --git a/tests/com.e1c.v8codestyle.right.itests/src/com/e1c/v8codestyle/internal/right/itests/CheckExternalDependenciesModule.java b/tests/com.e1c.v8codestyle.right.itests/src/com/e1c/v8codestyle/internal/right/itests/CheckExternalDependenciesModule.java
index 09a7218e..b45796cd 100644
--- a/tests/com.e1c.v8codestyle.right.itests/src/com/e1c/v8codestyle/internal/right/itests/CheckExternalDependenciesModule.java
+++ b/tests/com.e1c.v8codestyle.right.itests/src/com/e1c/v8codestyle/internal/right/itests/CheckExternalDependenciesModule.java
@@ -19,6 +19,7 @@ import com._1c.g5.v8.dt.core.platform.IDerivedDataManagerProvider;
import com._1c.g5.v8.dt.core.platform.IDtProjectManager;
import com._1c.g5.v8.dt.core.platform.IWorkspaceOrchestrator;
import com._1c.g5.v8.dt.md.refactoring.core.IMdRefactoringService;
+import com._1c.g5.v8.dt.rights.IRightInfosService;
import com._1c.g5.v8.dt.validation.marker.IMarkerManager;
import com._1c.g5.wiring.AbstractServiceAwareModule;
import com.e1c.g5.v8.dt.check.settings.ICheckRepository;
@@ -49,5 +50,6 @@ public class CheckExternalDependenciesModule
bind(IMarkerManager.class).toService();
bind(IMdRefactoringService.class).toService();
bind(IWorkspaceOrchestrator.class).toService();
+ bind(IRightInfosService.class).toService();
}
}
diff --git a/tests/pom.xml b/tests/pom.xml
index 36060d72..f22b6b4f 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -67,7 +67,7 @@
- -Xms80m -Xmx2g -Dosgi.module.lock.timeout=24 --add-modules=ALL-SYSTEM
+ -Xms80m -Xmx2g -Dosgi.module.lock.timeout=24 --add-modules=ALL-SYSTEM --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED
@@ -101,7 +101,7 @@
p2
-
+
org.apache.maven.plugins
maven-antrun-plugin
@@ -156,7 +156,7 @@
true
true
- ${ui.test.vmargs} ${tycho-surefire-plugin.vmargs} ${debug.vmargs} ${tycho.testArgLine}
+ ${ui.test.vmargs} ${tycho-surefire-plugin.vmargs} ${debug.vmargs}
${project.build.directory}/work
p2Installed