Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4180068
Add checks missing and extra semicolon, qfix.
Oct 20, 2025
18040f7
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
c8d888d
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
1538aa2
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
604dd88
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
719d92a
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
4b1ee9d
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
a951483
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
71378da
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
7712e6c
Add checks missing and extra semicolon, qfix.
alonthedark Oct 20, 2025
1494474
Update MethodSemicolonExtraCheck.java
alonthedark Oct 23, 2025
eeaf544
Update MethodSemicolonExtraFix.java
alonthedark Oct 27, 2025
c0f14b4
Update messages.properties
alonthedark Oct 27, 2025
a0b426d
Update SemicolonMissingFix.java
alonthedark Oct 27, 2025
1d592bd
Update Messages.java
alonthedark Oct 29, 2025
576a4ce
Изменено подчеркивание лишней точки с запятой подчеркивается только она
Nov 1, 2025
93ae72b
Update SemicolonMissingFix.java
alonthedark Nov 1, 2025
f09963a
Update MethodSemicolonExtraFix.java
alonthedark Nov 1, 2025
1fc52f5
Update SemicolonMissingCheck.java
alonthedark Nov 13, 2025
22487cb
Update SemicolonMissingCheck.java
alonthedark Nov 13, 2025
2be3c82
Update SemicolonMissingCheck.java
alonthedark Nov 14, 2025
3b42a9a
Изменение проверки и добавление новых тестов
Nov 19, 2025
023b240
Добавлено описание
Nov 21, 2025
cd7d723
Merge branch 'master' into feature/issue-1508-semicolon-extra-and-mising
alonthedark Nov 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bundles/com.e1c.v8codestyle.bsl.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@
<fix class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.ui.qfix.SelfAssignFix"/>
<fix class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.ui.qfix.UndefinedFunctionFix"/>
<fix class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.ui.qfix.UndefinedVariableFix"/>
<fix class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.ui.qfix.MethodSemicolonExtraFix"/>
<fix class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.ui.qfix.SemicolonMissingFix"/>
<fix
class="com.e1c.v8codestyle.internal.bsl.ui.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.ui.qfix.SelfReferenceFix">
</fix>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ final class Messages

public static String OpenBslDocCommentViewFix_Details;

public static String MethodSemicolonExtraFix_Details;
public static String MethodSemicolonExtraFix_Description;

public static String SemicolonMissngFix_Details;
public static String SemicolonMissingFix_Description;

public static String SelfReferenceFix_description;

public static String SelfReferenceFix_details;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*******************************************************************************
* Copyright (C) 2025, 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.ui.qfix;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.text.edits.DeleteEdit;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
import org.eclipse.xtext.resource.XtextResource;

import com._1c.g5.v8.dt.bsl.model.EmptyStatement;
import com.e1c.g5.v8.dt.bsl.check.qfix.IXtextBslModuleFixModel;
import com.e1c.g5.v8.dt.bsl.check.qfix.SingleVariantXtextBslModuleFix;
import com.e1c.g5.v8.dt.check.qfix.components.QuickFix;

/**
* Removes extra semicolon
*
* @author Ivan Sergeev
*/
@QuickFix(checkId = "method-semicolon-extra", supplierId = "com.e1c.v8codestyle.bsl")
public class MethodSemicolonExtraFix
extends SingleVariantXtextBslModuleFix
{

@Override
protected void configureFix(FixConfigurer configurer)
{
configurer.interactive(true)
.description(Messages.MethodSemicolonExtraFix_Description)
.details(Messages.MethodSemicolonExtraFix_Description);
}

@Override
protected TextEdit fixIssue(XtextResource state, IXtextBslModuleFixModel model) throws BadLocationException
{
EObject eobject = model.getElement();

if (!(eobject instanceof EmptyStatement))
{
return null;
}

INode node = NodeModelUtils.findActualNodeFor(eobject);

if (node == null)
{
return null;
}
INode checkNode = node.getNextSibling();
if (checkNode == null)
{
return null;
}
String checkText = checkNode.getText();
INode checkNextNode = checkNode.getNextSibling();
if (checkText.contains(";")) //$NON-NLS-1$
{
return new DeleteEdit(checkNode.getTotalOffset(), checkNode.getTotalLength());
}
else if (checkNextNode.getText().contains(";") && !(checkNextNode == null)) //$NON-NLS-1$
{
return new DeleteEdit(checkNextNode.getTotalOffset(), checkNextNode.getTotalLength());
}
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*******************************************************************************
* Copyright (C) 2025, 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.ui.qfix;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.text.edits.InsertEdit;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
import org.eclipse.xtext.resource.XtextResource;

import com._1c.g5.v8.dt.bsl.model.Conditional;
import com._1c.g5.v8.dt.bsl.model.Statement;
import com.e1c.g5.v8.dt.bsl.check.qfix.IXtextBslModuleFixModel;
import com.e1c.g5.v8.dt.bsl.check.qfix.SingleVariantXtextBslModuleFix;
import com.e1c.g5.v8.dt.check.qfix.components.QuickFix;

/**
* Add missing semicolon
*
* @author Ivan Sergeev
*/
@QuickFix(checkId = "semicolon-missing", supplierId = "com.e1c.v8codestyle.bsl")
public class SemicolonMissingFix
extends SingleVariantXtextBslModuleFix
{

@Override
protected void configureFix(FixConfigurer configurer)
{
configurer.interactive(true)
.description(Messages.SemicolonMissingFix_Description)
.details(Messages.SemicolonMissngFix_Details);
}

@Override
protected TextEdit fixIssue(XtextResource state, IXtextBslModuleFixModel model) throws BadLocationException
{
EObject eobject = model.getElement();
if (!(eobject instanceof Statement) & !(eobject instanceof Conditional))
{
return null;
}

INode node = NodeModelUtils.findActualNodeFor(eobject);
if (node == null)
{
return null;
}
return new InsertEdit(node.getEndOffset(), ";"); //$NON-NLS-1$
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ ManagerModuleNamedSelfReferenceFix_description=Remove excessive named self refer
ManagerModuleNamedSelfReferenceFix_details=Remove excessive named self reference from manager module
OpenBslDocCommentViewFix_Details=Open documentation comment data structure view and show current probleme object.
OpenBslDocCommentViewFix_Description=Open documentation comment structure view
MethodSemicolonExtraFix_Details = Remove extra semicolon
MethodSemicolonExtraFix_Description = Remove extra semicolon
SemicolonMissingFix_Details = Add missing semicolon
SemicolonMissingFix_Description = Add missing semicolon
SelfReferenceFix_description=Remove excessive self reference
SelfReferenceFix_details=Remove excessive self reference
SelfAssignFix_Description = Remove self-assign variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ ServerExecutionSafeModeFix_description = Включить безопасный

ServerExecutionSafeModeFix_details = Добавить включение безопасного режима перед вызовом метода "Выполнить" или "Вычислить"

MethodSemicolonExtraFix_Details = Удалить лишнюю точку с запятой

MethodSemicolonExtraFix_Description = Удалить лишнюю точку с запятой

SemicolonMissingFix_Details = Добавить пропущенную точку с запятой

SemicolonMissingFix_Description = Добавить пропущенную точку с запятой

UndefinedMethodFix_func_desc = Создать новую функцию в модуле

UndefinedMethodFix_func_title = Создать функцию
Expand Down
19 changes: 19 additions & 0 deletions bundles/com.e1c.v8codestyle.bsl/markdown/method-semicolon-extra.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Exta semicolon at the end of method declaration

A semicolon at the end of a method declaration is not an error, but its absence is preferable.

## Noncompliant Code Example

Procedure procedureName(Parameters);

A = 1;

EndProcedure

## Compliant Solution

Procedure procedureName(Parameters)

A = 1;

EndProcedure
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Лишняя точка с запятой в конце объявления метода

Точка с запятой в конце объявления метода не является ошибкой но предпочтительно отсутствие.

## Неправильно

Например, неправильно:

Процедура Ааааa();

А = 1;

КонецПроцедуры

## Правильно

Например, правельно:

Процедура Ааааa()

А = 1;

КонецПроцедуры
23 changes: 23 additions & 0 deletions bundles/com.e1c.v8codestyle.bsl/markdown/ru/semicolon-missing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Отсутствие точки с запятой в конце оператора

Точка с запятой в конце последнего оператора блока не являеться обязательной, предпочтительно наличие.

## Неправильно

Например, неправильно:

Процедура Ааааa()

А = 1

КонецПроцедуры

## Правильно

Например, правельно:

Процедура Ааааa()

А = 1;

КонецПроцедуры
19 changes: 19 additions & 0 deletions bundles/com.e1c.v8codestyle.bsl/markdown/semicolon-missing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Missing semicolon at the end of statement

The semicolon at the end of the last statement is not required, but is preferred.

## Noncompliant Code Example

Procedure procedureName(Parameters)

A = 1

EndProcedure

## Compliant Solution

Procedure procedureName(Parameters)

A = 1;

EndProcedure
6 changes: 5 additions & 1 deletion bundles/com.e1c.v8codestyle.bsl/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@
</check>
<check
category="com.e1c.v8codestyle.bsl"
class="com.e1c.v8codestyle.internal.bsl.ExecutableExtensionFactory:com.e1c.v8codestyle.bsl.check.NotSupportGotoOperatorWebCheck">
class="com.e1c.v8codestyle.bsl.check.MethodSemicolonExtraCheck">
</check>
<check
category="com.e1c.v8codestyle.bsl"
class="com.e1c.v8codestyle.bsl.check.SemicolonMissingCheck">
</check>
<check
category="com.e1c.v8codestyle.bsl"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ final class Messages
public static String QueryInLoop_Loop_has_query;
public static String QueryInLoop_title;

public static String SelfAssignCheck_Title;
public static String SelfAssignCheck_Description;
public static String SelfAssignCheck_Self_assign_issue;
public static String SemicolonMissingCheck_Description;

public static String SemicolonMissingCheck_Title;

public static String SemicolonMissingCheck_Issue;

public static String SelfReferenceCheck_check_object_module;

Expand Down Expand Up @@ -402,6 +404,12 @@ final class Messages

public static String MethodTooManyPramsCheck_title;

public static String MethodSemicolonExtraCheck_Description;

public static String MethodSemicolonExtraCheck_Title;

public static String MethodSemicolonExtraCheck_Issue;

public static String MissingTemporaryFileDeletionCheck_Delete_File_Methods;

public static String MissingTemporaryFileDeletionCheck_description;
Expand Down
Loading
Loading