From 1ef5140e9a222b4fc9851c4a2076a97258b95a7f Mon Sep 17 00:00:00 2001 From: Andrey Volkov Date: Sat, 9 Sep 2023 15:20:28 +0300 Subject: [PATCH 01/27] =?UTF-8?q?G5V8DT-24027.=20=D0=A1=D0=BE=D1=80=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=BE=D0=B1=D1=8A=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D0=B2=20=D0=B8=20=D0=BF=D1=80=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=B2=20=D1=80=D0=BE=D0=BB=D1=8F=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internal/right/CorePlugin.java | 2 +- .../right/InternalRightInfosService.java | 89 ------------------- .../internal/right/ServiceModule.java | 48 ---------- .../right/check/RightActiveUsers.java | 4 +- .../right/check/RightAdministration.java | 4 +- .../right/check/RightAllFunctionsMode.java | 4 +- ...ConfigurationExtensionsAdministration.java | 4 +- .../right/check/RightDataAdministration.java | 4 +- .../v8codestyle/right/check/RightDelete.java | 4 +- .../right/check/RightExclusiveMode.java | 4 +- ...activeClearDeletionMarkPredefinedData.java | 4 +- .../right/check/RightInteractiveDelete.java | 4 +- ...InteractiveDeleteMarkedPredefinedData.java | 4 +- .../RightInteractiveDeletePredefinedData.java | 4 +- ...InteractiveOpenExternalDataProcessors.java | 4 +- .../RightInteractiveOpenExternalReports.java | 4 +- ...eractiveSetDeletionMarkPredefinedData.java | 4 +- .../RightOutputToPrinterFileClipboard.java | 4 +- .../right/check/RightSaveUserData.java | 4 +- .../right/check/RightStartAutomation.java | 4 +- .../check/RightStartExternalConnection.java | 4 +- .../right/check/RightStartThickClient.java | 4 +- .../right/check/RightStartThinClient.java | 4 +- .../right/check/RightStartWebClient.java | 4 +- .../RightUpdateDatabaseConfiguration.java | 4 +- .../right/check/RightViewEventLog.java | 4 +- .../right/check/RoleRightSetCheck.java | 8 +- 27 files changed, 51 insertions(+), 188 deletions(-) delete mode 100644 bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/InternalRightInfosService.java delete mode 100644 bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/ServiceModule.java 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 73fd579d9..c7244833e 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 @@ private Injector createInjector() { 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/InternalRightInfosService.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/internal/right/InternalRightInfosService.java deleted file mode 100644 index e0a868fdc..000000000 --- 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 ac862a498..000000000 --- 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 clazz = null; - try - { - clazz = (Class)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 a4a93e5c0..d031319f7 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.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 818d1d798..0f12234d7 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.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 cd6af47a7..a2fec74ad 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.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 89d09e107..e61610f40 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.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 c7ff51d6f..25ed14fa5 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.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 fdadb08f5..4a504c285 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.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 7bc8dfd96..44cad9010 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.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 c049b594a..9150f1909 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.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 cb2845d0c..f19c33cba 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.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 3f74aa98c..e8de2f47b 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.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 e8171f711..dfe22f276 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.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 96e5bb350..d1734a8a0 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.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 5134b1020..ebefd85ad 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.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 d3758db00..bdd50766f 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.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 4982be37b..16572c7d5 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.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 77fecc0ff..3f09e31d9 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.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 ca5611f97..aaeafb45f 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.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 3f6fb2ed2..b9869d40c 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.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 9ba98675c..2ebb6e94e 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.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 6277674f7..906630666 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.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 cbbda02dd..c3a82e25b 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.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 597d4b0c8..1201bb335 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.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 10ccc3cd7..6c0da5733 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.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 275425e3f..f6d588aa9 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 @@ -61,6 +61,7 @@ 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 +79,6 @@ 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 +114,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 +127,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; @@ -413,7 +413,7 @@ private Set getRoleTopObjects(IProject project, RoleDescription descriptio 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()); } From be725e0b5ca467c8eb11dc027a7da11c08c7ac54 Mon Sep 17 00:00:00 2001 From: Andrey Volkov Date: Sun, 10 Sep 2023 21:31:42 +0300 Subject: [PATCH 02/27] G5V8DT-24027. Versions up --- bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF index 2389106f6..6484dee8f 100644 --- a/bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF +++ b/bundles/com.e1c.v8codestyle.right/META-INF/MANIFEST.MF @@ -24,7 +24,7 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)", com._1c.g5.v8.dt.md;version="[19.0.0,20.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)", From 64d34406e58d90d3f97ad8719e0cfe5a95a8bbda Mon Sep 17 00:00:00 2001 From: Andrey Volkov Date: Mon, 25 Sep 2023 12:08:54 +0300 Subject: [PATCH 03/27] G5V8DT-24027. Dependence fix --- .../internal/right/ExternalDependenciesModule.java | 8 ++------ .../right/itests/CheckExternalDependenciesModule.java | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) 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 fd1dbdb1c..6b8f789a7 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.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 @@ public class ExternalDependenciesModule extends AbstractServiceAwareModule { - /** * @param plugin */ @@ -50,9 +49,6 @@ protected void doConfigure() 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/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 09a7218e1..b45796cdf 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.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 @@ protected void doConfigure() bind(IMarkerManager.class).toService(); bind(IMdRefactoringService.class).toService(); bind(IWorkspaceOrchestrator.class).toService(); + bind(IRightInfosService.class).toService(); } } From 1fe8e9da0ac15d3c57c2c77f586d7b4906eb6821 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Fri, 13 Oct 2023 14:14:54 +0300 Subject: [PATCH 04/27] =?UTF-8?q?G5V8DT-24189=20=D0=9F=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20?= =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=89=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B5=D0=B3=D0=BE=20=D0=B2=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BE=D0=B1=D0=BB=D0=B0=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../META-INF/MANIFEST.MF | 1 + bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml | 6 + .../ui/services/BslModuleRegionsService.java | 238 ++++++++++++++++++ .../ui/services/ModuleRegionInformation.java | 147 +++++++++++ .../bsl/ModuleStructureSection.java | 31 ++- .../templates/en/command_module.bsl | 2 - .../templates/en/form_module.bsl | 8 - .../templates/ru/command_module.bsl | 2 - .../templates/ru/form_module.bsl | 8 - 9 files changed, 416 insertions(+), 27 deletions(-) create mode 100644 bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java create mode 100644 bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java 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 585577948..ac90b064a 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF +++ b/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF @@ -23,6 +23,7 @@ Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.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.model;version="[5.0.0,6.0.0)", + com._1c.g5.v8.dt.bsl.model.util;version="4.7.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)", diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml index 9f0c599b1..a60088692 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml +++ b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml @@ -368,5 +368,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/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java new file mode 100644 index 000000000..a4fa742d8 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java @@ -0,0 +1,238 @@ +/** + * Copyright (C) 2023, 1C + */ +package com.e1c.v8codestyle.internal.bsl.ui.services; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.xtext.nodemodel.INode; +import org.eclipse.xtext.nodemodel.util.NodeModelUtils; +import org.eclipse.xtext.ui.editor.model.IXtextDocument; + +import com._1c.g5.v8.dt.bsl.common.IBslModuleRegionsService; +import com._1c.g5.v8.dt.bsl.model.RegionPreprocessor; +import com._1c.g5.v8.dt.common.Pair; +import com._1c.g5.v8.dt.metadata.mdclass.ScriptVariant; +import com.e1c.v8codestyle.bsl.ModuleStructureSection; + +/** + * Implementation of {@link IBslModuleRegionsService} + * + * @author Kuznetsov Nikita + */ +public class BslModuleRegionsService + implements IBslModuleRegionsService +{ + private static final String FORM_NAME = "Form"; //$NON-NLS-1$ + private static final String GRAPHICAL_SCHEME_NAME = "GraphicalScheme"; //$NON-NLS-1$ + + @Override + public Pair getRegionInformation(IXtextDocument document, + List regionPreprocessors, String suffix, int defaultOffset, ScriptVariant scriptVariant, + String eventOwnerRootName, boolean isMain, boolean isCommand, boolean isTable) + { + String declaredRegionName = + getDeclaredRegionName(eventOwnerRootName, isMain, isCommand, isTable, scriptVariant); + Map regionOffsets = + getRegionOffsets(document, regionPreprocessors, declaredRegionName, scriptVariant); + int offset = getRegionOffset(regionOffsets, declaredRegionName, suffix, defaultOffset, scriptVariant); + String regionName = null; + if (!isRegionExists(regionOffsets, declaredRegionName, suffix)) + { + regionName = suffix.isEmpty() ? declaredRegionName : (declaredRegionName + suffix); + } + return new Pair<>(offset, regionName); + } + + @Override + public String wrapByRegion(String content, String regionName, String beginRegion, String endRegion, String space, + String lineSeparator) + { + StringBuilder builder = new StringBuilder(); + builder.append(lineSeparator).append(beginRegion).append(space).append(regionName); + builder.append(content); + builder.append(endRegion); + builder.append(lineSeparator); + return builder.toString(); + } + + 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) + { + ModuleRegionInformation moduleRegionInformation = null; + if (!preprocessorRegionName.equals(declaredRegionName)) + { + if (!moduleStructureSection.isSuffixed()) + { + continue; + } + String suffix = getSuffixOfMatchingRegion(preprocessorRegionName, declaredRegionName); + moduleRegionInformation = regionOffsets.get(declaredRegionName); + if (moduleRegionInformation == null) + { + moduleRegionInformation = ModuleRegionInformation.create(document, node, nodeAfter); + if (moduleRegionInformation == null) + { + return regionOffsets; + } + } + moduleRegionInformation.addSuffix(suffix, document, node, nodeAfter); + } + if (moduleRegionInformation == null && !moduleStructureSection.isSuffixed()) + { + moduleRegionInformation = ModuleRegionInformation.create(document, node, nodeAfter); + } + if (moduleRegionInformation != null) + { + regionOffsets.put(declaredRegionName, moduleRegionInformation); + if ((targetRegionName != null) && targetRegionName.equals(preprocessorRegionName)) + { + 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); + ModuleRegionInformation regionOffset = regionOffsets.get(declaredRegionName); + if (regionOffset != null) + { + if (!suffix.isEmpty()) + { + ModuleRegionInformation 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) + { + ModuleRegionInformation 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(); + for (int regionNameIndex = 0; regionNameIndex < declaredRegionNames.length; regionNameIndex++) + { + ModuleStructureSection moduleStructuredSection = declaredRegionNames[regionNameIndex]; + String declaredRegionName = moduleStructuredSection.getName(scriptVariant); + if (declaredRegionName.equals(regionName)) + { + placeBefore = true; + } + ModuleRegionInformation regionInformation = regionOffsets.get(declaredRegionName); + if (regionInformation != null) + { + if (placeBefore && (suffix.isEmpty() || !declaredRegionName.equals(regionName))) + { + return regionInformation.getStartOffset(); + } + offset = placeBefore ? regionInformation.getStartOffset() : regionInformation.getEndOffset(); + } + } + return offset; + } + + private String getDeclaredRegionName(String eventOwnerRootName, boolean isMain, boolean isCommand, boolean isTable, + ScriptVariant scriptVariant) + { + if (eventOwnerRootName.equals(FORM_NAME)) + { + return getDeclaredRegionNameForForm(isMain, isCommand, isTable, scriptVariant); + } + if (eventOwnerRootName.equals(GRAPHICAL_SCHEME_NAME)) + { + return getDeclaredRegionNameForGraphicalScheme(scriptVariant); + } + return getDefaultRegionName(scriptVariant); + } + + private String getDeclaredRegionNameForForm(boolean isMain, boolean isCommand, boolean isTable, + ScriptVariant scriptVariant) + { + if (isMain) + { + return ModuleStructureSection.FORM_EVENT_HANDLERS.getName(scriptVariant); + } + else if (isCommand) + { + return ModuleStructureSection.FORM_COMMAND_EVENT_HANDLERS.getName(scriptVariant); + } + else if (isTable) + { + return ModuleStructureSection.FORM_TABLE_ITEMS_EVENT_HANDLERS.getName(scriptVariant); + } + return ModuleStructureSection.FORM_HEADER_ITEMS_EVENT_HANDLERS.getName(scriptVariant); + } + + private String getDeclaredRegionNameForGraphicalScheme(ScriptVariant scriptVariant) + { + return ModuleStructureSection.EVENT_HANDLERS.getName(scriptVariant); + } + + private String getDefaultRegionName(ScriptVariant scriptVariant) + { + return ModuleStructureSection.PRIVATE.getName(scriptVariant); + } + + 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); + } +} diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java new file mode 100644 index 000000000..65b9afce2 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java @@ -0,0 +1,147 @@ +/** + * Copyright (C) 2023, 1C + */ +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 offset and suffixes information of module region + * + * @author Kuznetsov Nikita + */ +public class ModuleRegionInformation +{ + private int startOffset; + private int endOffset; + private int insertOffset; + + private Map suffixes; + + /** + * Start offset of module region + * + * @return offset before region declaration + */ + public int getStartOffset() + { + return startOffset; + } + + /** + * End offset of module region + * + * @return offset after region declaration + */ + public int getEndOffset() + { + return endOffset; + } + + /** + * Before end offset inside module region + * + * @return offset before end of region declaration + */ + public int getBeforeEndOffset() + { + return insertOffset; + } + + /** + * 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<>(); + } + ModuleRegionInformation 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); + } + + /** + * Get module region information by suffix if exists + * + * @param suffix {@link String} suffix of declared name module region + * @return {@link ModuleRegionInformation} if suffix exists, {@code null} otherwise + */ + public ModuleRegionInformation getInformationBySuffix(String suffix) + { + if (hasSuffixes()) + { + return suffixes.get(suffix); + } + return null; + } + + private ModuleRegionInformation(int startOffset, int endOffset, int insertOffset) + { + this.startOffset = startOffset; + this.endOffset = endOffset; + this.insertOffset = insertOffset; + } + + /** + * 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 ModuleRegionInformation 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 ModuleRegionInformation(startOffset, endOffset, insertOffset); + } + catch (BadLocationException ex) + { + UiPlugin.log(UiPlugin.createErrorStatus("Can't create module region information", ex)); //$NON-NLS-1$ + } + return null; + } +} 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 599ea313d..31ef3d2ca 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 @@ 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) + ModuleStructureSection(String name, String nameRu, boolean isSuffixed) { this.names = new String[] { name, nameRu }; + this.isSuffixed = isSuffixed; + } + + ModuleStructureSection(String name, String nameRu) + { + this(name, nameRu, false); } /** @@ -61,4 +69,13 @@ public String getName(ScriptVariant scriptVariant) 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/templates/en/command_module.bsl b/bundles/com.e1c.v8codestyle.bsl/templates/en/command_module.bsl index 67df44fe9..8adad148e 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 f2dda7684..d2d1171a6 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 6fcfda8e2..1be65a57b 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 ffedd0001..d52a296df 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 @@ #КонецОбласти -#Область ОбработчикиСобытийЭлементовТаблицыФормы //<ИмяТаблицыФормы> - -// Код процедур и функций - -#КонецОбласти - #Область ОбработчикиКомандФормы // Код процедур и функций From 2606bff8b274818ea2e3f59711826fdfdbcfe266 Mon Sep 17 00:00:00 2001 From: Dzyuba Maksim Date: Mon, 16 Oct 2023 21:56:23 +0300 Subject: [PATCH 05/27] Fix target platform to 2023.3 --- targets/default/default.target | 2 +- targets/develop/develop.target | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/default/default.target b/targets/default/default.target index 8e142fa4f..8072d8776 100644 --- a/targets/default/default.target +++ b/targets/default/default.target @@ -13,7 +13,7 @@ - + diff --git a/targets/develop/develop.target b/targets/develop/develop.target index e43792d86..3da60e4c8 100644 --- a/targets/develop/develop.target +++ b/targets/develop/develop.target @@ -13,7 +13,7 @@ - + From a952272ae7d9bf689581db7a39f76e7880da3e6a Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Tue, 17 Oct 2023 09:38:46 +0300 Subject: [PATCH 06/27] =?UTF-8?q?G5V8DT-24189=20=D0=9F=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20?= =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=89=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B5=D0=B3=D0=BE=20=D0=B2=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BE=D0=B1=D0=BB=D0=B0=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copyright text change and style changes --- .../ui/services/BslModuleRegionsService.java | 15 ++++++++++++--- .../ui/services/ModuleRegionInformation.java | 19 ++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java index a4fa742d8..d0590c948 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java @@ -1,6 +1,15 @@ -/** - * Copyright (C) 2023, 1C - */ +/******************************************************************************* + * 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; diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java index 65b9afce2..ed24e2bcc 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java @@ -1,6 +1,15 @@ -/** - * Copyright (C) 2023, 1C - */ +/******************************************************************************* + * 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; @@ -17,7 +26,7 @@ * * @author Kuznetsov Nikita */ -public class ModuleRegionInformation +public final class ModuleRegionInformation { private int startOffset; private int endOffset; @@ -95,7 +104,7 @@ public void addSuffix(String suffix, IDocument document, INode node, INode nodeA */ public boolean hasSuffixes() { - return (suffixes != null); + return suffixes != null; } /** From afb003f6ab1ef672acd02597c1bce3ad4bb4dd14 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Wed, 18 Oct 2023 10:20:23 +0300 Subject: [PATCH 07/27] =?UTF-8?q?G5V8DT-24189=20=D0=9F=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20?= =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=89=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B5=D0=B3=D0=BE=20=D0=B2=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BE=D0=B1=D0=BB=D0=B0=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Minor changes --- .../META-INF/MANIFEST.MF | 2 +- .../ui/services/ModuleRegionInformation.java | 50 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) 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 ac90b064a..721eb61ec 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF +++ b/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF @@ -23,7 +23,7 @@ Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.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.model;version="[5.0.0,6.0.0)", - com._1c.g5.v8.dt.bsl.model.util;version="4.7.0", + com._1c.g5.v8.dt.bsl.model.util;version="[4.7.0,5.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)", diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java index ed24e2bcc..fc9d5db05 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java @@ -34,6 +34,31 @@ public final class ModuleRegionInformation 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 ModuleRegionInformation 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 ModuleRegionInformation(startOffset, endOffset, insertOffset); + } + catch (BadLocationException ex) + { + UiPlugin.log(UiPlugin.createErrorStatus("Can't create module region information", ex)); //$NON-NLS-1$ + } + return null; + } + /** * Start offset of module region * @@ -128,29 +153,4 @@ private ModuleRegionInformation(int startOffset, int endOffset, int insertOffset this.endOffset = endOffset; this.insertOffset = insertOffset; } - - /** - * 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 ModuleRegionInformation 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 ModuleRegionInformation(startOffset, endOffset, insertOffset); - } - catch (BadLocationException ex) - { - UiPlugin.log(UiPlugin.createErrorStatus("Can't create module region information", ex)); //$NON-NLS-1$ - } - return null; - } } From f7e6c017052051c8c1d98079416c83a9326168cd Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Tue, 24 Oct 2023 12:47:46 +0300 Subject: [PATCH 08/27] =?UTF-8?q?G5V8DT-24189=20=D0=9F=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20?= =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=89=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B5=D0=B3=D0=BE=20=D0=B2=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BE=D0=B1=D0=BB=D0=B0=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Information.java => BslModuleOffsets.java} | 16 +- .../services/BslModuleRegionInformation.java | 50 ++++++ .../ui/services/BslModuleRegionsService.java | 145 +++++++++++------- 3 files changed, 150 insertions(+), 61 deletions(-) rename bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/{ModuleRegionInformation.java => BslModuleOffsets.java} (87%) create mode 100644 bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleOffsets.java similarity index 87% rename from bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java rename to bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleOffsets.java index fc9d5db05..e6dcd9800 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/ModuleRegionInformation.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleOffsets.java @@ -26,13 +26,13 @@ * * @author Kuznetsov Nikita */ -public final class ModuleRegionInformation +public final class BslModuleOffsets { private int startOffset; private int endOffset; private int insertOffset; - private Map suffixes; + private Map suffixes; /** * Create and calculate module region offsets @@ -42,7 +42,7 @@ public final class ModuleRegionInformation * @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 ModuleRegionInformation create(IDocument document, INode node, INode nodeAfter) + public static BslModuleOffsets create(IDocument document, INode node, INode nodeAfter) { try { @@ -50,7 +50,7 @@ public static ModuleRegionInformation create(IDocument document, INode node, INo int startOffset = document.getLineOffset((startLine <= 1) ? 0 : startLine); int endOffset = nodeAfter.getTotalOffset(); int insertOffset = document.getLineOffset(document.getLineOfOffset(nodeAfter.getTotalOffset())); - return new ModuleRegionInformation(startOffset, endOffset, insertOffset); + return new BslModuleOffsets(startOffset, endOffset, insertOffset); } catch (BadLocationException ex) { @@ -103,7 +103,7 @@ public void addSuffix(String suffix, IDocument document, INode node, INode nodeA { suffixes = new HashMap<>(); } - ModuleRegionInformation suffixRegionInformation = create(document, node, nodeAfter); + BslModuleOffsets suffixRegionInformation = create(document, node, nodeAfter); if (suffixRegionInformation != null) { suffixes.put(suffix, suffixRegionInformation); @@ -136,9 +136,9 @@ public boolean hasSuffixes() * Get module region information by suffix if exists * * @param suffix {@link String} suffix of declared name module region - * @return {@link ModuleRegionInformation} if suffix exists, {@code null} otherwise + * @return {@link BslModuleOffsets} if suffix exists, {@code null} otherwise */ - public ModuleRegionInformation getInformationBySuffix(String suffix) + public BslModuleOffsets getInformationBySuffix(String suffix) { if (hasSuffixes()) { @@ -147,7 +147,7 @@ public ModuleRegionInformation getInformationBySuffix(String suffix) return null; } - private ModuleRegionInformation(int startOffset, int endOffset, int insertOffset) + private BslModuleOffsets(int startOffset, int endOffset, int insertOffset) { this.startOffset = startOffset; this.endOffset = endOffset; diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java new file mode 100644 index 000000000..59afcce92 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java @@ -0,0 +1,50 @@ +/** + * Copyright (C) 2023, 1C + */ +package com.e1c.v8codestyle.internal.bsl.ui.services; + +import com._1c.g5.v8.dt.bsl.common.IBslModuleInformation; +import com._1c.g5.v8.dt.bsl.model.Module; + +/** + * BSL module region information with {@link String} region wrap data + * + * @author Kuznetsov Nikita + */ +public class BslModuleRegionInformation + implements IBslModuleInformation +{ + private final Module module; + private final int insertPosition; + private final String wrapData; + + public static IBslModuleInformation create(Module module, int insertPosition, String wrapData) + { + return new BslModuleRegionInformation(module, insertPosition, wrapData); + } + + private BslModuleRegionInformation(Module module, int insertPosition, String wrapData) + { + this.module = module; + this.insertPosition = insertPosition; + this.wrapData = wrapData; + } + + @Override + public Module getModule() + { + return module; + } + + @Override + public int getInsertPosition() + { + return insertPosition; + } + + @Override + public String getData() + { + return wrapData; + } +} diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java index d0590c948..6f43f6117 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java @@ -16,13 +16,27 @@ 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.ui.editor.model.IXtextDocument; +import com._1c.g5.v8.dt.bsl.common.IBslModuleEventData; +import com._1c.g5.v8.dt.bsl.common.IBslModuleInformation; import com._1c.g5.v8.dt.bsl.common.IBslModuleRegionsService; +import com._1c.g5.v8.dt.bsl.model.Module; import com._1c.g5.v8.dt.bsl.model.RegionPreprocessor; -import com._1c.g5.v8.dt.common.Pair; +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.event.BslModuleEventRegionData; +import com._1c.g5.v8.dt.bsl.ui.event.EventItemType; +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.mcore.NamedElement; import com._1c.g5.v8.dt.metadata.mdclass.ScriptVariant; import com.e1c.v8codestyle.bsl.ModuleStructureSection; @@ -34,44 +48,55 @@ public class BslModuleRegionsService implements IBslModuleRegionsService { - private static final String FORM_NAME = "Form"; //$NON-NLS-1$ - private static final String GRAPHICAL_SCHEME_NAME = "GraphicalScheme"; //$NON-NLS-1$ - @Override - public Pair getRegionInformation(IXtextDocument document, - List regionPreprocessors, String suffix, int defaultOffset, ScriptVariant scriptVariant, - String eventOwnerRootName, boolean isMain, boolean isCommand, boolean isTable) + public IBslModuleInformation getInformation(IXtextDocument document, Module module, int defaultPosition, + IBslModuleEventData data) { - String declaredRegionName = - getDeclaredRegionName(eventOwnerRootName, isMain, isCommand, isTable, scriptVariant); - Map regionOffsets = + if (!(data instanceof BslModuleEventRegionData)) + { + return BslModuleRegionInformation.create(module, defaultPosition, null); + } + URI moduleResourceURI = module.eResource().getURI(); + IResourceServiceProvider rsp = + IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(moduleResourceURI); + IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class); + BslOwnerComputerService bslOwnerComputerService = rsp.get(BslOwnerComputerService.class); + IV8Project project = projectManager.getProject(moduleResourceURI); + EClass moduleOwner = bslOwnerComputerService.computeOwnerEClass(module); + BslModuleEventRegionData regionData = (BslModuleEventRegionData)data; + EObject eventOwner = regionData.getEventOwner(); + EventItemType itemType = regionData.getData(); + String suffix = getSuffix(eventOwner, itemType); + List regionPreprocessors = BslUtil.getAllRegionPreprocessors(module); + ScriptVariant scriptVariant = project.getScriptVariant(); + String declaredRegionName = getDeclaredRegionName(moduleOwner, itemType, scriptVariant); + Map regionOffsets = getRegionOffsets(document, regionPreprocessors, declaredRegionName, scriptVariant); - int offset = getRegionOffset(regionOffsets, declaredRegionName, suffix, defaultOffset, scriptVariant); + int offset = getRegionOffset(regionOffsets, declaredRegionName, suffix, defaultPosition, scriptVariant); String regionName = null; if (!isRegionExists(regionOffsets, declaredRegionName, suffix)) { regionName = suffix.isEmpty() ? declaredRegionName : (declaredRegionName + suffix); } - return new Pair<>(offset, regionName); + return BslModuleRegionInformation.create(module, offset, regionName); } @Override - public String wrapByRegion(String content, String regionName, String beginRegion, String endRegion, String space, - String lineSeparator) + public String wrap(String content, String name, String begin, String end, String space, String lineSeparator) { StringBuilder builder = new StringBuilder(); - builder.append(lineSeparator).append(beginRegion).append(space).append(regionName); - builder.append(content); - builder.append(endRegion); + builder.append(lineSeparator).append(begin).append(space).append(name); + builder.append(lineSeparator).append(content).append(lineSeparator); + builder.append(end); builder.append(lineSeparator); return builder.toString(); } - private Map getRegionOffsets(IXtextDocument document, + private Map getRegionOffsets(IXtextDocument document, List regionPreprocessors, String targetRegionName, ScriptVariant scriptVariant) { ModuleStructureSection[] declaredRegionNames = ModuleStructureSection.values(); - Map regionOffsets = new HashMap<>(declaredRegionNames.length / 2); + Map regionOffsets = new HashMap<>(declaredRegionNames.length / 2); for (RegionPreprocessor regionPreprocessor : regionPreprocessors) { INode nodeAfter = NodeModelUtils.findActualNodeFor(regionPreprocessor.getItemAfter()); @@ -88,7 +113,7 @@ && isMatchingRegion(preprocessorRegionName, declaredRegionName)) INode node = NodeModelUtils.findActualNodeFor(regionPreprocessor.getItem()); if (node != null) { - ModuleRegionInformation moduleRegionInformation = null; + BslModuleOffsets moduleRegionInformation = null; if (!preprocessorRegionName.equals(declaredRegionName)) { if (!moduleStructureSection.isSuffixed()) @@ -99,7 +124,7 @@ && isMatchingRegion(preprocessorRegionName, declaredRegionName)) moduleRegionInformation = regionOffsets.get(declaredRegionName); if (moduleRegionInformation == null) { - moduleRegionInformation = ModuleRegionInformation.create(document, node, nodeAfter); + moduleRegionInformation = BslModuleOffsets.create(document, node, nodeAfter); if (moduleRegionInformation == null) { return regionOffsets; @@ -109,7 +134,7 @@ && isMatchingRegion(preprocessorRegionName, declaredRegionName)) } if (moduleRegionInformation == null && !moduleStructureSection.isSuffixed()) { - moduleRegionInformation = ModuleRegionInformation.create(document, node, nodeAfter); + moduleRegionInformation = BslModuleOffsets.create(document, node, nodeAfter); } if (moduleRegionInformation != null) { @@ -127,17 +152,17 @@ && isMatchingRegion(preprocessorRegionName, declaredRegionName)) return regionOffsets; } - private int getRegionOffset(Map regionOffsets, String declaredRegionName, - String suffix, int defaultOffset, ScriptVariant scriptVariant) + private int getRegionOffset(Map regionOffsets, String declaredRegionName, String suffix, + int defaultOffset, ScriptVariant scriptVariant) { int offset = defaultOffset; boolean createNewRegion = !isRegionExists(regionOffsets, declaredRegionName, suffix); - ModuleRegionInformation regionOffset = regionOffsets.get(declaredRegionName); + BslModuleOffsets regionOffset = regionOffsets.get(declaredRegionName); if (regionOffset != null) { if (!suffix.isEmpty()) { - ModuleRegionInformation suffixedRegionInformation = regionOffset.getInformationBySuffix(suffix); + BslModuleOffsets suffixedRegionInformation = regionOffset.getInformationBySuffix(suffix); if (suffixedRegionInformation != null) { return suffixedRegionInformation.getBeforeEndOffset(); @@ -156,16 +181,16 @@ else if (createNewRegion) return offset; } - private boolean isRegionExists(Map regionOffsets, String declaredRegionName, + private boolean isRegionExists(Map regionOffsets, String declaredRegionName, String suffix) { - ModuleRegionInformation moduleRegionInformation = regionOffsets.get(declaredRegionName); + 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) + private int getNewRegionOffset(Map regionOffsets, String regionName, String suffix, + int defaultOffset, ScriptVariant scriptVariant) { boolean placeBefore = false; int offset = regionOffsets.isEmpty() ? 0 : defaultOffset; @@ -178,7 +203,7 @@ private int getNewRegionOffset(Map regionOffset { placeBefore = true; } - ModuleRegionInformation regionInformation = regionOffsets.get(declaredRegionName); + BslModuleOffsets regionInformation = regionOffsets.get(declaredRegionName); if (regionInformation != null) { if (placeBefore && (suffix.isEmpty() || !declaredRegionName.equals(regionName))) @@ -191,46 +216,60 @@ private int getNewRegionOffset(Map regionOffset return offset; } - private String getDeclaredRegionName(String eventOwnerRootName, boolean isMain, boolean isCommand, boolean isTable, - ScriptVariant scriptVariant) + private String getDeclaredRegionName(EClass moduleOwnerClass, EventItemType itemType, ScriptVariant scriptVariant) { - if (eventOwnerRootName.equals(FORM_NAME)) + String moduleOwnerName = moduleOwnerClass.getName(); + switch (moduleOwnerName) { - return getDeclaredRegionNameForForm(isMain, isCommand, isTable, scriptVariant); + case "AbstractForm": //$NON-NLS-1$ + return getDeclaredRegionNameForForm(itemType, scriptVariant); + case "WebService": //$NON-NLS-1$ + case "HTTPService": //$NON-NLS-1$ + case "IntegrationService": //$NON-NLS-1$ + return getPrivateRegionName(scriptVariant); + default: + return getDefaultRegionName(scriptVariant); } - if (eventOwnerRootName.equals(GRAPHICAL_SCHEME_NAME)) - { - return getDeclaredRegionNameForGraphicalScheme(scriptVariant); - } - return getDefaultRegionName(scriptVariant); } - private String getDeclaredRegionNameForForm(boolean isMain, boolean isCommand, boolean isTable, - ScriptVariant scriptVariant) + private String getDeclaredRegionNameForForm(EventItemType itemType, ScriptVariant scriptVariant) { - if (isMain) + switch (itemType) { + case MAIN: return ModuleStructureSection.FORM_EVENT_HANDLERS.getName(scriptVariant); - } - else if (isCommand) - { + case COMMAND: return ModuleStructureSection.FORM_COMMAND_EVENT_HANDLERS.getName(scriptVariant); - } - else if (isTable) - { + case TABLE: return ModuleStructureSection.FORM_TABLE_ITEMS_EVENT_HANDLERS.getName(scriptVariant); + default: + return ModuleStructureSection.FORM_HEADER_ITEMS_EVENT_HANDLERS.getName(scriptVariant); } - return ModuleStructureSection.FORM_HEADER_ITEMS_EVENT_HANDLERS.getName(scriptVariant); } - private String getDeclaredRegionNameForGraphicalScheme(ScriptVariant scriptVariant) + private String getPrivateRegionName(ScriptVariant scriptVariant) { - return ModuleStructureSection.EVENT_HANDLERS.getName(scriptVariant); + return ModuleStructureSection.PRIVATE.getName(scriptVariant); } private String getDefaultRegionName(ScriptVariant scriptVariant) { - return ModuleStructureSection.PRIVATE.getName(scriptVariant); + return ModuleStructureSection.EVENT_HANDLERS.getName(scriptVariant); + } + + private String getSuffix(EObject eventOwner, EventItemType itemType) + { + if (itemType.equals(EventItemType.TABLE)) + { + while ((eventOwner = eventOwner.eContainer()) != null) + { + if (eventOwner instanceof NamedElement && eventOwner.eClass().getName().equals("Table")) //$NON-NLS-1$ + { + return ((NamedElement)eventOwner).getName(); + } + } + } + return StringUtils.EMPTY; } private String getSuffixOfMatchingRegion(String regionName, String declaredRegionName) From 540563177ad1a63400b660084a0a69b8e7a60d17 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Tue, 24 Oct 2023 16:45:34 +0300 Subject: [PATCH 09/27] =?UTF-8?q?G5V8DT-24189=20=D0=9F=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20?= =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=89=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B5=D0=B3=D0=BE=20=D0=B2=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BE=D0=B1=D0=BB=D0=B0=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename extension point Versioning --- bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF | 2 ++ bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml | 6 +++--- .../internal/bsl/ui/services/BslModuleRegionsService.java | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) 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 721eb61ec..fd8cf5572 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF +++ b/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF @@ -24,10 +24,12 @@ Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.0 com._1c.g5.v8.dt.bsl.documentation.comment;version="[4.0.0,5.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.event;version="[5.0.0,6.0.0)", com._1c.g5.v8.dt.bsl.ui.menu;version="[6.0.0,7.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)", diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml index a60088692..fef518fc0 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml +++ b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml @@ -369,10 +369,10 @@ - + - + diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java index 6f43f6117..bfd3e0504 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java @@ -26,7 +26,7 @@ import com._1c.g5.v8.dt.bsl.common.IBslModuleEventData; import com._1c.g5.v8.dt.bsl.common.IBslModuleInformation; -import com._1c.g5.v8.dt.bsl.common.IBslModuleRegionsService; +import com._1c.g5.v8.dt.bsl.common.IBslModuleInformationService; 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; @@ -41,12 +41,12 @@ import com.e1c.v8codestyle.bsl.ModuleStructureSection; /** - * Implementation of {@link IBslModuleRegionsService} + * Implementation of {@link IBslModuleInformationService} * * @author Kuznetsov Nikita */ public class BslModuleRegionsService - implements IBslModuleRegionsService + implements IBslModuleInformationService { @Override public IBslModuleInformation getInformation(IXtextDocument document, Module module, int defaultPosition, From 2bc5a76d38852fe27376b25859e88847234f1f73 Mon Sep 17 00:00:00 2001 From: Dmitry Savenko Date: Wed, 25 Oct 2023 15:51:18 +0700 Subject: [PATCH 10/27] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=BD=D1=8F=D1=82?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B9=20dt.valida?= =?UTF-8?q?tion.marker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/com.e1c.v8codestyle.bsl.itests/META-INF/MANIFEST.MF | 2 +- tests/com.e1c.v8codestyle.form.itests/META-INF/MANIFEST.MF | 2 +- tests/com.e1c.v8codestyle.md.itests/META-INF/MANIFEST.MF | 2 +- tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF | 2 +- tests/com.e1c.v8codestyle.right.itests/META-INF/MANIFEST.MF | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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 c2469813f..76d83de7b 100644 --- a/tests/com.e1c.v8codestyle.bsl.itests/META-INF/MANIFEST.MF +++ b/tests/com.e1c.v8codestyle.bsl.itests/META-INF/MANIFEST.MF @@ -15,6 +15,6 @@ Import-Package: com._1c.g5.v8.dt.core.naming;version="[7.0.0,8.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="[8.0.0,9.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.form.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.form.itests/META-INF/MANIFEST.MF index 515be0815..2f8db5829 100644 --- a/tests/com.e1c.v8codestyle.form.itests/META-INF/MANIFEST.MF +++ b/tests/com.e1c.v8codestyle.form.itests/META-INF/MANIFEST.MF @@ -18,7 +18,7 @@ Import-Package: com._1c.g5.v8.bm.integration;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.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="[8.0.0,9.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/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.md.itests/META-INF/MANIFEST.MF index 26d38498b..efedb2bc0 100644 --- a/tests/com.e1c.v8codestyle.md.itests/META-INF/MANIFEST.MF +++ b/tests/com.e1c.v8codestyle.md.itests/META-INF/MANIFEST.MF @@ -11,7 +11,7 @@ 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="[8.0.0,9.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.ql.itests/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF index 033c6cb3e..aa102c588 100644 --- a/tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF +++ b/tests/com.e1c.v8codestyle.ql.itests/META-INF/MANIFEST.MF @@ -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="[8.0.0,9.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/META-INF/MANIFEST.MF b/tests/com.e1c.v8codestyle.right.itests/META-INF/MANIFEST.MF index 5ab9e28d4..e444c7545 100644 --- a/tests/com.e1c.v8codestyle.right.itests/META-INF/MANIFEST.MF +++ b/tests/com.e1c.v8codestyle.right.itests/META-INF/MANIFEST.MF @@ -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="[8.0.0,9.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)" From 6b49456688e1a2c9fbda4f09b97d6f1932475659 Mon Sep 17 00:00:00 2001 From: Dzyuba Maksim Date: Wed, 25 Oct 2023 17:44:52 +0300 Subject: [PATCH 11/27] G5V8DT-24189_variant --- .../services/BslModuleRegionInformation.java | 18 +++----- .../ui/services/BslModuleRegionsService.java | 46 +++++++++++++------ 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java index 59afcce92..0eafe8cc9 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java @@ -12,22 +12,17 @@ * @author Kuznetsov Nikita */ public class BslModuleRegionInformation - implements IBslModuleInformation + implements IBslModuleInformation { private final Module module; private final int insertPosition; - private final String wrapData; + private final String regionName; - public static IBslModuleInformation create(Module module, int insertPosition, String wrapData) - { - return new BslModuleRegionInformation(module, insertPosition, wrapData); - } - - private BslModuleRegionInformation(Module module, int insertPosition, String wrapData) + public BslModuleRegionInformation(Module module, int insertPosition, String regionName) { this.module = module; this.insertPosition = insertPosition; - this.wrapData = wrapData; + this.regionName = regionName; } @Override @@ -42,9 +37,8 @@ public int getInsertPosition() return insertPosition; } - @Override - public String getData() + public String getRegionName() { - return wrapData; + return regionName; } } diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java index bfd3e0504..cc519fc39 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java @@ -24,6 +24,7 @@ import org.eclipse.xtext.resource.IResourceServiceProvider; import org.eclipse.xtext.ui.editor.model.IXtextDocument; +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.IBslModuleInformation; import com._1c.g5.v8.dt.bsl.common.IBslModuleInformationService; @@ -31,8 +32,8 @@ 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.event.BslModuleEventRegionData; -import com._1c.g5.v8.dt.bsl.ui.event.EventItemType; +import com._1c.g5.v8.dt.bsl.ui.BslGeneratorMultiLangProposals; +import com._1c.g5.v8.dt.bsl.ui.event.BslModuleEventData; 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; @@ -49,23 +50,23 @@ public class BslModuleRegionsService implements IBslModuleInformationService { @Override - public IBslModuleInformation getInformation(IXtextDocument document, Module module, int defaultPosition, - IBslModuleEventData data) + public IBslModuleInformation getInformation(IXtextDocument document, Module module, int defaultPosition, + IBslModuleEventData data) { - if (!(data instanceof BslModuleEventRegionData)) + if (!(data instanceof BslModuleEventData)) { - return BslModuleRegionInformation.create(module, defaultPosition, null); + return new BslModuleRegionInformation(module, defaultPosition, null); } URI moduleResourceURI = module.eResource().getURI(); IResourceServiceProvider rsp = IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(moduleResourceURI); IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class); - BslOwnerComputerService bslOwnerComputerService = rsp.get(BslOwnerComputerService.class); IV8Project project = projectManager.getProject(moduleResourceURI); + BslOwnerComputerService bslOwnerComputerService = rsp.get(BslOwnerComputerService.class); EClass moduleOwner = bslOwnerComputerService.computeOwnerEClass(module); - BslModuleEventRegionData regionData = (BslModuleEventRegionData)data; - EObject eventOwner = regionData.getEventOwner(); - EventItemType itemType = regionData.getData(); + EObject eventOwner = data.getEventOwner(); + BslModuleEventData regionData = (BslModuleEventData)data; + EventItemType itemType = regionData.getEventItemType(); String suffix = getSuffix(eventOwner, itemType); List regionPreprocessors = BslUtil.getAllRegionPreprocessors(module); ScriptVariant scriptVariant = project.getScriptVariant(); @@ -78,16 +79,33 @@ public IBslModuleInformation getInformation(IXtextDocument document, Module m { regionName = suffix.isEmpty() ? declaredRegionName : (declaredRegionName + suffix); } - return BslModuleRegionInformation.create(module, offset, regionName); + return new BslModuleRegionInformation(module, offset, regionName); + } @Override - public String wrap(String content, String name, String begin, String end, String space, String lineSeparator) + public String wrap(String content, IBslModuleInformation name, String lineSeparator) { + if (!(name instanceof BslModuleRegionInformation)) + { + return content; + } + IResourceServiceProvider rsp = + IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(URI.createURI("*.bsl"));//$NON-NLS-1$ + IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class); + IV8Project project = projectManager.getProject(name.getModule()); + BslGeneratorMultiLangProposals proposals = rsp.get(BslGeneratorMultiLangProposals.class); + proposals.setRussianLang(ScriptVariant.RUSSIAN.equals(project.getScriptVariant())); + String beginRegion = proposals.getBeginRegionPropStr(); + String endRegion = proposals.getEndRegionPropStr(); + String space = proposals.getSpacePropStr(); StringBuilder builder = new StringBuilder(); - builder.append(lineSeparator).append(begin).append(space).append(name); + builder.append(lineSeparator) + .append(beginRegion) + .append(space) + .append(((BslModuleRegionInformation)name).getRegionName()); builder.append(lineSeparator).append(content).append(lineSeparator); - builder.append(end); + builder.append(endRegion); builder.append(lineSeparator); return builder.toString(); } From 8e2519a0f259515d13fe0eb7aa52b20a0f3b5650 Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Mon, 30 Oct 2023 11:15:00 +0300 Subject: [PATCH 12/27] =?UTF-8?q?=D0=9F=D1=80=D0=B8=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA=D0=B0=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B8=D0=BB=D0=B8=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20=D0=B0=D0=B2=D1=82=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B7=D0=BC=D0=B5=D1=89=D0=B0=D1=82=D1=8C=20=D0=B5=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=B2=20=D1=81=D0=BE=D0=BE=D1=82=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B5=D0=B9=20=D0=BE=D0=B1?= =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Another refactoring --- .../services/BslModuleRegionInformation.java | 28 +++++++--- .../ui/services/BslModuleRegionsService.java | 55 ++++++++++--------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java index 0eafe8cc9..bd94421ab 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java @@ -7,36 +7,48 @@ import com._1c.g5.v8.dt.bsl.model.Module; /** - * BSL module region information with {@link String} region wrap data + * Built-in language module region information with {@link String} region wrap data * * @author Kuznetsov Nikita */ public class BslModuleRegionInformation implements IBslModuleInformation { - private final Module module; private final int insertPosition; + private final Module module; private final String regionName; - public BslModuleRegionInformation(Module module, int insertPosition, String regionName) + /** + * {@link BslModuleRegionInformation} constructor + * + * @param insertPosition + * @param module current {@link Module}, cannot be null + * @param regionName + */ + public BslModuleRegionInformation(int insertPosition, Module module, String regionName) { - this.module = module; this.insertPosition = insertPosition; + this.module = module; this.regionName = regionName; } @Override - public Module getModule() + public int getInsertPosition() { - return module; + return insertPosition; } @Override - public int getInsertPosition() + public Module getModule() { - return insertPosition; + return module; } + /** + * Get 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/BslModuleRegionsService.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java index cc519fc39..d3aef876e 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java @@ -34,6 +34,7 @@ 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.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; @@ -55,14 +56,14 @@ public IBslModuleInformation getInformation(IXtextDocument document, Module modu { if (!(data instanceof BslModuleEventData)) { - return new BslModuleRegionInformation(module, defaultPosition, null); + return () -> defaultPosition; } URI moduleResourceURI = module.eResource().getURI(); IResourceServiceProvider rsp = IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(moduleResourceURI); IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class); - IV8Project project = projectManager.getProject(moduleResourceURI); BslOwnerComputerService bslOwnerComputerService = rsp.get(BslOwnerComputerService.class); + IV8Project project = projectManager.getProject(moduleResourceURI); EClass moduleOwner = bslOwnerComputerService.computeOwnerEClass(module); EObject eventOwner = data.getEventOwner(); BslModuleEventData regionData = (BslModuleEventData)data; @@ -79,35 +80,39 @@ public IBslModuleInformation getInformation(IXtextDocument document, Module modu { regionName = suffix.isEmpty() ? declaredRegionName : (declaredRegionName + suffix); } - return new BslModuleRegionInformation(module, offset, regionName); - + return new BslModuleRegionInformation(offset, module, regionName); } @Override - public String wrap(String content, IBslModuleInformation name, String lineSeparator) + public String wrap(IBslModuleInformation moduleInformation, String content) { - if (!(name instanceof BslModuleRegionInformation)) + if (moduleInformation instanceof BslModuleRegionInformation) { - return content; + BslModuleRegionInformation moduleRegionInformation = (BslModuleRegionInformation)moduleInformation; + Module module = moduleInformation.getModule(); + String regionName = moduleRegionInformation.getRegionName(); + if (module != null && regionName != null) + { + URI moduleResourceURI = module.eResource().getURI(); + IResourceServiceProvider rsp = + IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(moduleResourceURI); + IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class); + BslGeneratorMultiLangProposals proposals = rsp.get(BslGeneratorMultiLangProposals.class); + IV8Project project = projectManager.getProject(moduleResourceURI); + 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(); + builder.append(lineSeparator).append(beginRegion).append(space).append(regionName); + builder.append(lineSeparator).append(content).append(lineSeparator); + builder.append(endRegion); + builder.append(lineSeparator); + return builder.toString(); + } } - IResourceServiceProvider rsp = - IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(URI.createURI("*.bsl"));//$NON-NLS-1$ - IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class); - IV8Project project = projectManager.getProject(name.getModule()); - BslGeneratorMultiLangProposals proposals = rsp.get(BslGeneratorMultiLangProposals.class); - proposals.setRussianLang(ScriptVariant.RUSSIAN.equals(project.getScriptVariant())); - String beginRegion = proposals.getBeginRegionPropStr(); - String endRegion = proposals.getEndRegionPropStr(); - String space = proposals.getSpacePropStr(); - StringBuilder builder = new StringBuilder(); - builder.append(lineSeparator) - .append(beginRegion) - .append(space) - .append(((BslModuleRegionInformation)name).getRegionName()); - builder.append(lineSeparator).append(content).append(lineSeparator); - builder.append(endRegion); - builder.append(lineSeparator); - return builder.toString(); + return content; } private Map getRegionOffsets(IXtextDocument document, From 01f7c72e7118a2907b3ffa11edb078bf1d2b0b0b Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Wed, 1 Nov 2023 11:28:42 +0300 Subject: [PATCH 13/27] =?UTF-8?q?G5V8DT-24189=20=D0=9F=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20?= =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=89=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B5=D0=B3=D0=BE=20=D0=B2=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BE=D0=B1=D0=BB=D0=B0=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../META-INF/MANIFEST.MF | 1 + bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml | 8 +++--- .../bsl/ui/services/BslModuleOffsets.java | 8 +++--- ...rmation.java => BslModuleRegionsInfo.java} | 16 +++++------ ....java => BslModuleRegionsInfoService.java} | 27 ++++++++++--------- 5 files changed, 31 insertions(+), 29 deletions(-) rename bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/{BslModuleRegionInformation.java => BslModuleRegionsInfo.java} (67%) rename bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/{BslModuleRegionsService.java => BslModuleRegionsInfoService.java} (93%) 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 fd8cf5572..87a56ed4b 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF +++ b/bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF @@ -37,6 +37,7 @@ Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.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.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)", diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml index fef518fc0..16fe132ec 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml +++ b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml @@ -369,10 +369,10 @@ - - + point="com._1c.g5.v8.dt.bsl.ui.bslModuleTextInsertInfoService"> + + 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 index e6dcd9800..aa358cf94 100644 --- 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 @@ -60,7 +60,7 @@ public static BslModuleOffsets create(IDocument document, INode node, INode node } /** - * Start offset of module region + * Returns start offset of module region * * @return offset before region declaration */ @@ -70,7 +70,7 @@ public int getStartOffset() } /** - * End offset of module region + * Returns end offset of module region * * @return offset after region declaration */ @@ -80,7 +80,7 @@ public int getEndOffset() } /** - * Before end offset inside module region + * Returns before end offset inside module region * * @return offset before end of region declaration */ @@ -133,7 +133,7 @@ public boolean hasSuffixes() } /** - * Get module region information by suffix if exists + * 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 diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfo.java similarity index 67% rename from bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java rename to bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfo.java index bd94421ab..da347fe49 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionInformation.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfo.java @@ -3,7 +3,7 @@ */ package com.e1c.v8codestyle.internal.bsl.ui.services; -import com._1c.g5.v8.dt.bsl.common.IBslModuleInformation; +import com._1c.g5.v8.dt.bsl.common.IBslModuleTextInsertInfo; import com._1c.g5.v8.dt.bsl.model.Module; /** @@ -11,21 +11,21 @@ * * @author Kuznetsov Nikita */ -public class BslModuleRegionInformation - implements IBslModuleInformation +public class BslModuleRegionsInfo + implements IBslModuleTextInsertInfo { private final int insertPosition; private final Module module; private final String regionName; /** - * {@link BslModuleRegionInformation} constructor + * {@link BslModuleRegionsInfo} constructor * - * @param insertPosition + * @param insertPosition int insertion offset, cannot be negative * @param module current {@link Module}, cannot be null - * @param regionName + * @param regionName {@link String} region name, can be null */ - public BslModuleRegionInformation(int insertPosition, Module module, String regionName) + public BslModuleRegionsInfo(int insertPosition, Module module, String regionName) { this.insertPosition = insertPosition; this.module = module; @@ -45,7 +45,7 @@ public Module getModule() } /** - * Get region name + * Returns region name * * @return {@link String} region name, can be null */ diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfoService.java similarity index 93% rename from bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java rename to bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfoService.java index d3aef876e..4f2dfdb4a 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsService.java +++ b/bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/internal/bsl/ui/services/BslModuleRegionsInfoService.java @@ -26,8 +26,8 @@ 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.IBslModuleInformation; -import com._1c.g5.v8.dt.bsl.common.IBslModuleInformationService; +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; @@ -38,21 +38,22 @@ 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.ModuleStructureSection; /** - * Implementation of {@link IBslModuleInformationService} + * Module regions related implementation of {@link IBslModuleTextInsertInfoService} * * @author Kuznetsov Nikita */ -public class BslModuleRegionsService - implements IBslModuleInformationService +public class BslModuleRegionsInfoService + implements IBslModuleTextInsertInfoService { @Override - public IBslModuleInformation getInformation(IXtextDocument document, Module module, int defaultPosition, - IBslModuleEventData data) + public IBslModuleTextInsertInfo getEventHandlerTextInsertInfo(IXtextDocument document, Module module, + int defaultPosition, IBslModuleEventData data) { if (!(data instanceof BslModuleEventData)) { @@ -80,16 +81,16 @@ public IBslModuleInformation getInformation(IXtextDocument document, Module modu { regionName = suffix.isEmpty() ? declaredRegionName : (declaredRegionName + suffix); } - return new BslModuleRegionInformation(offset, module, regionName); + return new BslModuleRegionsInfo(offset, module, regionName); } @Override - public String wrap(IBslModuleInformation moduleInformation, String content) + public String wrap(IBslModuleTextInsertInfo moduleTextInsertInfo, String content) { - if (moduleInformation instanceof BslModuleRegionInformation) + if (moduleTextInsertInfo instanceof BslModuleRegionsInfo) { - BslModuleRegionInformation moduleRegionInformation = (BslModuleRegionInformation)moduleInformation; - Module module = moduleInformation.getModule(); + BslModuleRegionsInfo moduleRegionInformation = (BslModuleRegionsInfo)moduleTextInsertInfo; + Module module = moduleTextInsertInfo.getModule(); String regionName = moduleRegionInformation.getRegionName(); if (module != null && regionName != null) { @@ -286,7 +287,7 @@ private String getSuffix(EObject eventOwner, EventItemType itemType) { while ((eventOwner = eventOwner.eContainer()) != null) { - if (eventOwner instanceof NamedElement && eventOwner.eClass().getName().equals("Table")) //$NON-NLS-1$ + if (eventOwner.eClass() == FormPackage.Literals.TABLE) { return ((NamedElement)eventOwner).getName(); } From 57b5d2fcbdf1b7d65fa88db58fb19bb134ec1e2e Mon Sep 17 00:00:00 2001 From: Vadim Geraskin Date: Tue, 7 Nov 2023 13:38:05 +0700 Subject: [PATCH 14/27] feature/1373: Versions up com._1c.g5.v8.dt.bsl.validation --- .gitignore | 4 +++- bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 47f8c6961..821bd1112 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/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF b/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF index 4a99921b0..ac6aa5c70 100644 --- a/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF +++ b/bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF @@ -32,7 +32,7 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.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.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)", From fab7ae0b945c150233503e50e97d5bd5309e96ef Mon Sep 17 00:00:00 2001 From: Vadim Geraskin Date: Fri, 10 Nov 2023 22:15:12 +0700 Subject: [PATCH 15/27] =?UTF-8?q?feature/1373:=20=D0=98=D0=B3=D0=BD=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=B0=D0=B4=D0=B0=D1=8E=D1=89=D0=B5=D0=B3=D0=BE=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v8codestyle/md/check/itests/ConfigurationDataLockTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/com.e1c.v8codestyle.md.itests/src/com/e1c/v8codestyle/md/check/itests/ConfigurationDataLockTest.java b/tests/com.e1c.v8codestyle.md.itests/src/com/e1c/v8codestyle/md/check/itests/ConfigurationDataLockTest.java index 69cd37f08..342df2352 100644 --- a/tests/com.e1c.v8codestyle.md.itests/src/com/e1c/v8codestyle/md/check/itests/ConfigurationDataLockTest.java +++ b/tests/com.e1c.v8codestyle.md.itests/src/com/e1c/v8codestyle/md/check/itests/ConfigurationDataLockTest.java @@ -16,6 +16,7 @@ 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 void testDataLock() throws Exception } @Test + @Ignore("https://github.com/1C-Company/v8-code-style/issues/1375") public void testManagedDataLockMode() throws Exception { IDtProject dtProject = openProjectAndWaitForValidationFinish(PROJECT_NAME); From ace705f0b43c0997508470ea13f25b1a5097b55a Mon Sep 17 00:00:00 2001 From: Vadim Geraskin Date: Fri, 10 Nov 2023 23:27:39 +0700 Subject: [PATCH 16/27] =?UTF-8?q?feature/1373:=20=D0=98=D0=B3=D0=BD=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=B0=D0=B4=D0=B0=D1=8E=D1=89=D0=B8=D1=85=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bsl/check/itests/ServerExecutionSafeModeCheckTest.java | 2 ++ .../itests/ExportProcedureCommentDescriptionCheckTest.java | 2 ++ .../bsl/comment/check/itests/RefLinkPartCheckTest.java | 2 ++ 3 files changed, 6 insertions(+) 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 d834a122d..85637ee6b 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.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 void testCommonModule() throws Exception * @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 9a99484a6..f17bce192 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 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 void testFunctionHasDescriptionSection() throws Exception * @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 7fc2cf882..26753ea9f 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.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 @@ protected String getModuleFileName() * @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"); From 86b2d38d4f73ac25eda3baeeafbb215c38b3cead Mon Sep 17 00:00:00 2001 From: Nikita Kuznetsov Date: Tue, 14 Nov 2023 11:34:53 +0300 Subject: [PATCH 17/27] =?UTF-8?q?G5V8DT-24189=20=D0=9F=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20?= =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=89=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B5=D0=B3=D0=BE=20=D0=B2=20=D1=81=D0=BE=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BE=D0=B1=D0=BB=D0=B0=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code style fixes --- .../bsl/ui/services/BslModuleRegionsInfo.java | 15 ++++++++++++--- .../services/BslModuleRegionsInfoService.java | 19 ++++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) 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 index da347fe49..811568fa6 100644 --- 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 @@ -1,6 +1,15 @@ -/** - * Copyright (C) 2023, 1C - */ +/******************************************************************************* + * 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 com._1c.g5.v8.dt.bsl.common.IBslModuleTextInsertInfo; 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 index 4f2dfdb4a..91e89b485 100644 --- 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 @@ -59,12 +59,12 @@ public IBslModuleTextInsertInfo getEventHandlerTextInsertInfo(IXtextDocument doc { return () -> defaultPosition; } - URI moduleResourceURI = module.eResource().getURI(); + URI moduleResourceUri = module.eResource().getURI(); IResourceServiceProvider rsp = - IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(moduleResourceURI); + IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(moduleResourceUri); IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class); BslOwnerComputerService bslOwnerComputerService = rsp.get(BslOwnerComputerService.class); - IV8Project project = projectManager.getProject(moduleResourceURI); + IV8Project project = projectManager.getProject(moduleResourceUri); EClass moduleOwner = bslOwnerComputerService.computeOwnerEClass(module); EObject eventOwner = data.getEventOwner(); BslModuleEventData regionData = (BslModuleEventData)data; @@ -94,12 +94,12 @@ public String wrap(IBslModuleTextInsertInfo moduleTextInsertInfo, String content String regionName = moduleRegionInformation.getRegionName(); if (module != null && regionName != null) { - URI moduleResourceURI = module.eResource().getURI(); + URI moduleResourceUri = module.eResource().getURI(); IResourceServiceProvider rsp = - IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(moduleResourceURI); + IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(moduleResourceUri); IV8ProjectManager projectManager = rsp.get(IV8ProjectManager.class); BslGeneratorMultiLangProposals proposals = rsp.get(BslGeneratorMultiLangProposals.class); - IV8Project project = projectManager.getProject(moduleResourceURI); + IV8Project project = projectManager.getProject(moduleResourceUri); String lineSeparator = PreferenceUtils.getLineSeparator(project.getProject()); proposals.setRussianLang(ScriptVariant.RUSSIAN.equals(project.getScriptVariant())); String beginRegion = proposals.getBeginRegionPropStr(); @@ -285,11 +285,12 @@ private String getSuffix(EObject eventOwner, EventItemType itemType) { if (itemType.equals(EventItemType.TABLE)) { - while ((eventOwner = eventOwner.eContainer()) != null) + EObject container; + while ((container = eventOwner.eContainer()) != null) { - if (eventOwner.eClass() == FormPackage.Literals.TABLE) + if (container.eClass() == FormPackage.Literals.TABLE) { - return ((NamedElement)eventOwner).getName(); + return ((NamedElement)container).getName(); } } } From b76fb972545856b8faed75b0d5d9f2ad683ffb35 Mon Sep 17 00:00:00 2001 From: Vadim Geraskin Date: Wed, 15 Nov 2023 18:36:45 +0700 Subject: [PATCH 18/27] =?UTF-8?q?1378:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20NPE=20=D0=B2=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bsl/ui/qfix/OpenBslDocCommentViewFix.java | 14 ++++++++------ .../check/ExportProcedureMissingCommentCheck.java | 2 +- .../bsl/check/ModuleStructureTopRegionCheck.java | 6 +++++- .../TypedValueAddingToUntypedCollectionCheck.java | 5 ++++- .../v8codestyle/right/check/RoleRightSetCheck.java | 10 ++++++++-- 5 files changed, 26 insertions(+), 11 deletions(-) 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 f64cedb04..97fc2cb83 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 @@ protected void configureFix(FixConfigurer configurer) @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 @@ protected TextEdit fixIssue(XtextResource state, IXtextBslModuleFixModel model) } }); + 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/src/com/e1c/v8codestyle/bsl/check/ExportProcedureMissingCommentCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ExportProcedureMissingCommentCheck.java index f7cfb7a28..96297bc02 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 @@ && isMethodHasNoComment(NodeModelUtils.findActualNodeFor(method))) 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 a6053573b..027d32138 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 @@ private void countDoublesAndFindTopRegions(List allRegions, 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 @@ private boolean isExcludeName(String regionName, String[] regionNames) { 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/strict/check/TypedValueAddingToUntypedCollectionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/strict/check/TypedValueAddingToUntypedCollectionCheck.java index 1b5a5be80..382a6fcfd 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 @@ -207,7 +207,10 @@ private Collection getActualCollectionTypes(FeatureAccess fa, Collecti } 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.right/src/com/e1c/v8codestyle/right/check/RoleRightSetCheck.java b/bundles/com.e1c.v8codestyle.right/src/com/e1c/v8codestyle/right/check/RoleRightSetCheck.java index f6d588aa9..36cf88725 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 @@ -324,12 +324,18 @@ private String getMdObjectName(MdObject mdObject, IV8Project project) return "Unknown"; //$NON-NLS-1$ } - if (project != null && project.getScriptVariant() == ScriptVariant.RUSSIAN) + if (project != null && project.getScriptVariant() == ScriptVariant.RUSSIAN + && MdUtil.getFullyQualifiedNameRu(mdObject) != null) { return MdUtil.getFullyQualifiedNameRu(mdObject).toString(); } - return MdUtil.getFullyQualifiedName(mdObject).toString(); + if (MdUtil.getFullyQualifiedName(mdObject) != null) + { + return MdUtil.getFullyQualifiedName(mdObject).toString(); + } + + return "Unknown"; //$NON-NLS-1$ } private Collection getDefaultObjectsWithRight(RoleDescription description, IProgressMonitor monitor) From edbf787291fbc365dc2bacc2402be11be9efa9cb Mon Sep 17 00:00:00 2001 From: Vadim Geraskin Date: Tue, 28 Nov 2023 15:43:00 +0700 Subject: [PATCH 19/27] =?UTF-8?q?1378:=20=D0=98=D0=B3=D0=BD=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B0=20RedundantExportMethodCheckTest.testCallNoP?= =?UTF-8?q?ublic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bsl/check/itests/RedundantExportMethodCheckTest.java | 2 ++ 1 file changed, 2 insertions(+) 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 7e4c28683..50f204ad4 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.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 void testNoCallPublic() throws Exception } @Test + @Ignore public void testCallNoPublic() throws Exception { List markers = getMarkers(MODULE_CALL_NO_PUBLIC_FILE_NAME); From 2cdfa79071ef3a503d41916ec968c875f2a0a546 Mon Sep 17 00:00:00 2001 From: Vadim Geraskin Date: Wed, 29 Nov 2023 13:00:12 +0700 Subject: [PATCH 20/27] =?UTF-8?q?1378:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BC=D0=B5?= =?UTF-8?q?=D1=87=D0=B0=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../right/check/RoleRightSetCheck.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) 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 36cf88725..831d678fb 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.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; @@ -319,20 +320,24 @@ private String getRightName(IV8Project project) 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 - && MdUtil.getFullyQualifiedNameRu(mdObject) != null) + if (project.getScriptVariant() == ScriptVariant.RUSSIAN) { - return MdUtil.getFullyQualifiedNameRu(mdObject).toString(); + QualifiedName fqn = MdUtil.getFullyQualifiedNameRu(mdObject); + if (fqn != null) + { + return fqn.toString(); + } } - if (MdUtil.getFullyQualifiedName(mdObject) != null) + QualifiedName fqn = MdUtil.getFullyQualifiedName(mdObject); + if (fqn != null) { - return MdUtil.getFullyQualifiedName(mdObject).toString(); + return fqn.toString(); } return "Unknown"; //$NON-NLS-1$ From c9d070c46fc9ea536e94828aa0360c25c2ced93f Mon Sep 17 00:00:00 2001 From: Almaz Nasibullin Date: Tue, 19 Dec 2023 17:24:40 +0300 Subject: [PATCH 21/27] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20tycho=20=D0=B4=D0=BE=20=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=81=D0=B8=D0=B8=202.7.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bom/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index f7694b7a9..d58b89aa4 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -28,8 +28,8 @@ - 2.2.0 - 2.2.0 + 2.7.0 + 2.7.0 2.3.1 ${project.basedir} @@ -48,7 +48,7 @@ 'v'yyyyMMdd-HHmm ${maven.build.timestamp} - http://download.eclipse.org/releases/2020-06/ + http://download.eclipse.org/releases/2022-03/ false 0.8.6 From 1d84d40fb098178a02956b1ffec9c048f85862b4 Mon Sep 17 00:00:00 2001 From: Almaz Nasibullin Date: Wed, 20 Dec 2023 10:31:19 +0300 Subject: [PATCH 22/27] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B1=D0=BB?= =?UTF-8?q?=D0=B5=D0=BC=D1=8B=20=D1=81=20equinox.ds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pom.xml b/pom.xml index 509c38075..a6ec4b08f 100644 --- a/pom.xml +++ b/pom.xml @@ -49,6 +49,21 @@ ${project.name} Repository + + + org.eclipse.tycho + target-platform-configuration + + + + + eclipse-plugin + org.eclipse.equinox.ds + 0.0.0 + + + + From f2fedde4de46db0872160b7e3e2f0c762bb06642 Mon Sep 17 00:00:00 2001 From: Dmitriy Marmyshev Date: Fri, 22 Dec 2023 20:58:39 -0800 Subject: [PATCH 23/27] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B8=D1=81=D1=82=D0=BE=D1=80=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee895b400..57aa0a91c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## 0.7.0 +Выпуск бета-версии для 1C:EDT 2023.3 ### Новые проверки From 10e69007b5630e5dad8ee23bd339637125d81b98 Mon Sep 17 00:00:00 2001 From: Dzyuba Maksim Date: Fri, 19 Jan 2024 09:19:43 +0300 Subject: [PATCH 24/27] =?UTF-8?q?G5V8DT-24674=20=D0=92=D0=B7=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4=D0=B8=D1=82=D1=81=D1=8F=20=D0=BF=D1=80=D0=B8=D0=B7=D0=BD?= =?UTF-8?q?=D0=B0=D0=BA=20=D0=BD=D0=B0=D0=BB=D0=B8=D1=87=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=20=D0=BA=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87?= =?UTF-8?q?=D0=B8=D0=BA=D1=83=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml | 2 +- .../ui/services/BslModuleRegionsInfoService.java | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml index 16fe132ec..cfc9cebab 100644 --- a/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml +++ b/bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml @@ -371,7 +371,7 @@ + class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.internal.bsl.ui.services.BslModuleRegionsInfoService"> 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 index 91e89b485..94bc1ef30 100644 --- 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 @@ -41,7 +41,9 @@ 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} @@ -51,6 +53,9 @@ public class BslModuleRegionsInfoService implements IBslModuleTextInsertInfoService { + @Inject + private IModuleStructureProvider moduleStructureProvider; + @Override public IBslModuleTextInsertInfo getEventHandlerTextInsertInfo(IXtextDocument document, Module module, int defaultPosition, IBslModuleEventData data) @@ -77,7 +82,8 @@ public IBslModuleTextInsertInfo getEventHandlerTextInsertInfo(IXtextDocument doc getRegionOffsets(document, regionPreprocessors, declaredRegionName, scriptVariant); int offset = getRegionOffset(regionOffsets, declaredRegionName, suffix, defaultPosition, scriptVariant); String regionName = null; - if (!isRegionExists(regionOffsets, declaredRegionName, suffix)) + if (!isRegionExists(regionOffsets, declaredRegionName, suffix) && project.getProject() != null + && moduleStructureProvider.canCreateStructure(project.getProject())) { regionName = suffix.isEmpty() ? declaredRegionName : (declaredRegionName + suffix); } @@ -285,13 +291,17 @@ private String getSuffix(EObject eventOwner, EventItemType itemType) { if (itemType.equals(EventItemType.TABLE)) { - EObject container; - while ((container = eventOwner.eContainer()) != null) + EObject container = eventOwner; + while (container != null) { if (container.eClass() == FormPackage.Literals.TABLE) { return ((NamedElement)container).getName(); } + else + { + container = container.eContainer(); + } } } return StringUtils.EMPTY; From 061a4a8c4ee0b5b5bed850858ff05ac962bbaac9 Mon Sep 17 00:00:00 2001 From: Dzyuba Maksim Date: Fri, 19 Jan 2024 12:01:27 +0300 Subject: [PATCH 25/27] =?UTF-8?q?G5V8DT-24674=20=D0=92=D0=B7=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4=D0=B8=D1=82=D1=81=D1=8F=20=D0=BF=D1=80=D0=B8=D0=B7=D0=BD?= =?UTF-8?q?=D0=B0=D0=BA=20=D0=BD=D0=B0=D0=BB=D0=B8=D1=87=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=20=D0=BA=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87?= =?UTF-8?q?=D0=B8=D0=BA=D1=83=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit правка тестов --- .../bsl/check/itests/SelfReferenceCheckTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 924852c6c..6a511c894 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 void testCommonModule() throws Exception 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 @@ private List getMarkers(String moduleFileName) 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()); } From ccec2bb440e645c310b90689f3ccf7fcd1ba8f85 Mon Sep 17 00:00:00 2001 From: Dzyuba Maksim Date: Tue, 6 Feb 2024 18:12:43 +0300 Subject: [PATCH 26/27] =?UTF-8?q?G5V8DT-24086=20=D0=9B=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D1=8B=D0=B5=20=D1=81=D1=80=D0=B0=D0=B1=D0=B0=D1=82=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B8=20The=20asynchronous=20method=20is=20followed=20by?= =?UTF-8?q?=20lines=20of=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/e1c/v8codestyle/bsl/check/CodeAfterAsyncCallCheck.java | 1 + 1 file changed, 1 insertion(+) 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 418a3f938..cef2f3751 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 @@ -101,6 +101,7 @@ protected void configureCheck(CheckConfigurer builder) .complexity(CheckComplexity.NORMAL) .severity(IssueSeverity.MAJOR) .issueType(IssueType.WARNING) + .disable() .extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID)) .module() .checkedObjectType(INVOCATION) From 0fefbd201f294c6de0ed768c87871f353030c10f Mon Sep 17 00:00:00 2001 From: Dzyuba Maksim Date: Wed, 7 Feb 2024 12:54:17 +0300 Subject: [PATCH 27/27] =?UTF-8?q?G5V8DT-24086=20=D0=9B=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D1=8B=D0=B5=20=D1=81=D1=80=D0=B0=D0=B1=D0=B0=D1=82=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D0=BA=D0=B8=20The=20asynchronous=20method=20is=20followed=20by?= =?UTF-8?q?=20lines=20of=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Правки по ревью --- CHANGELOG.md | 1 + .../com/e1c/v8codestyle/bsl/check/CodeAfterAsyncCallCheck.java | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9823fa00..1cfd408f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Проверка на уникальность имени поля в doc-comment-field-name #1392 - Проверка модификации ключей структуры вне функции-конструктора #1054 +- По умолчанию проверка "Код не должен следовать за асинхронным вызовом" (code-after-async-call) выключена. См. обсуждение в https://github.com/1C-Company/v8-code-style/pull/1408 #### Запросы 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 cef2f3751..e400a4004 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.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; @@ -102,7 +100,6 @@ protected void configureCheck(CheckConfigurer builder) .severity(IssueSeverity.MAJOR) .issueType(IssueType.WARNING) .disable() - .extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID)) .module() .checkedObjectType(INVOCATION) .parameter(PARAMETER_NAME, Boolean.class, DEFAULT_CHECK, Messages.CodeAfterAsyncCallCheck_Parameter);