mirror of
https://github.com/1C-Company/v8-code-style.git
synced 2025-02-03 09:57:35 +02:00
parent
53c565caa7
commit
f3d9e180d4
@ -33,6 +33,7 @@
|
||||
- Выполнение запроса в цикле с учетом локальных вызовов в модуле
|
||||
- Проверка ОбменДанными.Загрузка в обработчике события
|
||||
- Конструкция "Попытка...Исключение...КонецПопытки" не содержит кода в исключении
|
||||
- Аннотация для метода написана канонически
|
||||
|
||||
#### Запросы
|
||||
|
||||
|
@ -15,11 +15,13 @@ Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Automatic-Module-Name: com.e1c.v8codestyle.bsl
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: com._1c.g5.v8.bm.core;version="[7.0.0,8.0.0)",
|
||||
com._1c.g5.v8.dt.bsl.common;version="[6.0.0,7.0.0)",
|
||||
com._1c.g5.v8.dt.bsl.model;version="[4.0.0,5.0.0)",
|
||||
com._1c.g5.v8.dt.bsl.model.util;version="[4.6.0,5.0.0)",
|
||||
com._1c.g5.v8.dt.bsl.resource;version="[13.0.0,14.0.0)",
|
||||
com._1c.g5.v8.dt.bsl.typesystem;version="[9.0.0,10.0.0)",
|
||||
com._1c.g5.v8.dt.bsl.util;version="[7.0.0,8.0.0)",
|
||||
com._1c.g5.v8.dt.lcore.util;version="[2.0.0,3.0.0)",
|
||||
com._1c.g5.v8.dt.mcore;version="[6.0.0,7.0.0)",
|
||||
com._1c.g5.v8.dt.mcore.util;version="[3.6.0,4.0.0)",
|
||||
com._1c.g5.v8.dt.metadata.mdclass;version="[8.0.0,9.0.0)",
|
||||
|
@ -0,0 +1,24 @@
|
||||
# Pragma is written canonically
|
||||
|
||||
Pragmas are written canonically (as in the documentation or the Syntax Helper).
|
||||
|
||||
## Noncompliant Code Example
|
||||
|
||||
```bsl
|
||||
&CHANGEandvalidate("MyFunction")
|
||||
Function Ext1_MyFunction()
|
||||
|
||||
EndFunction
|
||||
```
|
||||
|
||||
## Compliant Solution
|
||||
|
||||
```bsl
|
||||
&ChangeAndValidate("MyFunction")
|
||||
Function Ext1_MyFunction()
|
||||
|
||||
EndFunction
|
||||
```
|
||||
|
||||
## See
|
||||
|
@ -0,0 +1,33 @@
|
||||
# Аннотация написана канонически
|
||||
|
||||
Аннотации пишутся канонически (как в документации или Синтакс-помощнике).
|
||||
|
||||
## Неправильно
|
||||
|
||||
```bsl
|
||||
&ИЗМЕНЕНИЕиконтроль("МояФункция")
|
||||
Функция Расш1_МояФункция()
|
||||
|
||||
#Удаление
|
||||
Возврат 1;
|
||||
#КонецУдаления
|
||||
|
||||
КонецФункции
|
||||
```
|
||||
|
||||
## Правильно
|
||||
|
||||
```bsl
|
||||
&ИзменениеИКонтроль("МояФункция")
|
||||
Функция Расш1_МояФункция()
|
||||
|
||||
#Удаление
|
||||
Возврат 1;
|
||||
#КонецУдаления
|
||||
|
||||
КонецФункции
|
||||
```
|
||||
|
||||
## См.
|
||||
|
||||
- https://its.1c.ru/db/v8std#content:441:hdoc
|
@ -12,6 +12,7 @@
|
||||
Contributors:
|
||||
1C-Soft LLC - initial API and implementation
|
||||
Aleksandr Kapralov - issue #17
|
||||
Aleksandr Kapralov - issue #449
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
@ -24,6 +25,7 @@
|
||||
id="com.e1c.v8codestyle.bsl"
|
||||
title="%category.bsl.title">
|
||||
</category>
|
||||
|
||||
<check
|
||||
category="com.e1c.v8codestyle.bsl"
|
||||
class="com.e1c.v8codestyle.internal.bsl.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.check.StructureCtorTooManyKeysCheck">
|
||||
@ -40,6 +42,10 @@
|
||||
category="com.e1c.v8codestyle.bsl"
|
||||
class="com.e1c.v8codestyle.bsl.check.EmptyExceptStatementCheck">
|
||||
</check>
|
||||
<check
|
||||
category="com.e1c.v8codestyle.bsl"
|
||||
class="com.e1c.v8codestyle.internal.bsl.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.check.CanonicalPragmaCheck">
|
||||
</check>
|
||||
|
||||
</extension>
|
||||
|
||||
|
@ -0,0 +1,93 @@
|
||||
/*******************************************************************************
|
||||
* 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 java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
||||
import com._1c.g5.v8.dt.bsl.common.Symbols;
|
||||
import com._1c.g5.v8.dt.bsl.model.Pragma;
|
||||
import com._1c.g5.v8.dt.lcore.util.CaseInsensitiveString;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Checks the canonical spelling of method pragmas in extensions
|
||||
*
|
||||
* @author Aleksandr Kapralov
|
||||
*/
|
||||
public class CanonicalPragmaCheck
|
||||
extends BasicCheck
|
||||
{
|
||||
|
||||
private static final String CHECK_ID = "bsl-canonical-pragma"; //$NON-NLS-1$
|
||||
|
||||
private static final List<CaseInsensitiveString> PRAGMAS = List.copyOf(Symbols.ANNOTATION_SYMBOLS);
|
||||
|
||||
@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;
|
||||
|
||||
int pragmaIndex = PRAGMAS.indexOf(new CaseInsensitiveString(pragma.getSymbol()));
|
||||
if (pragmaIndex == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String canonicalSymbol = PRAGMAS.get(pragmaIndex).getString();
|
||||
|
||||
// Case sensitive string comparison
|
||||
if (!pragma.getSymbol().equals(canonicalSymbol))
|
||||
{
|
||||
String errorMessage = MessageFormat.format(
|
||||
Messages.CanonicalPragmaCheck_Pragma_0_is_not_written_canonically_correct_spelling_is_1,
|
||||
pragma.getSymbol(), canonicalSymbol);
|
||||
resultAceptor.addIssue(errorMessage, pragma, PRAGMA__SYMBOL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureCheck(CheckConfigurer configurer)
|
||||
{
|
||||
configurer.title(Messages.CanonicalPragmaCheck_title)
|
||||
.description(Messages.CanonicalPragmaCheck_description)
|
||||
.complexity(CheckComplexity.NORMAL)
|
||||
.severity(IssueSeverity.BLOCKER)
|
||||
.issueType(IssueType.ERROR)
|
||||
.module()
|
||||
.checkedObjectType(PRAGMA);
|
||||
}
|
||||
|
||||
}
|
@ -10,10 +10,8 @@
|
||||
* Contributors:
|
||||
* 1C-Soft LLC - initial API and implementation
|
||||
* Aleksandr Kapralov - issue #17
|
||||
* Aleksandr Kapralov - issue #449
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.e1c.v8codestyle.bsl.check;
|
||||
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
@ -27,33 +25,30 @@ final class Messages
|
||||
{
|
||||
private static final String BUNDLE_NAME = "com.e1c.v8codestyle.bsl.check.messages"; //$NON-NLS-1$
|
||||
|
||||
public static String CanonicalPragmaCheck_description;
|
||||
public static String CanonicalPragmaCheck_Pragma_0_is_not_written_canonically_correct_spelling_is_1;
|
||||
public static String CanonicalPragmaCheck_title;
|
||||
|
||||
public static String EmptyExceptStatementCheck_description;
|
||||
public static String EmptyExceptStatementCheck_title;
|
||||
|
||||
public static String EventDataExchangeLoadCheck_Check_at_the_beginning_of_event_handler;
|
||||
|
||||
public static String EventDataExchangeLoadCheck_description;
|
||||
|
||||
public static String EventDataExchangeLoadCheck_Function_list_that_checks_DataExchange_Load;
|
||||
|
||||
public static String EventDataExchangeLoadCheck_Mandatory_checking_of_DataExchangeLoad_is_absent_in_event_handler_0;
|
||||
|
||||
public static String EventDataExchangeLoadCheck_No_return_in__DataExchange_Load__checking;
|
||||
|
||||
public static String EventDataExchangeLoadCheck_title;
|
||||
|
||||
public static String QueryInLoop_check_query_in_infinite_loop;
|
||||
public static String QueryInLoop_description;
|
||||
public static String QueryInLoop_Loop_has_query;
|
||||
public static String QueryInLoop_Loop_has_method_with_query__0;
|
||||
public static String QueryInLoop_Loop_has_query;
|
||||
public static String QueryInLoop_title;
|
||||
|
||||
public static String StructureCtorTooManyKeysCheck_description;
|
||||
public static String StructureCtorTooManyKeysCheck_Maximum_structure_constructor_keys;
|
||||
public static String StructureCtorTooManyKeysCheck_Structure_constructor_has_more_than__0__keys;
|
||||
public static String StructureCtorTooManyKeysCheck_title;
|
||||
|
||||
|
||||
public static String EmptyExceptStatementCheck_title;
|
||||
public static String EmptyExceptStatementCheck_description;
|
||||
|
||||
|
||||
static
|
||||
{
|
||||
|
@ -12,8 +12,15 @@
|
||||
# 1C-Soft LLC - initial API and implementation
|
||||
# Aleksandr Kapralov - issue #17
|
||||
# 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}
|
||||
|
||||
CanonicalPragmaCheck_description = Check pragma is written canonically
|
||||
|
||||
CanonicalPragmaCheck_title = Pragma is written canonically
|
||||
|
||||
EmptyExceptStatementCheck_description = Empty except statement
|
||||
|
||||
EmptyExceptStatementCheck_title = Empty except statement
|
||||
|
@ -11,9 +11,16 @@
|
||||
# Contributors:
|
||||
# 1C-Soft LLC - initial API and implementation
|
||||
# Aleksandr Kapralov - issue #17
|
||||
# Viktor Gukov - issue #394
|
||||
# Viktor Gukov - issue #394
|
||||
# Aleksandr Kapralov - issue #449
|
||||
###############################################################################
|
||||
|
||||
CanonicalPragmaCheck_Pragma_0_is_not_written_canonically_correct_spelling_is_1 = Аннотация {0} написана неканонически, правильное написание {1}
|
||||
|
||||
CanonicalPragmaCheck_description = Проверяет что аннотация метода написана канонически
|
||||
|
||||
CanonicalPragmaCheck_title = Аннотация написана канонически
|
||||
|
||||
EmptyExceptStatementCheck_description = "Попытка...Исключение" не содержит кода в исключении
|
||||
|
||||
EmptyExceptStatementCheck_title = "Попытка...Исключение" не содержит кода в исключении
|
||||
|
@ -9,6 +9,7 @@ Automatic-Module-Name: com.e1c.v8codestyle.md.itests
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-Localization: fragment
|
||||
Import-Package: com._1c.g5.v8.dt.core.platform;version="10.4.0",
|
||||
com._1c.g5.v8.dt.testing;version="[3.1.0,4.0.0)",
|
||||
com._1c.g5.v8.dt.validation.marker;version="4.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)"
|
||||
|
@ -0,0 +1,123 @@
|
||||
/*******************************************************************************
|
||||
* 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.CanonicalPragmaCheck;
|
||||
|
||||
/**
|
||||
* Tests for {@link CanonicalPragmaCheck} check.
|
||||
*
|
||||
* @author Aleksandr Kapralov
|
||||
*/
|
||||
public class CanonicalPragmaCheckTest
|
||||
extends CheckTestBase
|
||||
{
|
||||
|
||||
private static final String PROJECT_NAME = "CanonicalPragma";
|
||||
private static final String EXTENSION_NAME = "CanonicalPragmaExtension";
|
||||
|
||||
private static final String CHECK_ID = "bsl-canonical-pragma"; //$NON-NLS-1$
|
||||
|
||||
@Test
|
||||
public void testCanonicalPragma() 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<String> uriErrors = new HashSet<>();
|
||||
|
||||
for (Method method : module.allMethods())
|
||||
{
|
||||
List<Pragma> pragmaList = EcoreUtil2.eAllOfType(method, Pragma.class);
|
||||
|
||||
switch (method.getName())
|
||||
{
|
||||
case "Ext_MyCorrectProcedureBefore":
|
||||
case "Ext_MyCorrectProcedureAfter":
|
||||
case "Ext_MyCorrectFunctionAround":
|
||||
case "Ext_MyCorrectFunctionChangeAndValidate":
|
||||
case "UnknownPragma":
|
||||
{
|
||||
// Those methods doesn't have errors
|
||||
break;
|
||||
}
|
||||
|
||||
case "Ext_MyIncorrectProcedureBefore":
|
||||
case "Ext_MyIncorrectProcedureAfter":
|
||||
case "Ext_MyIncorrectFunctionAround":
|
||||
case "Ext_MyIncorrectFunctionChangeAndValidate":
|
||||
{
|
||||
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());
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>CanonicalPragma</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>
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
Runtime-Version: 8.3.19
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="01f634d9-c4e7-4cd3-8dc5-85f280f0b456">
|
||||
<name>CommonModule</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>Common module</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
@ -0,0 +1,44 @@
|
||||
Procedure MyCorrectProcedureBeforeAfter(Param) Export
|
||||
|
||||
Param = 1;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function MyCorrectFunctionAround(Param) Export
|
||||
|
||||
Param = 1;
|
||||
|
||||
Return Param;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function MyCorrectFunctionChangeAndValidate(Param) Export
|
||||
|
||||
Param = 1;
|
||||
|
||||
Return Param;
|
||||
|
||||
EndFunction
|
||||
|
||||
Procedure MyIncorrectProcedureBeforeAfter(Param) Export
|
||||
|
||||
Param = 1;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function MyIncorrectFunctionAround(Param) Export
|
||||
|
||||
Param = 1;
|
||||
|
||||
Return Param;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function MyIncorrectFunctionChangeAndValidate(Param) Export
|
||||
|
||||
Param = 1;
|
||||
|
||||
Return Param;
|
||||
|
||||
EndFunction
|
||||
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:Configuration xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="5e92a49c-7583-4701-abb3-4014dfb02734">
|
||||
<name>CanonicalPragma</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>Canonical pragma</value>
|
||||
</synonym>
|
||||
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="365aadff-1a15-4a17-901f-23c8031d8a9b"/>
|
||||
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="5b3d416c-3be0-467e-9461-c7b4bf90c90f"/>
|
||||
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="e0bbdfd0-f6e0-44f9-9bf7-348721507972"/>
|
||||
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="442c54ef-2504-4208-acf2-1310e8414e0e"/>
|
||||
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="48cc1bcd-1dfc-48e8-9858-fa3092d61ed4"/>
|
||||
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="da2a37f5-9632-4da9-b531-31f5602795bf"/>
|
||||
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="90f24721-0ce9-4c70-aa32-88c5e6251925"/>
|
||||
<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="01126181-6c20-43ef-9d72-567c2e0a961c">
|
||||
<name>English</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>English</value>
|
||||
</synonym>
|
||||
<languageCode>en</languageCode>
|
||||
</languages>
|
||||
<commonModules>CommonModule.CommonModule</commonModules>
|
||||
</mdclass:Configuration>
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>CanonicalPragma.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>
|
@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Runtime-Version: 8.3.19
|
||||
Base-Project: CanonicalPragma
|
@ -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="4d8dfae4-bd1f-43e8-bc75-3a244a8d8dda" extendedConfigurationObject="01f634d9-c4e7-4cd3-8dc5-85f280f0b456">
|
||||
<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>
|
@ -0,0 +1,52 @@
|
||||
&Before("MyCorrectProcedureBeforeAfter")
|
||||
Procedure Ext_MyCorrectProcedureBefore(Param) Export
|
||||
// Before
|
||||
EndProcedure
|
||||
|
||||
&After("MyCorrectProcedureBeforeAfter")
|
||||
Procedure Ext_MyCorrectProcedureAfter(Param) Export
|
||||
// After
|
||||
EndProcedure
|
||||
|
||||
&Around("MyCorrectFunctionAround")
|
||||
Function Ext_MyCorrectFunctionAround(Param) Export
|
||||
// Around
|
||||
EndFunction
|
||||
|
||||
&ChangeAndValidate("MyCorrectFunctionChangeAndValidate")
|
||||
Function Ext_MyCorrectFunctionChangeAndValidate(Param) Export
|
||||
|
||||
Param = 1;
|
||||
|
||||
Return Param;
|
||||
|
||||
EndFunction
|
||||
|
||||
&BeforE("MyIncorrectProcedureBeforeAfter")
|
||||
Procedure Ext_MyIncorrectProcedureBefore(Param) Export
|
||||
// Before
|
||||
EndProcedure
|
||||
|
||||
&AFter("MyIncorrectProcedureBeforeAfter")
|
||||
Procedure Ext_MyIncorrectProcedureAfter(Param) Export
|
||||
// After
|
||||
EndProcedure
|
||||
|
||||
&ArOUnd("MyIncorrectFunctionAround")
|
||||
Function Ext_MyIncorrectFunctionAround(Param) Export
|
||||
// Around
|
||||
EndFunction
|
||||
|
||||
&CHangeandVAlidate("MyIncorrectFunctionChangeAndValidate")
|
||||
Function Ext_MyIncorrectFunctionChangeAndValidate(Param) Export
|
||||
|
||||
Param = 1;
|
||||
|
||||
Return Param;
|
||||
|
||||
EndFunction
|
||||
|
||||
&UnknownPragma("UnknownPragma")
|
||||
Procedure UnknownPragma() Export
|
||||
// Unknown pragma
|
||||
EndProcedure
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
@ -0,0 +1,44 @@
|
||||
<?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="ff0474c9-655d-4dca-b4e8-9dbcc828de64">
|
||||
<name>CanonicalPragmaExtension</name>
|
||||
<synonym>
|
||||
<key>en</key>
|
||||
<value>Canonical pragma extension</value>
|
||||
</synonym>
|
||||
<objectBelonging>Adopted</objectBelonging>
|
||||
<extension xsi:type="mdclassExtension:ConfigurationExtension">
|
||||
<defaultRunMode>Checked</defaultRunMode>
|
||||
<usePurposes>Checked</usePurposes>
|
||||
<commandInterface>Extended</commandInterface>
|
||||
<mainSectionCommandInterface>Extended</mainSectionCommandInterface>
|
||||
<defaultLanguage>Checked</defaultLanguage>
|
||||
<interfaceCompatibilityMode>Checked</interfaceCompatibilityMode>
|
||||
<compatibilityMode>Checked</compatibilityMode>
|
||||
<defaultStyle>Extended</defaultStyle>
|
||||
<defaultRoles>Extended</defaultRoles>
|
||||
</extension>
|
||||
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="84fd0d58-3597-4e76-8215-2d00be5bbb90"/>
|
||||
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="14b0a73b-7781-4f5c-817a-80f133219779"/>
|
||||
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="c592ce50-5949-4ab7-9bd3-f86251278d88"/>
|
||||
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="a6a7d496-5e94-4f52-9315-f399424706aa"/>
|
||||
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="8762104c-0ce5-47b0-83a0-41727643b555"/>
|
||||
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="27e411f1-0b6f-49b5-b8bf-49f81edef93c"/>
|
||||
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="77c64f9c-0027-40d6-9f74-6bfbda33e345"/>
|
||||
<keepMappingToExtendedConfigurationObjectsByIDs>true</keepMappingToExtendedConfigurationObjectsByIDs>
|
||||
<namePrefix>Ext_</namePrefix>
|
||||
<configurationExtensionCompatibilityMode>8.3.19</configurationExtensionCompatibilityMode>
|
||||
<configurationExtensionPurpose>Customization</configurationExtensionPurpose>
|
||||
<defaultRunMode>ManagedApplication</defaultRunMode>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<defaultLanguage>Language.English</defaultLanguage>
|
||||
<compatibilityMode>8.3.19</compatibilityMode>
|
||||
<languages uuid="d2b2d800-b5fb-4d45-bec7-76b9fbebfbed">
|
||||
<name>English</name>
|
||||
<objectBelonging>Adopted</objectBelonging>
|
||||
<extension xsi:type="mdclassExtension:LanguageExtension">
|
||||
<languageCode>Checked</languageCode>
|
||||
</extension>
|
||||
<languageCode>en</languageCode>
|
||||
</languages>
|
||||
<commonModules>CommonModule.CommonModule</commonModules>
|
||||
</mdclass:Configuration>
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<cmi:CommandInterface xmlns:cmi="http://g5.1c.ru/v8/dt/cmi"/>
|
Loading…
x
Reference in New Issue
Block a user