bsl-language-server icon indicating copy to clipboard operation
bsl-language-server copied to clipboard

Feature/os class module type

Open nixel2007 opened this issue 2 years ago • 8 comments

Описание

Связанные задачи

Closes

Чеклист

Общие

  • [x] Ветка PR обновлена из develop
  • [ ] Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • [x] Изменения покрыты тестами
  • [ ] Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Для диагностик

  • [ ] Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

Дополнительно

Summary by CodeRabbit

  • New Features

    • Introduced a new component for finding references to OScript entities.
    • Implemented a selection range provider with additional methods.
    • Added version 8.3.21 to compatibility mode options.
    • Enhanced variable symbols to include type information.
  • Enhancements

    • Improved readability and formatting across various diagnostic checks.
    • Streamlined code by adopting modern Java features like var keyword and toList() method.
  • Bug Fixes

    • Fixed conditional checks and control flow logic in several diagnostic methods.
    • Corrected spacing and formatting issues in code for consistency.
  • Documentation

    • Expanded documentation comments for better clarity on certain methods and classes.
  • Tests

    • Added new test cases for variable type retrieval and symbol content generation.
    • Introduced test scripts and procedures for comprehensive testing of new features.

nixel2007 avatar Jul 24 '23 16:07 nixel2007

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

ghost avatar Jul 24 '23 16:07 ghost

Qodana Community for JVM

14 new problems were found

Inspection name Severity Problems
Statement with empty body 🔶 Warning 5
'@Serial' annotation could be used 🔶 Warning 4
Mismatched query and update of collection 🔶 Warning 2
Mismatched read and write of array 🔶 Warning 1
Nullability and data flow problems 🔶 Warning 1
Redundant character escape 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked ☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

  • Or via our issue tracker: https://jb.gg/qodana-issue
  • Or share your feedback: https://jb.gg/qodana-discussions

github-actions[bot] avatar Jul 28 '23 18:07 github-actions[bot]

[!IMPORTANT]

Auto Review Skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Walkthrough

The changes primarily involve code cleanliness and refactoring for readability and maintainability. Whitespace has been trimmed, annotations added to suppress deprecation warnings, and spacing issues have been addressed. New functionality includes the addition of a ModuleTypeComputer class and enhancements to variable symbol handling to incorporate type information. The codebase has also been updated to reflect new language features, such as replacing Collectors.toList() with toList(). Furthermore, diagnostic capabilities have been expanded with new checks and compatibility modes.

Changes

Files Change Summary
.../bsl/languageserver/BSLLanguageServer.java
.../IdenticalExpressionsDiagnostic.java
Removed trailing whitespace.
.../BSLWorkspaceService.java Added @SuppressWarnings annotation; simplified CompletableFuture return.
.../cfg/BasicBlockVertex.java
.../ControlFlowGraphWalker.java
.../cli/FormatCommand.java
.../diagnostics/IncorrectLineBreakDiagnostic.java
.../utils/Ranges.java
Fixed spacing issues around if conditions and other minor formatting adjustments.
.../codeactions/DisableDiagnosticTriggeringSupplier.java
.../QuickFixSupplier.java
.../databind/ParametersDeserializer.java
.../context/DocumentContext.java
.../context/symbol/AbstractVariableSymbol.java
.../context/symbol/IntBasedVariableSymbol.java
.../context/symbol/ShortBasedVariableSymbol.java
.../context/symbol/VariableSymbol.java
.../diagnostics/AllFunctionPathMustHaveReturnDiagnostic.java
.../diagnostics/CodeAfterAsyncCallDiagnostic.java
.../diagnostics/CodeOutOfRegionDiagnostic.java
.../diagnostics/DuplicatedInsertionIntoCollectionDiagnostic.java
.../diagnostics/IncorrectUseOfStrTemplateDiagnostic.java
.../diagnostics/MagicDateDiagnostic.java
.../diagnostics/MissingTemporaryFileDeletionDiagnostic.java
.../diagnostics/UnusedLocalVariableDiagnostic.java
.../diagnostics/UsingCancelParameterDiagnostic.java
.../diagnostics/metadata/DiagnosticCompatibilityMode.java
.../hover/VariableSymbolMarkupContentBuilder.java
.../providers/SelectionRangeProvider.java
.../references/OscriptReferenceFinder.java
.../references/ReferenceIndex.java
.../references/model/Location.java
.../references/model/SymbolOccurrence.java
.../utils/Modules.java
.../utils/Trees.java
.../utils/expressiontree/BslExpression.java
.../utils/expressiontree/ConstructorCallNode.java
.../utils/expressiontree/ExpressionParseTreeRewriter.java
.../utils/expressiontree/ExpressionTreeBuildingVisitor.java
.../utils/expressiontree/TernaryOperatorNode.java
.../utils/expressiontree/UnaryOperationNode.java
Refactoring for readability and maintainability; added new functionality and types handling.
.../context/computer/ModuleTypeComputer.java
.../context/computer/VariableSymbolComputer.java
Introduced ModuleTypeComputer class; enhanced variable handling with type information.
.../test/... Added various test methods and resources to ensure new functionality works as expected.

Poem

In the warren of the code, through the thicket, hop and leap, A rabbit cleans and tidies up, no trailing whites to keep. Refactoring with care, new types in fields do weave, Celebrate the cleaner code, this CodeRabbit did achieve! 🐇✨

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Dec 26 '23 12:12 coderabbitai[bot]

Qodana Community for JVM

17 new problems were found

Inspection name Severity Problems
Statement with empty body 🔶 Warning 5
'@Serial' annotation could be used 🔶 Warning 4
Constant values 🔶 Warning 3
Mismatched query and update of collection 🔶 Warning 2
Class is exposed outside of its visibility scope 🔶 Warning 1
Nullability and data flow problems 🔶 Warning 1
Mismatched read and write of array 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked ☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

  • Or via our issue tracker: https://jb.gg/qodana-issue
  • Or share your feedback: https://jb.gg/qodana-discussions

github-actions[bot] avatar Dec 26 '23 12:12 github-actions[bot]

@coderabbitai review

nixel2007 avatar Dec 26 '23 12:12 nixel2007

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

11 New issues
0 Security Hotspots
93.9% Coverage on New Code
0.4% Duplication on New Code

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Jan 03 '24 20:01 sonarqubecloud[bot]

Qodana Community for JVM

15 new problems were found

Inspection name Severity Problems
Statement with empty body 🔶 Warning 5
'@Serial' annotation could be used 🔶 Warning 4
Mismatched query and update of collection 🔶 Warning 2
Class is exposed outside of its visibility scope 🔶 Warning 1
Constant values 🔶 Warning 1
Nullability and data flow problems 🔶 Warning 1
Mismatched read and write of array 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked ☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

  • Or via our issue tracker: https://jb.gg/qodana-issue
  • Or share your feedback: https://jb.gg/qodana-discussions

github-actions[bot] avatar Apr 07 '24 12:04 github-actions[bot]