From dcc2c41577f74b87a917298cbf76f6455dcb083a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=9A=D0=B0=D0=BF=D1=80=D0=B0=D0=BB=D0=BE=D0=B2?= Date: Sat, 18 Sep 2021 22:57:57 +0300 Subject: [PATCH] =?UTF-8?q?#458=20=D0=98=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20&=D0=98=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=D0=98=D0=9A=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D1=8C=20=D0=B2=D0=BC=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=BE=20&=D0=92=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20(#785)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../change-and-validate-instead-of-around.md | 34 +++++ .../change-and-validate-instead-of-around.md | 34 +++++ bundles/com.e1c.v8codestyle.bsl/plugin.xml | 7 +- ...ChangeAndValidateInsteadOfAroundCheck.java | 131 ++++++++++++++++++ .../e1c/v8codestyle/bsl/check/Messages.java | 7 +- .../v8codestyle/bsl/check/messages.properties | 9 +- .../bsl/check/messages_ru.properties | 9 +- ...geAndValidateInsteadOfAroundCheckTest.java | 116 ++++++++++++++++ .../ChangeAndValidateInsteadOfAround/.project | 18 +++ .../org.eclipse.core.resources.prefs | 2 + .../DT-INF/PROJECT.PMF | 2 + .../CommonModule/CommonModule.mdo | 11 ++ .../src/CommonModules/CommonModule/Module.bsl | 11 ++ .../src/Configuration/CommandInterface.cmi | 2 + .../src/Configuration/Configuration.mdo | 42 ++++++ .../MainSectionCommandInterface.cmi | 2 + .../.project | 18 +++ .../org.eclipse.core.resources.prefs | 2 + .../DT-INF/PROJECT.PMF | 3 + .../CommonModule/CommonModule.mdo | 18 +++ .../src/CommonModules/CommonModule/Module.bsl | 18 +++ .../src/Configuration/CommandInterface.cmi | 2 + .../src/Configuration/Configuration.mdo | 34 +++++ .../MainSectionCommandInterface.cmi | 2 + 25 files changed, 527 insertions(+), 8 deletions(-) create mode 100644 bundles/com.e1c.v8codestyle.bsl/markdown/change-and-validate-instead-of-around.md create mode 100644 bundles/com.e1c.v8codestyle.bsl/markdown/ru/change-and-validate-instead-of-around.md create mode 100644 bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ChangeAndValidateInsteadOfAroundCheck.java create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/ChangeAndValidateInsteadOfAroundCheckTest.java create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/.project create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/.settings/org.eclipse.core.resources.prefs create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/DT-INF/PROJECT.PMF create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/CommonModules/CommonModule/CommonModule.mdo create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/CommonModules/CommonModule/Module.bsl create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/CommandInterface.cmi create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/Configuration.mdo create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/MainSectionCommandInterface.cmi create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/.project create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/.settings/org.eclipse.core.resources.prefs create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/DT-INF/PROJECT.PMF create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/CommonModules/CommonModule/CommonModule.mdo create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/CommonModules/CommonModule/Module.bsl create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/CommandInterface.cmi create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/Configuration.mdo create mode 100644 tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/MainSectionCommandInterface.cmi diff --git a/CHANGELOG.md b/CHANGELOG.md index c2eba3e7..4a868484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - Проверка ОбменДанными.Загрузка в обработчике события - Конструкция "Попытка...Исключение...КонецПопытки" не содержит кода в исключении - Аннотация для метода написана канонически +- Используется аннотация &ИзменениеИКонтроль вместо &Вместо #### Запросы diff --git a/bundles/com.e1c.v8codestyle.bsl/markdown/change-and-validate-instead-of-around.md b/bundles/com.e1c.v8codestyle.bsl/markdown/change-and-validate-instead-of-around.md new file mode 100644 index 00000000..dfcb3ec5 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl/markdown/change-and-validate-instead-of-around.md @@ -0,0 +1,34 @@ +# Use pragma &ChangeAndControl instead of &Around + +Starting with the platform 8.3.16, you can use pragma &ChangeAndControl instead of pragma &Around in cases where there is no ProceedWithCall call inside the method + +## Noncompliant Code Example + +```bsl +&Around("MyFunction") +Function Ext1_MyFunction() + + //Return 1; + Return 2; + +EndFunction +``` + +## Compliant Solution + +```bsl +&ChangeAndValidate("MyFunction") +Function Ext1_MyFunction() + + #Delete + Return 1; + #EndDelete + #Insert + Return 2; + #EndInsert + +EndFunction +``` + +## See + diff --git a/bundles/com.e1c.v8codestyle.bsl/markdown/ru/change-and-validate-instead-of-around.md b/bundles/com.e1c.v8codestyle.bsl/markdown/ru/change-and-validate-instead-of-around.md new file mode 100644 index 00000000..720d9d9d --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl/markdown/ru/change-and-validate-instead-of-around.md @@ -0,0 +1,34 @@ +# Используется аннотация &ИзменениеИКонтроль вместо &Вместо + +Начиная с релиза платформы 8.3.16, можно использовать аннотацию &ИзменениеИКонтроль вместо аннотации &Вместо в тех случаях, когда внутри метода отсутствует вызов ПродолжитьВызов + +## Неправильно + +```bsl +&Вместо("МояФункция") +Функция Расш1_МояФункция() + + //Возврат 1; + Возврат 2; + +КонецФункции +``` + +## Правильно + +```bsl +&ИзменениеИКонтроль("МояФункция") +Функция Расш1_МояФункция() + + #Удаление + Возврат 1; + #КонецУдаления + #Вставка + Возврат 2; + #КонецВставки + +КонецФункции +``` + +## См. + diff --git a/bundles/com.e1c.v8codestyle.bsl/plugin.xml b/bundles/com.e1c.v8codestyle.bsl/plugin.xml index 96223523..772fdf90 100644 --- a/bundles/com.e1c.v8codestyle.bsl/plugin.xml +++ b/bundles/com.e1c.v8codestyle.bsl/plugin.xml @@ -11,8 +11,7 @@ Contributors: 1C-Soft LLC - initial API and implementation - Aleksandr Kapralov - issue #17 - Aleksandr Kapralov - issue #449 + Aleksandr Kapralov - issue #17, #449, #458 --> @@ -46,6 +45,10 @@ category="com.e1c.v8codestyle.bsl" class="com.e1c.v8codestyle.internal.bsl.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.check.CanonicalPragmaCheck"> + + diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ChangeAndValidateInsteadOfAroundCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ChangeAndValidateInsteadOfAroundCheck.java new file mode 100644 index 00000000..b10a2740 --- /dev/null +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ChangeAndValidateInsteadOfAroundCheck.java @@ -0,0 +1,131 @@ +/******************************************************************************* + * Copyright (C) 2021, 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: + * Aleksandr Kapralov - initial API and implementation + *******************************************************************************/ +package com.e1c.v8codestyle.bsl.check; + +import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.PRAGMA; +import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.PRAGMA__SYMBOL; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.xtext.EcoreUtil2; + +import com._1c.g5.v8.dt.bsl.common.Symbols; +import com._1c.g5.v8.dt.bsl.model.Method; +import com._1c.g5.v8.dt.bsl.model.Pragma; +import com._1c.g5.v8.dt.bsl.model.StaticFeatureAccess; +import com._1c.g5.v8.dt.lcore.util.CaseInsensitiveString; +import com._1c.g5.v8.dt.platform.version.IRuntimeVersionSupport; +import com._1c.g5.v8.dt.platform.version.Version; +import com.e1c.g5.v8.dt.check.CheckComplexity; +import com.e1c.g5.v8.dt.check.ICheckParameters; +import com.e1c.g5.v8.dt.check.components.BasicCheck; +import com.e1c.g5.v8.dt.check.settings.IssueSeverity; +import com.e1c.g5.v8.dt.check.settings.IssueType; +import com.google.inject.Inject; + +/** + * Checks that pragma &ChangeAndControl is used when there is no call ProceedWithCall + * + * @author Aleksandr Kapralov + * + */ +public class ChangeAndValidateInsteadOfAroundCheck + extends BasicCheck +{ + private static final String CHECK_ID = "change-and-validate-instead-of-around"; //$NON-NLS-1$ + + private static final String PROCEED_WITH_CALL = "ProceedWithCall"; //$NON-NLS-1$ + private static final String PROCEED_WITH_CALL_RUS = "ПродолжитьВызов"; //$NON-NLS-1$ + + private final IRuntimeVersionSupport versionSupport; + + /** + * Creates new instance which helps to check &Around pragma. + * + * @param versionSupport runtime version support manager, cannot be {@code null}. + */ + @Inject + public ChangeAndValidateInsteadOfAroundCheck(IRuntimeVersionSupport versionSupport) + { + super(); + + this.versionSupport = versionSupport; + } + + @Override + public String getCheckId() + { + return CHECK_ID; + } + + @Override + protected void check(Object object, ResultAcceptor resultAceptor, ICheckParameters parameters, + IProgressMonitor monitor) + { + if (monitor.isCanceled()) + { + return; + } + + Pragma pragma = (Pragma)object; + + if (!Symbols.AROUND_ANNOTATION_SYMBOLS.contains(new CaseInsensitiveString(pragma.getSymbol()))) + { + return; + } + + Version platformVersion = versionSupport.getRuntimeVersionOrDefault(pragma, Version.LATEST); + if (platformVersion.isLessThan(Version.V8_3_16)) + { + return; + } + + Method method = EcoreUtil2.getContainerOfType(pragma, Method.class); + + if (method == null) + { + return; + } + + boolean hasProceedWithCall = false; + for (StaticFeatureAccess sfa : EcoreUtil2.eAllOfType(method, StaticFeatureAccess.class)) + { + String featureName = sfa.getName(); + if (PROCEED_WITH_CALL.equalsIgnoreCase(featureName) || PROCEED_WITH_CALL_RUS.equalsIgnoreCase(featureName)) + { + hasProceedWithCall = true; + break; + } + } + + if (!hasProceedWithCall) + { + resultAceptor.addIssue( + Messages.ChangeAndValidateInsteadOfAroundCheck_Use_ChangeAndValidate_instead_of_Around, pragma, + PRAGMA__SYMBOL); + } + + } + + @Override + protected void configureCheck(CheckConfigurer configurer) + { + configurer.title(Messages.ChangeAndValidateInsteadOfAroundCheck_title) + .description(Messages.ChangeAndValidateInsteadOfAroundCheck_description) + .complexity(CheckComplexity.NORMAL) + .severity(IssueSeverity.TRIVIAL) + .issueType(IssueType.CODE_STYLE) + .module() + .checkedObjectType(PRAGMA); + } + +} diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/Messages.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/Messages.java index 0692f426..4ca92193 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/Messages.java +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/Messages.java @@ -9,8 +9,7 @@ * * Contributors: * 1C-Soft LLC - initial API and implementation - * Aleksandr Kapralov - issue #17 - * Aleksandr Kapralov - issue #449 + * Aleksandr Kapralov - issue #17, #449, #458 *******************************************************************************/ package com.e1c.v8codestyle.bsl.check; @@ -29,6 +28,10 @@ final class Messages public static String CanonicalPragmaCheck_Pragma_0_is_not_written_canonically_correct_spelling_is_1; public static String CanonicalPragmaCheck_title; + public static String ChangeAndValidateInsteadOfAroundCheck_description; + public static String ChangeAndValidateInsteadOfAroundCheck_Use_ChangeAndValidate_instead_of_Around; + public static String ChangeAndValidateInsteadOfAroundCheck_title; + public static String EmptyExceptStatementCheck_description; public static String EmptyExceptStatementCheck_title; diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties index 0c7e6b93..6cc76061 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties @@ -10,9 +10,8 @@ # # Contributors: # 1C-Soft LLC - initial API and implementation -# Aleksandr Kapralov - issue #17 +# Aleksandr Kapralov - issue #17, #449, #458 # Viktor Gukov - issue #394 -# Aleksandr Kapralov - issue #449 ############################################################################### CanonicalPragmaCheck_Pragma_0_is_not_written_canonically_correct_spelling_is_1 = Annotation {0} is not written canonically, correct spelling is {1} @@ -21,6 +20,12 @@ CanonicalPragmaCheck_description = Check pragma is written canonically CanonicalPragmaCheck_title = Pragma is written canonically +ChangeAndValidateInsteadOfAroundCheck_Use_ChangeAndValidate_instead_of_Around = It's recommended to use pragma &ChangeAndControl instead of &Around + +ChangeAndValidateInsteadOfAroundCheck_description = Checks that pragma &ChangeAndControl is used when there is no call ProceedWithCall + +ChangeAndValidateInsteadOfAroundCheck_title = Use pragma &ChangeAndControl instead of &Around + EmptyExceptStatementCheck_description = Empty except statement EmptyExceptStatementCheck_title = Empty except statement diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages_ru.properties b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages_ru.properties index 79f96187..368febd8 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages_ru.properties +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages_ru.properties @@ -10,9 +10,8 @@ # # Contributors: # 1C-Soft LLC - initial API and implementation -# Aleksandr Kapralov - issue #17 +# Aleksandr Kapralov - issue #17, #449, #458 # Viktor Gukov - issue #394 -# Aleksandr Kapralov - issue #449 ############################################################################### CanonicalPragmaCheck_Pragma_0_is_not_written_canonically_correct_spelling_is_1 = Аннотация {0} написана неканонически, правильное написание {1} @@ -21,6 +20,12 @@ CanonicalPragmaCheck_description = Проверяет что аннотация CanonicalPragmaCheck_title = Аннотация написана канонически +ChangeAndValidateInsteadOfAroundCheck_Use_ChangeAndValidate_instead_of_Around = Рекомендуется использовать аннотацию &ИзменениеИКонтроль вместо &Вместо + +ChangeAndValidateInsteadOfAroundCheck_description = Проверяет, что при отсутствии вызова ПродолжитьВызов используется аннотация &ИзменениеИКонтроль + +ChangeAndValidateInsteadOfAroundCheck_title = Используется аннотация &ИзменениеИКонтроль вместо &Вместо + EmptyExceptStatementCheck_description = "Попытка...Исключение" не содержит кода в исключении EmptyExceptStatementCheck_title = "Попытка...Исключение" не содержит кода в исключении diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/ChangeAndValidateInsteadOfAroundCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/ChangeAndValidateInsteadOfAroundCheckTest.java new file mode 100644 index 00000000..46f14e46 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/ChangeAndValidateInsteadOfAroundCheckTest.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (C) 2021, 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: + * Aleksandr Kapralov - initial API and implementation + *******************************************************************************/ +package com.e1c.v8codestyle.bsl.check.itests; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.text.MessageFormat; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.resources.IProject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.xtext.EcoreUtil2; +import org.junit.Test; + +import com._1c.g5.v8.bm.core.IBmObject; +import com._1c.g5.v8.dt.bsl.model.Method; +import com._1c.g5.v8.dt.bsl.model.Module; +import com._1c.g5.v8.dt.bsl.model.Pragma; +import com._1c.g5.v8.dt.core.platform.IDtProject; +import com._1c.g5.v8.dt.metadata.mdclass.CommonModule; +import com._1c.g5.v8.dt.validation.marker.IExtraInfoKeys; +import com._1c.g5.v8.dt.validation.marker.Marker; +import com.e1c.g5.v8.dt.testing.check.CheckTestBase; +import com.e1c.v8codestyle.bsl.check.ChangeAndValidateInsteadOfAroundCheck; + +/** + * Tests for {@link ChangeAndValidateInsteadOfAroundCheck} check. + * + * @author Aleksandr Kapralov + */ +public class ChangeAndValidateInsteadOfAroundCheckTest + extends CheckTestBase +{ + + private static final String PROJECT_NAME = "ChangeAndValidateInsteadOfAround"; + private static final String EXTENSION_NAME = "ChangeAndValidateInsteadOfAroundExtension"; + + private static final String CHECK_ID = "change-and-validate-instead-of-around"; //$NON-NLS-1$ + + @Test + public void testChangeAndValidateInsteadOfAround() throws Exception + { + IProject project = testingWorkspace.setUpProject(PROJECT_NAME, getClass()); + IDtProject dtProject = dtProjectManager.getDtProject(project); + assertNotNull(dtProject); + + dtProject = openProjectAndWaitForValidationFinish(EXTENSION_NAME); + assertNotNull(dtProject); + + IBmObject mdObject = getTopObjectByFqn("CommonModule.CommonModule", dtProject); + assertTrue(mdObject instanceof CommonModule); + Module module = ((CommonModule)mdObject).getModule(); + assertNotNull(module); + + String id = module.eResource().getURI().toPlatformString(true); + Marker[] markers = markerManager.getMarkers(dtProject.getWorkspaceProject(), id); + assertNotNull(markers); + + Set uriErrors = new HashSet<>(); + + for (Method method : module.allMethods()) + { + List pragmaList = EcoreUtil2.eAllOfType(method, Pragma.class); + + switch (method.getName()) + { + case "Ext_MyFunction": + { + // Those methods doesn't have errors + break; + } + + case "Ext_MyProcedure": + { + assertEquals(1, pragmaList.size()); + uriErrors.add(EcoreUtil.getURI(pragmaList.get(0)).toString()); + break; + } + default: + { + throw new IllegalStateException(MessageFormat.format("Unknown method name {0}", method.getName())); + } + } + } + + for (Marker marker : markers) + { + String checkUid = getCheckIdFromMarker(marker, dtProject); + assertNotNull(checkUid); + if (!CHECK_ID.equals(checkUid)) + { + continue; + } + + String uriToProblem = marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_URI_TO_PROBLEM_KEY); + assertTrue(uriErrors.contains(uriToProblem)); + uriErrors.remove(uriToProblem); + } + + assertEquals(0, uriErrors.size()); + } +} diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/.project b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/.project new file mode 100644 index 00000000..6026ffa7 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/.project @@ -0,0 +1,18 @@ + + + ChangeAndValidateInsteadOfAround + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.eclipse.xtext.ui.shared.xtextNature + com._1c.g5.v8.dt.core.V8ConfigurationNature + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/.settings/org.eclipse.core.resources.prefs b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/DT-INF/PROJECT.PMF b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/DT-INF/PROJECT.PMF new file mode 100644 index 00000000..6835f1cd --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/DT-INF/PROJECT.PMF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Runtime-Version: 8.3.19 diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/CommonModules/CommonModule/CommonModule.mdo b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/CommonModules/CommonModule/CommonModule.mdo new file mode 100644 index 00000000..cc3ecc3d --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/CommonModules/CommonModule/CommonModule.mdo @@ -0,0 +1,11 @@ + + + CommonModule + + en + Common module + + true + true + true + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/CommonModules/CommonModule/Module.bsl b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/CommonModules/CommonModule/Module.bsl new file mode 100644 index 00000000..467d7b60 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/CommonModules/CommonModule/Module.bsl @@ -0,0 +1,11 @@ +Procedure MyProcedure(Param) Export + + Param = 1; + +EndProcedure + +Function MyFunction() Export + + Return 1; + +EndFunction \ No newline at end of file diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/CommandInterface.cmi b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/CommandInterface.cmi new file mode 100644 index 00000000..0cf6de8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/CommandInterface.cmi @@ -0,0 +1,2 @@ + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/Configuration.mdo b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/Configuration.mdo new file mode 100644 index 00000000..6b33a493 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/Configuration.mdo @@ -0,0 +1,42 @@ + + + ChangeAndValidateInsteadOfAround + + en + Change and validate instead of around + + + + + + + + + 8.3.19 + ManagedApplication + PersonalComputer + + + true + + + OSBackup + true + + + Language.English + Managed + NotAutoFree + DontUse + DontUse + 8.3.19 + + English + + en + English + + en + + CommonModule.CommonModule + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/MainSectionCommandInterface.cmi b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/MainSectionCommandInterface.cmi new file mode 100644 index 00000000..0cf6de8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAround/src/Configuration/MainSectionCommandInterface.cmi @@ -0,0 +1,2 @@ + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/.project b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/.project new file mode 100644 index 00000000..d509354d --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/.project @@ -0,0 +1,18 @@ + + + ChangeAndValidateInsteadOfAroundExtension + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.eclipse.xtext.ui.shared.xtextNature + com._1c.g5.v8.dt.core.V8ExtensionNature + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/.settings/org.eclipse.core.resources.prefs b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..99f26c02 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/DT-INF/PROJECT.PMF b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/DT-INF/PROJECT.PMF new file mode 100644 index 00000000..611d3158 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/DT-INF/PROJECT.PMF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Runtime-Version: 8.3.19 +Base-Project: ChangeAndValidateInsteadOfAround diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/CommonModules/CommonModule/CommonModule.mdo b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/CommonModules/CommonModule/CommonModule.mdo new file mode 100644 index 00000000..6dcc366c --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/CommonModules/CommonModule/CommonModule.mdo @@ -0,0 +1,18 @@ + + + CommonModule + Adopted + + Checked + Extended + Checked + Checked + Checked + Checked + Checked + Checked + + true + true + true + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/CommonModules/CommonModule/Module.bsl b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/CommonModules/CommonModule/Module.bsl new file mode 100644 index 00000000..4459189a --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/CommonModules/CommonModule/Module.bsl @@ -0,0 +1,18 @@ +&Around("MyProcedure") +Procedure Ext_MyProcedure(Param) Export + + //Param = 1; + Param = 2; + +EndProcedure + +&Around("MyFunction") +Function Ext_MyFunction() Export + + Result = ProceedWithCall(); + + Result = Result + 1; + + Return Result; + +EndFunction \ No newline at end of file diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/CommandInterface.cmi b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/CommandInterface.cmi new file mode 100644 index 00000000..0cf6de8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/CommandInterface.cmi @@ -0,0 +1,2 @@ + + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/Configuration.mdo b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/Configuration.mdo new file mode 100644 index 00000000..b94b8b28 --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/Configuration.mdo @@ -0,0 +1,34 @@ + + + ChangeAndValidateInsteadOfAroundExtension + + en + Change and validate instead of around extension + + Adopted + + Checked + Checked + Extended + Extended + Checked + Checked + Extended + Extended + + + + + + + + + true + Ext_ + 8.3.19 + Customization + ManagedApplication + PersonalComputer + 8.3.19 + CommonModule.CommonModule + diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/MainSectionCommandInterface.cmi b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/MainSectionCommandInterface.cmi new file mode 100644 index 00000000..0cf6de8a --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/ChangeAndValidateInsteadOfAroundExtension/src/Configuration/MainSectionCommandInterface.cmi @@ -0,0 +1,2 @@ + +