Skip to content

Commit

Permalink
Merge pull request #1399 from 1C-Company/G5V8DT-22792
Browse files Browse the repository at this point in the history
G5V8DT-22792 Оптимизация в работе встроенного языка
  • Loading branch information
MaksimDzyuba authored Jun 25, 2024
2 parents ef36996 + e6eb68c commit cdd4a70
Show file tree
Hide file tree
Showing 33 changed files with 355 additions and 108 deletions.
2 changes: 1 addition & 1 deletion bundles/com.e1c.v8codestyle.bsl.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Import-Package: com._1c.g5.ides.ui.texteditor.xtext.embedded;version="[6.0.0,7.0
com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.bsl.comment;version="[3.0.0,4.0.0)",
com._1c.g5.v8.dt.bsl.common;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.bsl.documentation.comment;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.bsl.documentation.comment;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.bsl.formatting;version="[3.0.0,4.0.0)",
com._1c.g5.v8.dt.bsl.model;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.bsl.model.util;version="[4.7.0,5.0.0)",
Expand Down
6 changes: 3 additions & 3 deletions bundles/com.e1c.v8codestyle.bsl/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.bsl.comment;version="[3.0.0,4.0.0)",
com._1c.g5.v8.dt.bsl.common;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.bsl.contextdef;version="[2.0.0,3.0.0)",
com._1c.g5.v8.dt.bsl.documentation.comment;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.bsl.documentation.comment;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.bsl.model;version="[5.0.0,6.0.0)",
com._1c.g5.v8.dt.bsl.model.resource.owner;version="[2.0.0,3.0.0)",
com._1c.g5.v8.dt.bsl.model.util;version="[4.0.0,5.0.0)",
com._1c.g5.v8.dt.bsl.resource;version="[15.0.0,16.0.0)",
com._1c.g5.v8.dt.bsl.services;version="[7.0.0,8.0.0)",
com._1c.g5.v8.dt.bsl.typesystem;version="[10.0.0,11.0.0)",
com._1c.g5.v8.dt.bsl.typesystem.util;version="[10.0.0,11.0.0)",
com._1c.g5.v8.dt.bsl.typesystem.util;version="[11.0.0,12.0.0)",
com._1c.g5.v8.dt.bsl.util;version="[8.0.0,9.0.0)",
com._1c.g5.v8.dt.bsl.validation;version="[18.0.0,19.0.0)",
com._1c.g5.v8.dt.common;version="[6.0.0,7.0.0)",
Expand All @@ -47,7 +47,7 @@ Import-Package: com._1c.g5.v8.bm.core;version="[8.0.0,9.0.0)",
com._1c.g5.wiring.binder;version="[1.0.0,2.0.0)",
com.e1c.g5.dt.core.api.naming;version="1.0.0",
com.e1c.g5.dt.core.api.platform;version="[1.1.0,2.0.0)",
com.e1c.g5.v8.dt.bsl.check;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.bsl.check;version="[3.0.0,4.0.0)",
com.e1c.g5.v8.dt.bsl.check.qfix;version="[3.0.0,4.0.0)",
com.e1c.g5.v8.dt.check;version="[2.0.0,3.0.0)",
com.e1c.g5.v8.dt.check.components;version="[2.0.0,3.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.mcore.Method;
import com._1c.g5.v8.dt.mcore.Parameter;
import com._1c.g5.v8.dt.mcore.Property;
Expand All @@ -52,14 +54,15 @@ public abstract class AbstractDocCommentTypeCheck
/**
* Constructs an instance
*
* @param resourceLookup
* @param namingService
* @param bmModelManager
* @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be <code>null</code>
* @param namingService service for getting names of EDT object and resources, cannot be <code>null</code>
* @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be <code>null</code>
* @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be <code>null</code>
*/
protected AbstractDocCommentTypeCheck(IResourceLookup resourceLookup, INamingService namingService,
IBmModelManager bmModelManager)
IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
super(resourceLookup, namingService, bmModelManager);
super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}

/**
Expand Down Expand Up @@ -172,12 +175,12 @@ protected Optional<EObject> getLinkPartLastObject(LinkPart linkPart, IScopeProvi
|| (linkPart.getPartsWithOffset().get(linkPart.getPartsWithOffset().size() - 1)).getFirst().isEmpty()))
{
return Optional.ofNullable(linkPart.getActualObjectForPart(linkPart.getPartsWithOffset().size() - 2,
scopeProvider, context, typeComputationContext));
scopeProvider, context, v8ProjectManager, typeComputationContext));
}
else
{
return Optional.ofNullable(linkPart.getActualObjectForPart(linkPart.getPartsWithOffset().size() - 1,
scopeProvider, context, typeComputationContext));
scopeProvider, context, v8ProjectManager, typeComputationContext));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.TreeSet;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;

import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
Expand All @@ -25,6 +26,8 @@
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.platform.IEObjectTypeNames;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
Expand Down Expand Up @@ -65,15 +68,16 @@ public class CollectionTypeDefinitionCheck
/**
* Constructs an instance
*
* @param resourceLookup
* @param namingService
* @param bmModelManager
* @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be <code>null</code>
* @param namingService service for getting names of EDT object and resources, cannot be <code>null</code>
* @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be <code>null</code>
* @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be <code>null</code>
*/
@Inject
public CollectionTypeDefinitionCheck(IResourceLookup resourceLookup, INamingService namingService,
IBmModelManager bmModelManager)
IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
super(resourceLookup, namingService, bmModelManager);
super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
import java.util.regex.Pattern;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;

import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment.Description;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
import com._1c.g5.v8.dt.bsl.documentation.comment.TextPart;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
Expand Down Expand Up @@ -65,11 +68,19 @@ public class DocCommentUseMinusCheck

private static final int SHOW_PREV_SYMBOLS = 7;

/**
* Constructs an instance
*
* @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be <code>null</code>
* @param namingService service for getting names of EDT object and resources, cannot be <code>null</code>
* @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be <code>null</code>
* @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be <code>null</code>
*/
@Inject
public DocCommentUseMinusCheck(IResourceLookup resourceLookup, INamingService namingService,
IBmModelManager bmModelManager)
IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
super(resourceLookup, namingService, bmModelManager);
super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.scoping.IScopeProvider;

import com._1c.g5.v8.dt.bsl.comment.DocumentationCommentProperties;
Expand All @@ -28,6 +29,8 @@
import com._1c.g5.v8.dt.bsl.model.Function;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
Expand Down Expand Up @@ -61,19 +64,20 @@ public class ExportFunctionReturnSectionCheck
/**
* Instantiates a new check of export function return section.
*
* @param resourceLookup the resource lookup service, cannot be {@code null}.
* @param namingService
* @param bmModelManager
* @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be <code>null</code>
* @param namingService service for getting names of EDT object and resources, cannot be <code>null</code>
* @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be <code>null</code>
* @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be <code>null</code>
* @param bslPreferences the BSL preferences service, cannot be {@code null}.
* @param commentProvider the comment provider service, cannot be {@code null}.
* @param scopeProvider the scope provider service, cannot be {@code null}.
*/
@Inject
public ExportFunctionReturnSectionCheck(IResourceLookup resourceLookup, INamingService namingService,
IBmModelManager bmModelManager, IBslPreferences bslPreferences,
IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager, IBslPreferences bslPreferences,
BslMultiLineCommentDocumentationProvider commentProvider, IScopeProvider scopeProvider)
{
super(resourceLookup, namingService, bmModelManager);
super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.resourceLookup = resourceLookup;
this.bslPreferences = bslPreferences;
this.commentProvider = commentProvider;
Expand Down Expand Up @@ -117,7 +121,7 @@ protected void checkDocumentationCommentObject(IDescriptionPart object, BslDocum
DocumentationCommentProperties props = bslPreferences.getDocumentCommentProperties(project);

docComment = BslCommentUtils.getLinkPartCommentContent(linkPart, scopeProvider, commentProvider,
props.oldCommentFormat(), root.getMethod(), typeComputationContext);
props.oldCommentFormat(), root.getMethod(), v8ProjectManager, typeComputationContext);
}

if (docComment == null || docComment.getReturnSection() == null || isTypeEmptyAndNoLink(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import com._1c.g5.v8.dt.bsl.model.RegionPreprocessor;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
Expand All @@ -47,11 +49,19 @@ public class ExportProcedureCommentDescriptionCheck
{
private static final String CHECK_ID = "doc-comment-export-procedure-description-section"; //$NON-NLS-1$

/**
* Constructs an instance
*
* @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be <code>null</code>
* @param namingService service for getting names of EDT object and resources, cannot be <code>null</code>
* @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be <code>null</code>
* @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be <code>null</code>
*/
@Inject
public ExportProcedureCommentDescriptionCheck(IResourceLookup resourceLookup, INamingService namingService,
IBmModelManager bmModelManager)
IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
super(resourceLookup, namingService, bmModelManager);
super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;

import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
Expand All @@ -24,6 +25,8 @@
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.bsl.check.DocumentationCommentBasicDelegateCheck;
Expand All @@ -47,11 +50,19 @@ public class FieldDefinitionNameCheck
{
private static final String CHECK_ID = "doc-comment-field-name"; //$NON-NLS-1$

/**
* Constructs an instance
*
* @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be <code>null</code>
* @param namingService service for getting names of EDT object and resources, cannot be <code>null</code>
* @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be <code>null</code>
* @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be <code>null</code>
*/
@Inject
public FieldDefinitionNameCheck(IResourceLookup resourceLookup, INamingService namingService,
IBmModelManager bmModelManager)
IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
super(resourceLookup, namingService, bmModelManager);
super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
import java.text.MessageFormat;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;

import com._1c.g5.v8.dt.bsl.documentation.comment.BslDocumentationComment;
import com._1c.g5.v8.dt.bsl.documentation.comment.IDescriptionPart;
import com._1c.g5.v8.dt.bsl.documentation.comment.TypeSection.FieldDefinition;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
import com.e1c.g5.v8.dt.check.CheckComplexity;
Expand All @@ -41,11 +44,19 @@ public class FieldDefinitionTypeCheck
{
private static final String CHECK_ID = "doc-comment-field-type"; //$NON-NLS-1$

/**
* Constructs an instance
*
* @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be <code>null</code>
* @param namingService service for getting names of EDT object and resources, cannot be <code>null</code>
* @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be <code>null</code>
* @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be <code>null</code>
*/
@Inject
public FieldDefinitionTypeCheck(IResourceLookup resourceLookup, INamingService namingService,
IBmModelManager bmModelManager)
IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager)
{
super(resourceLookup, namingService, bmModelManager);
super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import com._1c.g5.v8.dt.common.StringUtils;
import com._1c.g5.v8.dt.core.platform.IBmModelManager;
import com._1c.g5.v8.dt.core.platform.IResourceLookup;
import com._1c.g5.v8.dt.core.platform.IV8Project;
import com._1c.g5.v8.dt.core.platform.IV8ProjectManager;
import com._1c.g5.v8.dt.platform.IEObjectTypeNames;
import com.e1c.g5.dt.core.api.naming.INamingService;
import com.e1c.g5.dt.core.api.platform.BmOperationContext;
Expand Down Expand Up @@ -81,13 +83,17 @@ public class FieldDefinitionTypeWithLinkRefCheck
/**
* Instantiates a new field definition type with link reference to constructor function check.
*
* @param resourceLookup service for look up workspace resources, see {@link IResourceLookup}, cannot be <code>null</code>
* @param namingService service for getting names of EDT object and resources, cannot be <code>null</code>
* @param bmModelManager service for getting instance of Bm Model by {@link EObject}, cannot be <code>null</code>
* @param v8ProjectManager {@link IV8ProjectManager} for getting {@link IV8Project} by {@link EObject}, cannot be <code>null</code>
* @param scopeProvider the scope provider service, cannot be {@code null}.
*/
@Inject
public FieldDefinitionTypeWithLinkRefCheck(IResourceLookup resourceLookup, INamingService namingService,
IBmModelManager bmModelManager, IScopeProvider scopeProvider)
IBmModelManager bmModelManager, IV8ProjectManager v8ProjectManager, IScopeProvider scopeProvider)
{
super(resourceLookup, namingService, bmModelManager);
super(resourceLookup, namingService, bmModelManager, v8ProjectManager);
this.scopeProvider = scopeProvider;
}

Expand Down
Loading

0 comments on commit cdd4a70

Please sign in to comment.