-
Notifications
You must be signed in to change notification settings - Fork 57
Feature/issue 1508 semicolon extra and missing #1509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feature/issue 1508 semicolon extra and missing #1509
Conversation
add empty check
.../com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/bsl/ui/qfix/MethodSemicolonExtraFix.java
Show resolved
Hide resolved
bundles/com.e1c.v8codestyle.bsl.ui/src/com/e1c/v8codestyle/bsl/ui/qfix/SemicolonMissingFix.java
Outdated
Show resolved
Hide resolved
bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/messages.properties
Outdated
Show resolved
Hide resolved
Проверка на нахождение statement
contain -> contains
ReplaceEdit -> InsertEdit
| { | ||
| return null; | ||
| } | ||
| return new InsertEdit(node.getEndOffset(), ";"); //$NON-NLS-1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| public static String MethodTooManyPramsCheck_title; | ||
|
|
||
| public static String MethodSemicolonExtraCheck_Description; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в этом файле все с разделителем в 1 строку, я бы для общности сохранял практику, не знаю, кто придумал, но для однородности сохранил бы
|
|
||
| if (checkText.contains(";")) //$NON-NLS-1$ | ||
| { | ||
| resultAceptor.addIssue(Messages.MethodSemicolonExtraCheck_Issue, NAMED_ELEMENT__NAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я смотрю, что проверка ставится на сам метод, а не на точку с запятой, может лучше на точку, ну так бытсрее и понятнее видно, где проблема и что не так
| { | ||
| return null; | ||
| } | ||
| INode checkNode = node.getNextSibling(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в аналогичном месте в самом check тут есть проверка, что checkNode не null
| IProgressMonitor monitor) | ||
| { | ||
| Method method = (Method)object; | ||
| List<Statement> allItems = BslUtil.allStatements(method); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
| if (!checkText.contains(";") && !nodeText.isEmpty()) //$NON-NLS-1$ | ||
| { | ||
| resultAceptor.addIssue(Messages.SemicolonMissingCheck_Issue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| List<EObject> eObJects = statement.eContents(); | ||
| checkSemicolon(eObJects, resultAceptor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
| } | ||
|
|
||
| private void checkSemicolon(List<EObject> eObjects, ResultAcceptor resultAceptor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| private void checkSemicolon(List<EObject> eObjects, ResultAcceptor resultAceptor) | ||
| { | ||
| if (eObjects.isEmpty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по замерам производительности весьма ощутимо у меня вышло на документообороте, кажется, что не очень подход выбран, что надо проверять каждый statement в методе, может попробуем проверять сходу весь метод, а в нем только последние statement в каждом блоке statement.
Добавление пустых строк



Что сделано
Чек-лист
Общее:
masterи нет конфликтовЕсли применимо:
Закрываемые задачи
Closes #1508