mirror of
https://github.com/1C-Company/v8-code-style.git
synced 2024-11-24 08:53:01 +02:00
G5V8DT-25016 В строгих типах Edt не понимает, что
СправочникСсылка.ИмяСправочника входит в состав типа СправочникСсылка #1360
This commit is contained in:
parent
cdd4a707ea
commit
287dde0e08
@ -14,8 +14,6 @@ package com.e1c.v8codestyle.internal.bsl.ui.views;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import org.eclipse.jface.action.IMenuManager;
|
||||
import org.eclipse.jface.action.IToolBarManager;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
@ -32,8 +30,8 @@ import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.ui.IActionBars;
|
||||
import org.eclipse.ui.ISelectionListener;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchActionConstants;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.part.ViewPart;
|
||||
import org.eclipse.xtext.resource.EObjectAtOffsetHelper;
|
||||
|
||||
@ -68,9 +66,6 @@ public class BslDocCommentView
|
||||
*/
|
||||
public static final String ID = "com.e1c.v8codestyle.bsl.ui.views.BslDocCommentView"; //$NON-NLS-1$
|
||||
|
||||
@Inject
|
||||
private IWorkbench workbench;
|
||||
|
||||
private TreeViewer viewer;
|
||||
|
||||
private ISelectionListener listener;
|
||||
@ -254,7 +249,7 @@ public class BslDocCommentView
|
||||
{
|
||||
imageKey = ISharedImages.IMG_OBJ_FOLDER;
|
||||
}
|
||||
return workbench.getSharedImages().getImage(imageKey);
|
||||
return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ import com._1c.g5.v8.dt.bsl.model.Function;
|
||||
import com._1c.g5.v8.dt.bsl.model.ReturnStatement;
|
||||
import com._1c.g5.v8.dt.bsl.resource.DynamicFeatureAccessComputer;
|
||||
import com._1c.g5.v8.dt.bsl.resource.TypesComputer;
|
||||
import com._1c.g5.v8.dt.bsl.util.BslUtil;
|
||||
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;
|
||||
@ -183,10 +184,7 @@ public class FunctionCtorReturnSectionCheck
|
||||
|
||||
Set<String> checkTypes = getCheckTypes(parameters);
|
||||
|
||||
Set<String> computedReturnTypeNames = computedReturnTypes.stream()
|
||||
.map(McoreUtil::getTypeName)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
Collection<String> computedReturnTypeNames = BslUtil.computeTypeNames(computedReturnTypes, method);
|
||||
|
||||
if (isUserDataTypes(computedReturnTypeNames, checkTypes))
|
||||
{
|
||||
@ -269,11 +267,8 @@ public class FunctionCtorReturnSectionCheck
|
||||
{
|
||||
String propertyName = useRussianScript ? declaredProperty.getNameRu() : declaredProperty.getName();
|
||||
declaredProertyNames.add(propertyName);
|
||||
List<String> declaredType = declaredProperty.getTypes()
|
||||
.stream()
|
||||
.map(McoreUtil::getTypeName)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
Collection<String> declaredType =
|
||||
com._1c.g5.v8.dt.bsl.util.BslUtil.computeTypeNames(declaredProperty.getTypes(), function);
|
||||
if (declaredType.isEmpty())
|
||||
{
|
||||
continue;
|
||||
@ -287,7 +282,7 @@ public class FunctionCtorReturnSectionCheck
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<TypeItem> missingTypes = types.stream().filter(t -> {
|
||||
String typeName = McoreUtil.getTypeName(t);
|
||||
String typeName = McoreUtil.getTypeCategory(t);
|
||||
if (typeName != null)
|
||||
{
|
||||
if (!declaredType.contains(typeName))
|
||||
|
@ -41,5 +41,15 @@ Function CorrectCheckForCommonModule() Export
|
||||
return new Structure("Key1, Key2", 10, CommonModule);
|
||||
EndFunction
|
||||
|
||||
// Returns:
|
||||
// Structure - complaint:
|
||||
// * Ref - CatalogRef -
|
||||
Function CorrectCheckForTypeSets() Export
|
||||
EmptyRef = Catalogs.Catalog1.EmptyRef();
|
||||
Str = Новый Structure;
|
||||
Str.Вставить("Ref", EmptyRef);
|
||||
Возврат Str;
|
||||
EndFunction
|
||||
|
||||
|
||||
|
||||
|
@ -387,8 +387,8 @@ public class CommonModuleStrictTypesTest
|
||||
|
||||
Module module = updateAndGetModule(checkId);
|
||||
|
||||
List<Function> finctions = EcoreUtil2.eAllOfType(module, Function.class);
|
||||
assertEquals(4, finctions.size());
|
||||
List<Function> functions = EcoreUtil2.eAllOfType(module, Function.class);
|
||||
assertEquals(5, functions.size());
|
||||
|
||||
List<Marker> markers = getMarters(checkId, module);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user