1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2024-11-28 09:33:06 +02:00

#107 Добавлена проверка переменных расширений (#1130)

* Добавлена проверка переменных расширений
This commit is contained in:
Artem Iliukhin 2022-10-27 11:00:31 +03:00 committed by GitHub
parent 73e615d97d
commit f36ed1ce5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 1022 additions and 2 deletions

View File

@ -18,6 +18,7 @@
#### Код модулей
- Добавление типизированного значения в не типизированную коллекцию
- Проверка наличия префикса расширения в имени переменной расширения
- Проверка наличия префикса расширения в методе расширения.
- Устаревшая процедура (функция) расположена вне области "УстаревшиеПроцедурыИФункции"
- Использован обработчик событий, подключаемый из кода и не содержащий префикса "Подключаемый_"

View File

@ -0,0 +1,24 @@
# Extension variable does not have extension prefix
All added objects (methods and objects, reports, processes and subsystems, and event handlers) of the extension,
as well as the names of native methods and variables of extension modules, must have a prefix corresponding
to the prefix of the extension itself.
## Noncompliant Code Example
```bsl
&Before("NonComplient")
Procedure Ext1_NonComplient()
Ext_Variable = True;
EndProcedure
```
## Compliant Solution
```bsl
&After("Complient")
Procedure Ext1_Complient()
Ext1_Variable = True;
EndProcedure
```
## See

View File

@ -0,0 +1,28 @@
# У имени переменной отсутствует префикс расширения
Все добавленные объекты (методы и объекты, отчеты, обработки и подсистемы, а также обработчики событий) расширения,
а также имена собственных методов и переменных расширяющих модулей, должны иметь префикс,
соответствующий префиксу самого расширения.
## Неправильно
```bsl
&Before("NonComplient")
Процедура Ext1_НеправильныйМетод()
Ext_Переменная = Истина;
КонецПроцедуры
```
## Правильно
```bsl
&After("Complient")
Процедура Ext1_ПравильныйМетод()
Ext1_Переменная = Истина;
КонецПроцедуры
```
## См.
- [Требования к программным продуктам](https://1c.ru/rus/products/1c/predpr/compat/soft/requirements.htm)

View File

@ -311,6 +311,10 @@
category="com.e1c.v8codestyle.bsl"
class="com.e1c.v8codestyle.internal.bsl.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.check.ModuleStructureVariablesInRegionCheck">
</check>
<check
category="com.e1c.v8codestyle.bsl"
class="com.e1c.v8codestyle.internal.bsl.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.check.ExtensionVariablePrefixCheck">
</check>
<check
category="com.e1c.v8codestyle.bsl"
class="com.e1c.v8codestyle.internal.bsl.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.check.ExtensionMethodPrefixCheck">

View File

@ -25,7 +25,7 @@ import com.e1c.g5.v8.dt.check.ICheckParameters;
import com.e1c.g5.v8.dt.check.components.IBasicCheckExtension;
/**
* Filters a module owner is it was adopted on precheck phase extension.
* Filters a module owner is it was adopted on precheck phase extension.
*
* @author Artem Iliukhin
*/
@ -61,4 +61,4 @@ public class AdoptedModuleOwnerExtension
}
return false;
}
}
}

View File

@ -0,0 +1,147 @@
/*******************************************************************************
* 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.bsl.check;
import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.DECLARE_STATEMENT;
import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.EXPLICIT_VARIABLE;
import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.IMPLICIT_VARIABLE;
import static com._1c.g5.v8.dt.bsl.model.BslPackage.Literals.SIMPLE_STATEMENT;
import java.text.MessageFormat;
import org.eclipse.core.runtime.IProgressMonitor;
import com._1c.g5.v8.dt.bsl.model.DeclareStatement;
import com._1c.g5.v8.dt.bsl.model.ExplicitVariable;
import com._1c.g5.v8.dt.bsl.model.ImplicitVariable;
import com._1c.g5.v8.dt.bsl.model.SimpleStatement;
import com._1c.g5.v8.dt.bsl.model.StaticFeatureAccess;
import com._1c.g5.v8.dt.bsl.model.Variable;
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IExtensionProject;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.McorePackage;
import com.e1c.g5.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.e1c.v8codestyle.check.CommonSenseCheckExtension;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
import com.google.inject.Inject;
/**
* The variable in the module of the extension object does not have a prefix corresponding
* to the prefix of the extension itself
*
* @author Artem Iliukhin
*/
public class ExtensionVariablePrefixCheck
extends BasicCheck
{
private static final String CHECK_ID = "extension-variable-prefix"; //$NON-NLS-1$
private final IV8ProjectManager v8ProjectManager;
/**
* Instantiates a new extension variable prefix check.
*
* @param v8ProjectManager the v8 project manager, cannot be <code>null</code>
*/
@Inject
public ExtensionVariablePrefixCheck(IV8ProjectManager v8ProjectManager)
{
this.v8ProjectManager = v8ProjectManager;
}
@Override
public String getCheckId()
{
return CHECK_ID;
}
@Override
protected void configureCheck(CheckConfigurer builder)
{
builder.title(Messages.ExtensionVariablePrefixCheck_Title)
.description(Messages.ExtensionVariablePrefixCheck_Description)
.complexity(CheckComplexity.NORMAL)
.severity(IssueSeverity.MINOR)
.issueType(IssueType.CODE_STYLE)
.extension(new CommonSenseCheckExtension(getCheckId(), BslPlugin.PLUGIN_ID))
.extension(new AdoptedModuleOwnerExtension())
.module()
.checkedObjectType(IMPLICIT_VARIABLE, EXPLICIT_VARIABLE, SIMPLE_STATEMENT, DECLARE_STATEMENT);
}
@Override
protected void check(Object object, ResultAcceptor resultAceptor, ICheckParameters parameters,
IProgressMonitor monitor)
{
if (object instanceof ImplicitVariable || object instanceof ExplicitVariable)
{
checkVariable((Variable)object, resultAceptor, monitor);
}
else if (object instanceof SimpleStatement && ((SimpleStatement)object).getLeft() instanceof StaticFeatureAccess
&& ((StaticFeatureAccess)((SimpleStatement)object).getLeft()).getImplicitVariable() != null)
{
Variable variable = ((StaticFeatureAccess)((SimpleStatement)object).getLeft()).getImplicitVariable();
checkVariable(variable, resultAceptor, monitor);
}
else if (object instanceof DeclareStatement)
{
DeclareStatement declare = (DeclareStatement)object;
for (Variable variable : declare.getVariables())
{
if (monitor.isCanceled())
{
return;
}
checkVariable(variable, resultAceptor, monitor);
}
}
}
private void checkVariable(Variable variable, ResultAcceptor resultAceptor, IProgressMonitor monitor)
{
IV8Project extension = v8ProjectManager.getProject(variable);
if (extension instanceof IExtensionProject)
{
String prefix = getNamePrefix((IExtensionProject)extension);
String variableName = variable.getName();
if (monitor.isCanceled())
{
return;
}
if (!StringUtils.isEmpty(prefix) && !variableName.startsWith(prefix))
{
resultAceptor.addIssue(
MessageFormat.format(Messages.ExtensionVariablePrefixCheck_Variable_0_should_have_1_prefix,
variableName, prefix),
variable, McorePackage.Literals.NAMED_ELEMENT__NAME);
}
}
}
private String getNamePrefix(IExtensionProject extension)
{
return extension.getConfiguration().getNamePrefix();
}
}

View File

@ -140,6 +140,12 @@ final class Messages
public static String ExportMethodInCommandModule_Do_not_use_export_method_in_commands_module;
public static String ExtensionVariablePrefixCheck_Description;
public static String ExtensionVariablePrefixCheck_Title;
public static String ExtensionVariablePrefixCheck_Variable_0_should_have_1_prefix;
public static String ExtensionMethodPrefixCheck_Description;
public static String ExtensionMethodPrefixCheck_Ext_method__0__should_have__1__prefix;

View File

@ -137,6 +137,12 @@ ExportMethodInCommandModule_Do_not_emded_export_method_in_modules_of_command_res
ExportMethodInCommandModule_Do_not_use_export_method_in_commands_module=Restrictions on the use of export procedures and functions
ExtensionVariablePrefixCheck_Description=The variable in the module of the extension object does not have a prefix corresponding to the prefix of the extension itself
ExtensionVariablePrefixCheck_Title=Extension variable does not have extension prefix
ExtensionVariablePrefixCheck_Variable_0_should_have_1_prefix=The variable "{0}" should have "{1}" prefix
ExtensionMethodPrefixCheck_Description=The procedure (function) in the module of the extension object does not have a prefix corresponding to the prefix of the extension itself
ExtensionMethodPrefixCheck_Ext_method__0__should_have__1__prefix=The method "{0}" should have "{1}" prefix

View File

@ -146,6 +146,12 @@ ExportMethodInCommandModule_Do_not_emded_export_method_in_modules_of_command_res
ExportMethodInCommandModule_Do_not_use_export_method_in_commands_module=Ограничения на использование экспортных процедур и функций
ExtensionVariablePrefixCheck_Description=Переменная модуля расширения должна в имени содержать префикс расширения
ExtensionVariablePrefixCheck_Title=Переменная расширения должна содержать в имени префикс расширения
ExtensionVariablePrefixCheck_Variable_0_should_have_1_prefix=Переменная "{0}" должна иметь префикс "{1}"
ExtensionMethodPrefixCheck_Description=Имя метода не содержит префикс расширения
ExtensionMethodPrefixCheck_Ext_method__0__should_have__1__prefix=Имя метода "{0}" должно содержать префикс "{1}"

View File

@ -0,0 +1,108 @@
/*******************************************************************************
* 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.bsl.check.itests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.List;
import java.util.stream.Collectors;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.junit.Test;
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.SingleProjectReadOnlyCheckTestBase;
import com.e1c.v8codestyle.bsl.check.ExtensionVariablePrefixCheck;
import com.e1c.v8codestyle.internal.bsl.BslPlugin;
/**
* Tests for {@link ExtensionVariablePrefixCheck} check.
*
* @author Artem Iliukhin
*/
public class ExtensionVariablePrefixCheckTest
extends SingleProjectReadOnlyCheckTestBase
{
private static final String CHECK_ID = "extension-variable-prefix"; //$NON-NLS-1$
private static final String PROJECT_NAME = "ExtensionVariablePrefixCheck";
private static final String PROJECT_EXTENSION_NAME = "ExtensionVariablePrefixCheck_Extension";
private static final String COMMON_MODULE_FILE_NAME = "/src/CommonModules/CommonModule/Module.bsl";
private static final String COMMON_MODULE_COMPLIANT_FILE_NAME =
"/src/CommonModules/CompliantCommonModule/Module.bsl";
private static final String CATALOG_FORM_MODULE_FILE_NAME = "/src/Catalogs/Catalog/Forms/ItemForm/Module.bsl";
@Override
public void setUp() throws CoreException
{
IProject project = testingWorkspace.getProject(PROJECT_NAME);
if (!project.exists() || !project.isAccessible())
{
try
{
testingWorkspace.cleanUpWorkspace();
openProjectAndWaitForValidationFinish(PROJECT_NAME);
}
catch (CoreException e)
{
BslPlugin.logError(e);
}
}
super.setUp();
}
@Override
protected String getTestConfigurationName()
{
return PROJECT_EXTENSION_NAME;
}
@Test
public void testNonCompliantPrefix() throws Exception
{
List<Marker> markers = getMarkers(COMMON_MODULE_FILE_NAME);
assertFalse(markers.isEmpty());
assertEquals("4", markers.get(0).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
}
@Test
public void testCompliantPrefix() throws Exception
{
List<Marker> markers = getMarkers(COMMON_MODULE_COMPLIANT_FILE_NAME);
assertTrue(markers.isEmpty());
}
@Test
public void testDSVariablePrefix() throws Exception
{
List<Marker> markers = getMarkers(CATALOG_FORM_MODULE_FILE_NAME);
assertFalse(markers.isEmpty());
assertEquals("1", markers.get(0).getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
}
private List<Marker> getMarkers(String moduleFileName)
{
String moduleId = Path.ROOT.append(getTestConfigurationName()).append(moduleFileName).toString();
List<Marker> markers = List.of(markerManager.getMarkers(getProject().getWorkspaceProject(), moduleId));
return markers.stream()
.filter(marker -> CHECK_ID.equals(getCheckIdFromMarker(marker, getProject())))
.collect(Collectors.toList());
}
}

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ExtensionVariablePrefixCheck</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>com._1c.g5.v8.dt.core.V8ConfigurationNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -0,0 +1,2 @@
Manifest-Version: 1.0
Runtime-Version: 8.3.19

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:Catalog xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="1bfea9cd-2e7c-4bae-9b93-35404a91623e">
<producedTypes>
<objectType typeId="aa6e4113-25a9-4221-b960-8aec7ec853ee" valueTypeId="f123fb57-12f3-4c09-b1ea-cdb6669878c1"/>
<refType typeId="d675bfa3-64c5-4e4e-a9ef-1bb1e963b836" valueTypeId="7b4d0e92-cd76-468c-b386-dc34ad339135"/>
<selectionType typeId="c10b141d-0eef-4227-b05c-4af463fdab33" valueTypeId="41ec092d-23ed-4243-82e5-e543fb672ca9"/>
<listType typeId="5b1c9492-ae7b-4ce2-ba77-2e79741ab403" valueTypeId="2ea3a23f-be08-4f6c-80e5-332da92507be"/>
<managerType typeId="a603e77d-f8aa-4f8a-94f8-cbd58ab2dc8d" valueTypeId="603e5c28-cecb-4f6b-9a4d-be98a73a71cf"/>
</producedTypes>
<name>Catalog</name>
<synonym>
<key>en</key>
<value>Catalog</value>
</synonym>
<useStandardCommands>true</useStandardCommands>
<inputByString>Catalog.Catalog.StandardAttribute.Code</inputByString>
<inputByString>Catalog.Catalog.StandardAttribute.Description</inputByString>
<fullTextSearchOnInputByString>DontUse</fullTextSearchOnInputByString>
<createOnInput>Use</createOnInput>
<dataLockControlMode>Managed</dataLockControlMode>
<fullTextSearch>Use</fullTextSearch>
<levelCount>2</levelCount>
<foldersOnTop>true</foldersOnTop>
<codeLength>9</codeLength>
<descriptionLength>25</descriptionLength>
<codeType>String</codeType>
<codeAllowedLength>Variable</codeAllowedLength>
<checkUnique>true</checkUnique>
<autonumbering>true</autonumbering>
<defaultPresentation>AsDescription</defaultPresentation>
<editType>InDialog</editType>
<choiceMode>BothWays</choiceMode>
<defaultObjectForm>Catalog.Catalog.Form.ItemForm</defaultObjectForm>
<forms uuid="7e9928b9-a9a0-4eee-9db9-a3c863fb5ad7">
<name>ItemForm</name>
<synonym>
<key>en</key>
<value>Item form</value>
</synonym>
<usePurposes>PersonalComputer</usePurposes>
<usePurposes>MobileDevice</usePurposes>
</forms>
</mdclass:Catalog>

View File

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:form="http://g5.1c.ru/v8/dt/form">
<items xsi:type="form:FormField">
<name>Code</name>
<id>1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.Code</segments>
</dataPath>
<extendedTooltip>
<name>CodeExtendedTooltip</name>
<id>3</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>CodeContextMenu</name>
<id>2</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>Description</name>
<id>4</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.Description</segments>
</dataPath>
<extendedTooltip>
<name>DescriptionExtendedTooltip</name>
<id>6</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>DescriptionContextMenu</name>
<id>5</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<autoCommandBar>
<name>FormCommandBar</name>
<id>-1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<windowOpeningMode>LockOwnerWindow</windowOpeningMode>
<autoTitle>true</autoTitle>
<autoUrl>true</autoUrl>
<group>Vertical</group>
<autoFillCheck>true</autoFillCheck>
<allowFormCustomize>true</allowFormCustomize>
<enabled>true</enabled>
<showTitle>true</showTitle>
<showCloseButton>true</showCloseButton>
<attributes>
<name>Object</name>
<id>1</id>
<valueType>
<types>CatalogObject.Catalog</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
<main>true</main>
<savedData>true</savedData>
</attributes>
<commandInterface>
<navigationPanel/>
<commandBar/>
</commandInterface>
<extInfo xsi:type="form:CatalogFormExtInfo"/>
</form:Form>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="a0da0404-7fe0-445e-9824-bd6d0fa3eef6">
<name>CommonModule</name>
<synonym>
<key>en</key>
<value>Common module</value>
</synonym>
<server>true</server>
<externalConnection>true</externalConnection>
<clientOrdinaryApplication>true</clientOrdinaryApplication>
</mdclass:CommonModule>

View File

@ -0,0 +1,6 @@
Procedure NonComplient()
VariableNonComplient = True;
EndProcedure

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="65f1d887-1dd2-48ed-815b-216876798250">
<name>CompliantCommonModule</name>
<synonym>
<key>en</key>
<value>Compliant common module</value>
</synonym>
<server>true</server>
<externalConnection>true</externalConnection>
<clientOrdinaryApplication>true</clientOrdinaryApplication>
</mdclass:CommonModule>

View File

@ -0,0 +1,4 @@
Procedure Complient()
Variable = True;
EndProcedure

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:Configuration xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="8d77e1b7-954a-4df9-8f80-57eaf8cfa4e1">
<name>ExtensionVariablePrefixCheck</name>
<synonym>
<key>en</key>
<value>Extension variable prefix check</value>
</synonym>
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="daf3eea7-d1b1-45ed-a4f6-1ea1ffc2f7c0"/>
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="2ff31dc5-234e-4b51-8f41-9316d2c52f0b"/>
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="2a037e7e-0ca9-4398-a690-b767e001190b"/>
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="637a9967-95f2-41cd-96b7-959f46d08381"/>
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="648dccdb-412e-4ba7-bde7-c29dabd5a337"/>
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="4ffa4b8f-af38-4da7-9371-cb9b5a251946"/>
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="29a2af13-b16c-486c-91bd-6ddad18e220c"/>
<configurationExtensionCompatibilityMode>8.3.19</configurationExtensionCompatibilityMode>
<defaultRunMode>ManagedApplication</defaultRunMode>
<usePurposes>PersonalComputer</usePurposes>
<usedMobileApplicationFunctionalities>
<functionality>
<use>true</use>
</functionality>
<functionality>
<functionality>OSBackup</functionality>
<use>true</use>
</functionality>
</usedMobileApplicationFunctionalities>
<defaultLanguage>Language.English</defaultLanguage>
<dataLockControlMode>Managed</dataLockControlMode>
<objectAutonumerationMode>NotAutoFree</objectAutonumerationMode>
<modalityUseMode>DontUse</modalityUseMode>
<synchronousPlatformExtensionAndAddInCallUseMode>DontUse</synchronousPlatformExtensionAndAddInCallUseMode>
<compatibilityMode>8.3.19</compatibilityMode>
<languages uuid="62123561-ae57-4279-9605-3fd98cbbdc99">
<name>English</name>
<synonym>
<key>en</key>
<value>English</value>
</synonym>
<languageCode>en</languageCode>
</languages>
<commonModules>CommonModule.CommonModule</commonModules>
<commonModules>CommonModule.CompliantCommonModule</commonModules>
<catalogs>Catalog.Catalog</catalogs>
</mdclass:Configuration>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ExtensionVariablePrefixCheck_Extension</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>com._1c.g5.v8.dt.core.V8ExtensionNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Runtime-Version: 8.3.19
Base-Project: ExtensionVariablePrefixCheck

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" xmlns:mdclassExtension="http://g5.1c.ru/v8/dt/metadata/mdclass/extension" uuid="c8e18b2e-22a4-4d31-a6c8-0d00a4a2590b" extendedConfigurationObject="1bfea9cd-2e7c-4bae-9b93-35404a91623e">
<producedTypes>
<objectType typeId="c98cf770-cabd-465d-8591-7b5e5311acf3" valueTypeId="1c63d7fb-d1fe-4226-b0bc-77e498b2274c"/>
<refType typeId="8a3cd30b-f229-4f96-a72b-b1c6800e76b6" valueTypeId="bc089fc6-7eaa-45f5-b04a-7cf4d3f2a9a4"/>
<selectionType typeId="039aa0d2-6e4f-4179-aaaf-942b9c82ffea" valueTypeId="73838f36-9937-4542-8eca-4e76d32ef985"/>
<listType typeId="bae096aa-cd0a-4ce0-832f-2c26a809641b" valueTypeId="80f631c1-d98b-4556-874d-67d2173c647b"/>
<managerType typeId="6e85a621-d414-4160-ab03-6b8da78f3234" valueTypeId="c2b12b33-5c1f-43cf-b3fe-640c7895ebe9"/>
</producedTypes>
<name>Catalog</name>
<objectBelonging>Adopted</objectBelonging>
<extension xsi:type="mdclassExtension:CatalogExtension">
<extendedConfigurationObject>Checked</extendedConfigurationObject>
<defaultObjectForm>Extended</defaultObjectForm>
</extension>
<forms uuid="8a140ec1-ad2c-40d2-8ba7-3834ce952b45" extendedConfigurationObject="7e9928b9-a9a0-4eee-9db9-a3c863fb5ad7">
<name>ItemForm</name>
<objectBelonging>Adopted</objectBelonging>
<extension xsi:type="mdclassExtension:BasicFormExtension">
<extendedConfigurationObject>Checked</extendedConfigurationObject>
<form>Extended</form>
</extension>
</forms>
</mdclass:Catalog>

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:form="http://g5.1c.ru/v8/dt/form">
<items xsi:type="form:FormField">
<name>Code</name>
<id>1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.Code</segments>
</dataPath>
<extendedTooltip>
<name>CodeExtendedTooltip</name>
<id>3</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>CodeContextMenu</name>
<id>2</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>Description</name>
<id>4</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.Description</segments>
</dataPath>
<extendedTooltip>
<name>DescriptionExtendedTooltip</name>
<id>6</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>DescriptionContextMenu</name>
<id>5</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<autoCommandBar>
<name>FormCommandBar</name>
<id>-1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<windowOpeningMode>LockOwnerWindow</windowOpeningMode>
<autoTitle>true</autoTitle>
<autoUrl>true</autoUrl>
<group>Vertical</group>
<autoFillCheck>true</autoFillCheck>
<allowFormCustomize>true</allowFormCustomize>
<enabled>true</enabled>
<showTitle>true</showTitle>
<showCloseButton>true</showCloseButton>
<commandInterface>
<navigationPanel/>
<commandBar/>
</commandInterface>
<extInfo xsi:type="form:CatalogFormExtInfo"/>
</form:Form>

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<form:Form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:form="http://g5.1c.ru/v8/dt/form">
<items xsi:type="form:FormField">
<name>Code</name>
<id>1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.Code</segments>
</dataPath>
<extendedTooltip>
<name>CodeExtendedTooltip</name>
<id>3</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>CodeContextMenu</name>
<id>2</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>Description</name>
<id>4</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>Object.Description</segments>
</dataPath>
<extendedTooltip>
<name>DescriptionExtendedTooltip</name>
<id>6</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>DescriptionContextMenu</name>
<id>5</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>InputField</type>
<editMode>EnterOnInput</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:InputFieldExtInfo">
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<wrap>true</wrap>
<chooseType>true</chooseType>
<typeDomainEnabled>true</typeDomainEnabled>
<textEdit>true</textEdit>
</extInfo>
</items>
<autoCommandBar>
<name>FormCommandBar</name>
<id>-1</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<horizontalAlign>Left</horizontalAlign>
<autoFill>true</autoFill>
</autoCommandBar>
<windowOpeningMode>LockOwnerWindow</windowOpeningMode>
<autoTitle>true</autoTitle>
<autoUrl>true</autoUrl>
<group>Vertical</group>
<autoFillCheck>true</autoFillCheck>
<allowFormCustomize>true</allowFormCustomize>
<enabled>true</enabled>
<showTitle>true</showTitle>
<showCloseButton>true</showCloseButton>
<commandInterface>
<navigationPanel/>
<commandBar/>
</commandInterface>
<extInfo xsi:type="form:CatalogFormExtInfo"/>
</form:Form>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:CommonModule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" xmlns:mdclassExtension="http://g5.1c.ru/v8/dt/metadata/mdclass/extension" uuid="141aaa98-4c94-4782-95d1-a1a56aa92cf8" extendedConfigurationObject="a0da0404-7fe0-445e-9824-bd6d0fa3eef6">
<name>CommonModule</name>
<objectBelonging>Adopted</objectBelonging>
<extension xsi:type="mdclassExtension:CommonModuleExtension">
<extendedConfigurationObject>Checked</extendedConfigurationObject>
<module>Extended</module>
<global>Checked</global>
<clientManagedApplication>Checked</clientManagedApplication>
<server>Checked</server>
<externalConnection>Checked</externalConnection>
<serverCall>Checked</serverCall>
<clientOrdinaryApplication>Checked</clientOrdinaryApplication>
</extension>
<server>true</server>
<externalConnection>true</externalConnection>
<clientOrdinaryApplication>true</clientOrdinaryApplication>
</mdclass:CommonModule>

View File

@ -0,0 +1,5 @@
&After("NonComplient")
Procedure Ext1_NonComplient()
Variable = 1;
EndProcedure

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:CommonModule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" xmlns:mdclassExtension="http://g5.1c.ru/v8/dt/metadata/mdclass/extension" uuid="d250c3a4-a685-4e93-b6ea-b6b48cd22c83" extendedConfigurationObject="65f1d887-1dd2-48ed-815b-216876798250">
<name>CompliantCommonModule</name>
<objectBelonging>Adopted</objectBelonging>
<extension xsi:type="mdclassExtension:CommonModuleExtension">
<extendedConfigurationObject>Checked</extendedConfigurationObject>
<module>Extended</module>
<global>Checked</global>
<clientManagedApplication>Checked</clientManagedApplication>
<server>Checked</server>
<externalConnection>Checked</externalConnection>
<serverCall>Checked</serverCall>
<clientOrdinaryApplication>Checked</clientOrdinaryApplication>
</extension>
<server>true</server>
<externalConnection>true</externalConnection>
<clientOrdinaryApplication>true</clientOrdinaryApplication>
</mdclass:CommonModule>

View File

@ -0,0 +1,5 @@
&After("Complient")
Procedure Ext1_Complient()
Ext1_Variable = True;
EndProcedure

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" xmlns:mdclassExtension="http://g5.1c.ru/v8/dt/metadata/mdclass/extension" uuid="2903d8db-9d70-4125-b7de-353d628f3359">
<name>ExtensionVariablePrefixCheck_Extension</name>
<synonym>
<key>en</key>
<value>Extension variable prefix check extension</value>
</synonym>
<objectBelonging>Adopted</objectBelonging>
<extension xsi:type="mdclassExtension:ConfigurationExtension">
<defaultRunMode>Checked</defaultRunMode>
<usePurposes>Checked</usePurposes>
<commandInterface>Extended</commandInterface>
<mainSectionCommandInterface>Extended</mainSectionCommandInterface>
<interfaceCompatibilityMode>Checked</interfaceCompatibilityMode>
<compatibilityMode>Checked</compatibilityMode>
<defaultStyle>Extended</defaultStyle>
<defaultRoles>Extended</defaultRoles>
</extension>
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="d0bcef14-041d-4409-b538-57d68b95233e"/>
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="25697c0d-4bae-420c-86d2-98f340efa476"/>
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="c3882a96-1d0f-4646-a1a7-ea086562115e"/>
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="1afe4b88-9ecd-465d-b1fb-efded8f9d16c"/>
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="97838fa7-97cf-4f9c-9cc6-d14e83e301b6"/>
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="6c74f3ab-ce25-4a66-97de-223bc4f0a3ff"/>
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="a0773194-6ca4-459a-8660-02262f78f07d"/>
<keepMappingToExtendedConfigurationObjectsByIDs>true</keepMappingToExtendedConfigurationObjectsByIDs>
<namePrefix>Ext1_</namePrefix>
<configurationExtensionCompatibilityMode>8.3.19</configurationExtensionCompatibilityMode>
<configurationExtensionPurpose>Customization</configurationExtensionPurpose>
<defaultRunMode>ManagedApplication</defaultRunMode>
<usePurposes>PersonalComputer</usePurposes>
<defaultRoles>Role.Ext1_DefaultRole</defaultRoles>
<compatibilityMode>8.3.19</compatibilityMode>
<roles>Role.Ext1_DefaultRole</roles>
<commonModules>CommonModule.CommonModule</commonModules>
<commonModules>CommonModule.CompliantCommonModule</commonModules>
<catalogs>Catalog.Catalog</catalogs>
</mdclass:Configuration>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:Role xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="eba7d5d8-560f-420d-b998-e3c4a0655300">
<name>Ext1_DefaultRole</name>
</mdclass:Role>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Rights xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://v8.1c.ru/8.2/roles" xsi:type="Rights">
<setForNewObjects>true</setForNewObjects>
<setForAttributesByDefault>true</setForAttributesByDefault>
<independentRightsOfChildObjects>false</independentRightsOfChildObjects>
</Rights>